From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 24094 invoked from network); 15 Apr 2023 04:50:08 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 15 Apr 2023 04:50:08 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1681534208; b=Yi0wuLpkNUO69Wnbz2Q8nE2NVbeAqDBiJSD6CmYc9mKmkJ4ujaaIp5LNcnXcYKLZNezShIM/03 t/jDLiKrclZjWpxCDqzmyVmcwAirO2OHR+1m7Z/4XmRjlB8f7XFcW1wG9YZzwCtY3A7YIPqxZR okvOtTaGr6oqFpxN1nL6OYJdQskofMYSzrU1upLlr6NZbNZ9piOzbnmVsTWTanxn3FGC3enRMO jXrBoPbxbVqpQIkaGW5Q9skb/eDhnRs5c38e3rVuxMY64oSm0aikC3ejGrxwiFFuBXgKzDLR5l pvISGK8vjoYo/aJldo+Dp5MXmbTu2kUbKOZcFOHhIqTvWg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-yw1-f174.google.com) smtp.remote-ip=209.85.128.174; dkim=pass header.d=gmail.com header.s=20221208 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1681534208; bh=+6m1/Yccb0dJBoRXF0o87LSY+g9fvIwFLTgMf4qXkSE=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:Cc:To:Subject: Message-ID:Date:From:In-Reply-To:References:MIME-Version:DKIM-Signature: DKIM-Signature; b=IoF2CTJI37X2NcKpx7ZraBjIeGp7obBagtYg5UKfAoAOY1lfZymnxPn5svF9WEn5d5GH6+R3Ne 4K8md+q+lG52RLlG7QOzzLLWCA/DRIQa5zaAItc/hrn6P5IqDJ5Rg5PTSsRkaUF/binxB14G4j HkvJvO7/iqhN/t9dk7YE557HG6bwK8SP4Y6VKXr9ZV3W47FE5LgU0eXyHYr7OkYd3GPMg9UAka jKjYQ9Ecp3VPAtAPL4Txay832CGfudedl/A4a6dJW3rM8kywS+2V8b0eDoHiihG6OfRKE4uDr5 4sZT9mpF/A/JjkOJAQ7U1tYsyKtGvOMpMRa9Uu4K+AKdYg==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Transfer-Encoding: Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=VbB+/qli/7maN4i+TD4rbWiZUy2i3GWf3gwAE6FNq5M=; b=brvUHcpIxmOKKMjF/ULB2Mx6+Z rQvzmA7yZV9kmHqH3qAHAcMbeJyJWs7bEEcF92T60KyKdFiLJu2gMuoDiYvV3c7FOTnCoUDD1YTK+ r+KmK5FTuVvRGSyp4YqgYG/bxj1/TrmqyrB7RDu9xT24yylDXxEH8CDkoI054z+1msWMs57M1+v56 ZoI7MajrnFGKgelA+C/EF8n6Zq3XR5+nJvH74stNaHowy89uS7eFr6goVY+YufQtL+/Ey6gqQXvvM pchMrhGGk+dNwK26ntdF9QFrJ4vNFBQ1oPTIuSFrnfeuvXsMcGcmFzoJLtScoI3aSAcob1x175DTC 58kWkOTw==; Received: by zero.zsh.org with local id 1pnXrS-000Izy-5E; Sat, 15 Apr 2023 04:50:06 +0000 Authentication-Results: zsh.org; iprev=pass (mail-yw1-f174.google.com) smtp.remote-ip=209.85.128.174; dkim=pass header.d=gmail.com header.s=20221208 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-yw1-f174.google.com ([209.85.128.174]:45774) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1pnXqb-000IEZ-TH; Sat, 15 Apr 2023 04:49:15 +0000 Received: by mail-yw1-f174.google.com with SMTP id 00721157ae682-54f6a796bd0so258612317b3.12 for ; Fri, 14 Apr 2023 21:49:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681534152; x=1684126152; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=VbB+/qli/7maN4i+TD4rbWiZUy2i3GWf3gwAE6FNq5M=; b=bnfoca4Nx82F1zeRYiM66nqxvZ7JN/gfyENnf0d+3z1DT0OcXehsokm+OgeErSKNPJ sdtB2LFDnsHN2pQxRkzBk6oD9S2/i17uMohtIE4FF6t74PhRCEjLeFuN3RLnJQnq3GBZ bnIjrFqtEM6y/Kcj2DmkiEr+6JoUdUX++kZ8yepozls3ODlaUtuuMK0fYb7ZwOyRERy4 LOkSWjYJjBKMUiPWl0o0/NzI+MY/cLhU9ni0oujeR72HIhSGfctvZw4XSh6mIksJmIgb po0uHOC6jXEjSwmcb1HJBoPJw8ZIHHbyjQr6vZ/Y8NXQMSZSkJxwhiVG/Q8Q3SQl3EhX qsXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681534152; x=1684126152; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VbB+/qli/7maN4i+TD4rbWiZUy2i3GWf3gwAE6FNq5M=; b=GrKlf5gKzUy6GJd7YcjzemTmLLW60bSUh2gmvNYNApD7qP4ws6mBRmLd+li+RuULUm mvuVJlNAR2BahRjha3O9OSRQ5CgkabP0DeDdIgL7d70GDScaSWdfNx8a8mW5oCJGQATp ERhnK9jTQLG39A8y51+su+I9H8Rs97Fy0AfnpU6GWz5bL1MlzKMKI4kCNvO+FmlDGV+8 rOCJebahC97IO9tSOWVKH7KyzyssP4w1cwkSxlQiXRfAbVFsZcG4DWUHjtGtpnMGXtyD 9lZXrq30bBEzg6L4Q1X6Eey8N35NQ3vog6P2ZryZcauuBQIYE1/aiEgVB3jOBKXAe77o lI3Q== X-Gm-Message-State: AAQBX9ffIg9BLrNJus2gVQzeF02KYGQwYGoiq76yMkMdHM1DnrY1LWhT FNgBp0LEKTt4wSs15ieFSzc5RLi128rIXICpuOM= X-Google-Smtp-Source: AKy350a7D8ggNf7goNFZvVbIMP+RsK1cuwY3vNfevvEF2iJI4vhbQcrpb2IpA5BtrN6qS90SmhWpCYcxlICv9O68thI= X-Received: by 2002:a81:af0c:0:b0:54f:bb71:c7b3 with SMTP id n12-20020a81af0c000000b0054fbb71c7b3mr5153263ywh.9.1681534152445; Fri, 14 Apr 2023 21:49:12 -0700 (PDT) MIME-Version: 1.0 References: <81609CF4-42DA-4E0F-A6E5-C5D58578B4F7@easesoftware.com> <9a1f77ea-ee4e-95ff-a571-5cd3ddce6cb2@eastlink.ca> In-Reply-To: <9a1f77ea-ee4e-95ff-a571-5cd3ddce6cb2@eastlink.ca> From: Felipe Contreras Date: Fri, 14 Apr 2023 23:49:01 -0500 Message-ID: Subject: Re: .zsh_history To: Ray Andrews Cc: zsh-users@zsh.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 29022 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: On Fri, Apr 14, 2023 at 10:28=E2=80=AFAM Ray Andrews wrote: > > > On 2023-04-14 07:36, Felipe Contreras wrote: > > > I do remember that one's control of history is essentially perfect, you > >> can get just about anything you want. History is one of those feature= s > >> of zsh that is tractable and understandable without too much head > >> scratching and without any weird gotchas. > > I couldn't disagree more. > > > It could very well be that a closer examination than I've made would > reveal various mysteries and gotchas. All I can say is that I've never > wanted something from history that it couldn't provide. Yes, that is true. My current history configuration is *exactly* what I want. I have a large ~/.history file that is updated every time I type a command, but it doesn't affect any currently running shell (inc_append_history). In addition to that, every command I type is stored in a separate historical file that I use to generate statistics (top 20 commands and top 20 directories). So let me clarify my statement: the zsh history configuration is very powerful and simple, and it allows everyone to configure zsh the way they want it. *But* that doesn't mean everyone understands all the configurations. So I think a more accurate statement would be that the configuration is unidirectional: everyone understands their own configuration, because they had an idea of what made sense, looked for a way to achieve it, and found it. But other people have other ideas, and their configuration isn't necessarily understood by others. > One exception: "$ echo one; echo two; echo three" ... you can't, > AFAICT, break up the line into it's component commands. Is that really a zsh thing? I think the same happens in all shells. > I'd sure love to be able to pull just the text of a single command. I'm 100% certain you can do that, but not with history expansion, you'll need to use zle for that. To me (and I'm not sure if this analogy will land), it's like trying to update CSS dynamically using CSS, when JavaScript is the tool for that. This is not something I generally use, but I checked the documentation of default zle widgets, and you can copy the previous word with CTRL+ALT+_ and you can switch back and forth the previous two words with ALT+t. So you can write zle widgets to do anything you want to do with the current line, but that's significantly different from history substitution (e.g. !!0). Cheers. --=20 Felipe Contreras