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=-5.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,NICE_REPLY_A,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 12818 invoked from network); 16 Apr 2023 16:37:37 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 16 Apr 2023 16:37:37 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1681663057; b=BvQnBzMD7ytz/uCKaJ8biMiH5XmjB8Ip0MHiAleVTtTto91O9a0jPXgV5O957cwXkgmCK3UA++ ySGyEUlHkMQFnnfE7U9GjiKkyElUcCPwW+5Ymb2W52P0pRFhyEQ1R65dleWwMomTsoBPRQf9h4 Uvet1LmI2NANsivoCcxBGKHaYbCeyFpu0Dl5GRfQ3ZB83dB8siZjEUxopM+kk1Ua2L19tzAKCq LzarpcDo3HWpwiKok1uxmqYrvFpGh8+KvUJ0aydf43oeAsX9MIi4U1KTzO0kcvEjbnabZIUhMG EkEqxLhC4mGBdNPSx1M8ipvgwXh87DjzYOB43r+XTKMaEw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mta04.eastlink.ca) smtp.remote-ip=24.224.136.10; dmarc=none header.from=eastlink.ca; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1681663057; bh=JBxffvI0bfIRQrLsJG3Awz1vW98cETaSy6LnEPReKX8=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:To:Subject:MIME-Version:Date:Message-ID:DKIM-Signature; b=R3nep+3dndjBZqZM7Es/3j7xiWoBDqOmE1N5NjupQk9lbLYZGOI2/F8yOQNQTZIcv6aPcJiO6M 65bc3QRimrlurFKMTbi6mTIEBMEA31huMw4urHRvKIuIdtG0Y1rhkl6KzDITnmhmhRcUkBXP6x tygShxzR7dNgE6Db8ACASopNAFrh9jyqtQJNcebMIp3toQiGh0txjmeUbju+AmVG/cBc0ic/Cg dKPT4GW6TeXiHgzCiJXIwVAOeQcV0T5e+w+DLBwfr1hEk9EgVU7zhaBJ0Aw/DqQuFVoj71NIhQ F2e6gSXHITN9CXmoT0SQm8Be556V+iX5xUkhe/wMBlW0Vg==; 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:In-reply-to:From:References:To:Subject:MIME-version:Date: Message-id:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=hHsfpwTiummVompSUy3PeemFfR+q1yfgodr42wNY+bw=; b=X8IieR8xh4g13SqjUXEUf7BQfL oYuqoXOL3YJzqu5JaZzYIVF4TZmRXdaxuKQy2lAJ7B2SnWpQNE5skSkF5AvOnJY1p6azPxC4Bjjlp QPxg9ZY7cCpJsMV7LObw7D2iuF88ssD6FDixcWkDXpDOamH+rzRI6LvKhXt+J4pEKwk01z3uf6So0 8/3bSyizjhEV1ktyjmiCgVSpWpgKNwYgx5eQWEi+x772GsGDqONU+rYrvrqHDvFcU9ONuwvotIEwo YRPiQiv/USF21jd236EYyX3mhrmYTle/gBIdG6jv8RV0aT7pHlj8wHKxPxuNK1Ysuzgm5CXyu9S8C NppIf4Jw==; Received: by zero.zsh.org with local id 1po5Nh-000FFL-QB; Sun, 16 Apr 2023 16:37:37 +0000 Authentication-Results: zsh.org; iprev=pass (mta04.eastlink.ca) smtp.remote-ip=24.224.136.10; dmarc=none header.from=eastlink.ca; arc=none Received: from mta04.eastlink.ca ([24.224.136.10]:59354) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) id 1po5NG-000EYk-0Y; Sun, 16 Apr 2023 16:37:11 +0000 Received: from csp01.eastlink.ca ([71.7.199.166]) by mta04.eastlink.ca ([24.224.136.10]) with ESMTPS id <0RT700CA0U2Z0TI1@mta04.eastlink.ca> for zsh-users@zsh.org; Sun, 16 Apr 2023 13:37:09 -0300 (ADT) Received: from [192.168.0.4] (host-24-207-18-108.public.eastlink.ca [24.207.18.108]) by csp01.eastlink.ca ([71.7.199.166]) with ESMTPSA id o5NEpenFehhvwo5NEpzJtj (version=TLSv1_2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256); Sun, 16 Apr 2023 13:37:09 -0300 X-Authority-Analysis: v=2.4 cv=NdAglUP4 c=1 sm=1 tr=0 ts=643c2435 a=xN66ZtSbq5jdJYpBp7G/jQ==:117 a=xN66ZtSbq5jdJYpBp7G/jQ==:17 a=IkcTkHD0fZMA:10 a=GDXetfrMu_L-sOpwNg0A:9 a=QEXdDO2ut3YA:10 X-Vade-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdelgedgieduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecugfetuffvnffkpffmpdfqfgfvnecuuegrihhlohhuthemuceftddtnecunecujfgurhepkfffgggfuffvfhfhjggtgfesthekredttdefjeenucfhrhhomheptfgrhicutehnughrvgifshcuoehrrgihrghnughrvgifshesvggrshhtlhhinhhkrdgtrgeqnecuggftrfgrthhtvghrnhepiedtjeffvefgtdehgefgteekueeggeeitedutddvvdduteetffdvveelgfeukedunecukfhppedvgedrvddtjedrudekrddutdeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvdegrddvtdejrddukedruddtkedphhgvlhhopegludelvddrudeikedrtddrgegnpdhmrghilhhfrhhomheprhgrhigrnhgurhgvfihssegvrghsthhlihhnkhdrtggrpdhnsggprhgtphhtthhopedvpdhrtghpthhtohepreerpdhrtghpthhtohepiihshhdquhhsvghrshesiihshhdrohhrghdpghgvthdqkghiphfrrghsshifugepthhruhgv X-Vade-Score: 0 X-Vade-State: 0 X-EL-AUTH: rayandrews@eastlink.ca Message-id: <037a075e-14ee-b68e-44f0-de81425f4c4d@eastlink.ca> Date: Sun, 16 Apr 2023 09:37:08 -0700 MIME-version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: "Pull just the text of a single command" (was Re: .zsh_history) Content-language: en-US To: zsh-users@zsh.org References: <81609CF4-42DA-4E0F-A6E5-C5D58578B4F7@easesoftware.com> <9a1f77ea-ee4e-95ff-a571-5cd3ddce6cb2@eastlink.ca> <8b0f0941-5212-5268-1f9d-d7542990439a@eastlink.ca> From: Ray Andrews In-reply-to: Content-type: text/plain; charset=UTF-8; format=flowed Content-transfer-encoding: 8bit X-Seq: 29037 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 2023-04-16 08:53, Bart Schaefer wrote: > It's much worse than that, consider You know, as a logician I'm quite aware that there are things one might ask for that are logically not possible to deliver.  It's Godel's Theorem applied to tokens.  Heavy duty stuff.  In my case close will count. > % my_function one && my_function $PATH || my_function three > filename > > Or pipelines, or backgrounding, or if/then/else/fi, etc. You will > need to define what you intend in each case (please, not by writing it > in prose here). > > The ${(z)...} expansion does a best-case job of mimicking the parser, > so you can start by using ${(z)1} in preexec and work forward from > there. The simple case with semicolons can be handled by > > chain=( ${(s:; :)${(z)1}} ) That all sounds quite promising.  What I have now works 99% of the time and I'm not interested -- except as a brain-bending puzzle -- in trying to break it, but I think what you're suggesting will be a possible simplification and that will be nice.  Some virgin territory here tho, so I'll be getting stuck most likely. >