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.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 26987 invoked from network); 6 Dec 2023 15:03:53 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 6 Dec 2023 15:03:53 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1701875033; b=p/dyc9duVg9MGX4VPsPBLD7l39HZhwJVCyBeuHoZwKCmxNJlxesmpc8Lo3qT+ovrROCPNK9KGC HNSms3KglJlSoSVcIEkC2d5f2RcAPuML0JP79O5G+qxXs5ItYaq14O9GguvSvSlXlPAZROiSm7 r+Jm3lSTRwgyMkLmsYd2UREugwQeh4U9Fohse2rmt7t9YpxoWCcWZWSIwtsbJrLrUb8ngmi7PA iX/jaFDkhSf+Cyuj1blNuw/MCdkjGwbB7fJuYFvkSb9zmM3BkDuXKe1U9qM1rwm2Oq2qmPKJHr 0GayiVSCGEB0TRYIssDs4+o/E85+rx+BNBGINAhhuzvn/w==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (joooj.vinc17.net) smtp.remote-ip=155.133.131.76; dmarc=none header.from=vinc17.net; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1701875033; bh=VeUtH4utIQYA5gdGrG9ZsBM51mRU8isyjY6sZejIjyo=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:Content-Transfer-Encoding:Content-Type: MIME-Version:References:Message-ID:Subject:To:From:Date:DKIM-Signature; b=FEgu43V2F4GdkWndjsuihLiEGD2m3eAt2irzk0LZOK59YhLyp18lPPO9l8yDI24mstFrpvvqCs 1SZ7+ZK2sTX9faZi+Q22lEgNUlMox4Ml92lBSU26kSRJfjag/9OcXut1rip5WKKKkx6yZYKRUX 1IiOQs+muqCCtwE660b3L3sZOAiT6mMyLs5k/UxX8TVUPTqEcL5ANrIaX1XUE2q30HQ+ih9pU5 NCVFKQKIF4T4fgNbgd5oK/yJ8qnXTYCj3dnp+IOl6HQssihSdHKGFnhwnR0ARQItRY3PROi24j eK/2TB2JcWQeLzScGK+qYwz/8lIOvnYNbMSVGY/vYXDapg==; 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:In-Reply-To:Content-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:To:From:Date: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=FkomWlTMjjFBJ6PFy9qqnuQ8AzFdusMcMuww4MknJCo=; b=jcIIe1XIhpZ5sXw5gUUy42yxnf dKzKKSILNpcfAVv5KtBwH0in+g0WnewvKKAeFOUw0JLi3k9cnL739o1sjr+LPFC+Rhm366wLzUxr7 waIe8/Yho7EJheomif0xR4/wr1XZ/Ae4o9sgqwTYhe4l2A0GPjnkx/I/+MZIYZXPuPuErRSlSaKiH QkA1/jbv60pGtETU+Dg0mLyG2VMhaH4e/hPIr3EKO3MsJg4PnDuGxqV4TMna59AWizuUjmmyl689b bLLW+Pgjv+z4e8wU/+NO2XMf61tn2a3Aqc9Bi1TQtgL1OonpbG/Q5RkfYpOLFic5FLrij82EkOFKB QBykSvtg==; Received: by zero.zsh.org with local id 1rAtRH-000Ml8-LL; Wed, 06 Dec 2023 15:03:51 +0000 Authentication-Results: zsh.org; iprev=pass (joooj.vinc17.net) smtp.remote-ip=155.133.131.76; dmarc=none header.from=vinc17.net; arc=none Received: from joooj.vinc17.net ([155.133.131.76]:41264) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1rAtR0-000MTd-Ln; Wed, 06 Dec 2023 15:03:35 +0000 Received: from smtp-zira.vinc17.net (135.197.67.86.rev.sfr.net [86.67.197.135]) by joooj.vinc17.net (Postfix) with ESMTPSA id 0716D71B; Wed, 6 Dec 2023 16:03:33 +0100 (CET) Received: by zira.vinc17.org (Postfix, from userid 1000) id D32D8280019E; Wed, 6 Dec 2023 16:03:33 +0100 (CET) Date: Wed, 6 Dec 2023 16:03:33 +0100 From: Vincent Lefevre To: zsh-workers@zsh.org Subject: Re: [BUG] With CORRECT_ALL, an interrupted correct puts a truncated entry in history Message-ID: <20231206150333.GA385094@zira.vinc17.org> Mail-Followup-To: zsh-workers@zsh.org References: <20231205021217.GA357346@zira.vinc17.org> <20231205125732.GA1126552@cventin.lip.ens-lyon.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Mailer-Info: https://www.vinc17.net/mutt/ User-Agent: Mutt/2.2.12+67 (757ca3b3) vl-149028 (2023-09-09) X-Seq: 52381 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: On 2023-12-05 13:22:07 -0800, Bart Schaefer wrote: > On Tue, Dec 5, 2023 at 4:57 AM Vincent Lefevre wrote: > > > > I thought that this would have been put in a temporary buffer, > > until the (possibly corrected) command is validated. > > I'm not sure what you think "validated" means here. Once the user has no longer any way to discard the command line, which will then be really run. > > I think that ^C and 'a' should just skip the history. > > I'm not going to make a decision on that without further feedback. I > know that when I use 'a' at the "correct" prompt, I often do > eventually want to go back and re-execute the command even if I wasn't > ready to 'e'dit it at the moment of the correction. Yes, that's why I had suggested an explicit action for that, in my first message: │Nothing about the history. I think that the history shouldn't be │changed. But in this case, a new action (e.g. 'h' for "history") │to discard the entire command line and put it in the history │could be useful in some occasions. Or just use 'e', then immediately put the command in the history without running it. Is there a zle widget for that? I would find this useful even when there are no spelling corrections. Note that I often recall commands from the history, but sometimes, this isn't the right context, so that I may get a spelling correction after hitting [Enter] or ^O (accept-line-and-down-history). Putting the command in the history again if I abort ('a') is not needed in such a case and will even conflict with a possible future use of ^O (because I won't execute the subsequent commands after an abort). > > In particular, the current 'n' one is very ambiguous, because one may > > want to run the command without any additional prompt for corrections. > > So perhaps there should be a real > > > > r (`run`) > > Why would you want "discard all and run" but not "accept all and run"? IMHO, "accept all and run" is potentially dangerous as one doesn't know the spelling corrections. Proposed spelling corrections are useful, but they are often wrong (e.g. for files to be created or arguments that are not filenames) since the spelling correction mechanism doesn't know the meaning of the arguments (unlike the completion mechanism). With "discard all and run", the user knows what will be executed. This can be useful when recalling complex commands from the history. In general, such commands have the correct spelling. > Anyway I think that's more typically handled by distinguishing 'n' > /'N' and 'y'/'Y', although (see above) 'a' already discards all. but the difference with 'n'/'N'/'y'/'Y' is that 'a' does not run the command. -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)