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 30184 invoked from network); 5 Dec 2023 12:57:53 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 5 Dec 2023 12:57:53 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1701781073; b=q84Td4cewP61gXgaazl/4dLV9K6Dt3hD5R1R6pRohsgc9LpIRdW6ku2fKHzUMdZm5TYCfgXt0c oNUvK3nV1iyVzKRYKuZYTvGaSaQz6LFOnzwW+BUkuuLY9GwKNHcyRZyn7gwqKyQN685C1INjKy kCps2ZpYv5G8ryhyCYLJdPVZ4JdJbLI9Q3XKPzY68Ksh04R0GeqiXazrHaSmTdUtDr4joHxcDN gc8RTpNtfQGiJmf/Kc5p0xpOcx65xlmz485SgnLXzEqcKRS7J92gvtj+xo8xjFvwTs6omGQAiC 9WoH8VjefqBhvXVrBNyX47XS4/b5D7Q63jXnw9C/nqW2QA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (cventin.lip.ens-lyon.fr) smtp.remote-ip=140.77.13.17; 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=1701781073; bh=F/GGyoxY5bGID2djzPo8kdyrVRRn4zyl1CEVBw1VIK0=; 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=AUUYbDm5XTuJg4NUqB3trDEXOzTFDCdm/EbrMRgHaNvEJfvXkn2jHQd5x3xVRW/NzTBw/31/S5 pgHSfnlnpYPEl+HeLi8nwUlSR6nW0glyYW1WVsBHiGBHUa+AEHXKcMt6IapCA/xATjXsxryJQw VHbDeNnEntcPnxfePCZZtllOUYiH3I9r1ps58BVtSs6NyJA2jWGitUU7f1niQjBABQ1ABL2686 dMoiGIrHKYLKusmrPHBl7deZGumQToF12JTv29zrMHufvMictea65hi1OKAHEtDT3lrEJpiZ35 nsMcgJ+Pq08x1oq8z7AuQY33TWtXVWYskUDTIR4S9bEYEw==; 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=cNKyWTq690oXUI6Y21n/0Go62rzuHQR0yGty9EwjHtA=; b=rLrrcryqblUApdvGEvJOR3msnK OhOV0xm23LrJLJQz0c89OX4KzNjgO6ZtiqgAfFNGLPRVlNj4EMQPIy7hKHk2vdcp4WYx7nwvHSU32 pwdnV30LHZGteplssVLwSBrUISzfGB9AbXnv5E1RwXIkCNVO9/d8hueOpmrpDSBUEFhwNavlYM7HQ MdOvNnBKMtqiF2pDy5ELkJc8L/Rm21so8wWudQbtobunDMmqLBhOTkcNCIFelJhK6ou0Kcpsboewo H6/DfdKfINI4SDOS0UKywOqfPw6Bjs/Pas0IHuPHSlJgMdakuDZE277ef9/3AvWw0jPyPtpHzL0aU jeCzE56w==; Received: by zero.zsh.org with local id 1rAUzn-0008Qb-Lc; Tue, 05 Dec 2023 12:57:51 +0000 Authentication-Results: zsh.org; iprev=pass (cventin.lip.ens-lyon.fr) smtp.remote-ip=140.77.13.17; dmarc=none header.from=vinc17.net; arc=none Received: from cventin.lip.ens-lyon.fr ([140.77.13.17]:51692) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1rAUzW-0008A8-7N; Tue, 05 Dec 2023 12:57:35 +0000 Received: from vlefevre by cventin.lip.ens-lyon.fr with local (Exim 4.97) (envelope-from ) id 1rAUzU-00000004jHu-486o; Tue, 05 Dec 2023 13:57:32 +0100 Date: Tue, 5 Dec 2023 13:57:32 +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: <20231205125732.GA1126552@cventin.lip.ens-lyon.fr> Mail-Followup-To: zsh-workers@zsh.org References: <20231205021217.GA357346@zira.vinc17.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 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: 52379 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-04 20:10:10 -0800, Bart Schaefer wrote: > What's happening here is that the corrections occur in-place as the > parser reads words from the input line, much the same way that aliases > are expanded. > > When you hit ctrl-c you cause an interrupt signal which stops the > parser from reading any further input, but because it's interactive > the shell itself doesn't exit, it just forces the parser to return. > The history mechanism then records what the parser read so far. > > Conversely when you hit e.g. 'a' the parser is not interrupted, > continues to the end of the line, and then returns. Again the history > mechanism records what the parser read so far. I thought that this would have been put in a temporary buffer, until the (possibly corrected) command is validated. > Changing this would potentially require changing the way the > lexer+parser handle interrupt signals in general ... or changing both > ^C and 'a' to skip the history, I suspect. I think that ^C and 'a' should just skip the history. Just like when one types ^C in zle, the command line is discarded and not put in the history (here, the parser has not been involved). > > BTW, the behavior in case of several spelling corrections should > > be documented. > > Something like this? I was also thinking about the SPROMPT documentation. The following is inexact: n (`no') (default) Discard the correction and run the command. y (`yes') Make the correction and run the command. One may think that the command will be run immediately after 'n' or 'y' (i.e. not checking for other corrections). This should be like Discard/Make the correction and prompt for the next correction or run the command. 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`) Discard the correction and run the command (without prompting for other corrections). -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)