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, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 5354 invoked from network); 26 May 2022 01:26:38 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 26 May 2022 01:26:38 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1653528398; b=JtFUiF8WJSIBPIyYU7DLRW6O/KZ54dC17d1f+p69NSTn54J3vTyk/ynfFR8/6R1a97fMAm8ogZ Xdy785Tses0iaFBdL7lBvrq/FSXWBGIiNLLCMTkaU7OHh4vuhtc0w4Xoy9oZvFzRSk8QS38Wci /axohpTUkczUVrWPUBobpjiLLFweuLpqZZlwzAKCTvuqSgRahhIutQBqUg8wT8NmdLIiehYUe6 roxjIRtl3kIJ1irC5tmbOocbFpckGH9JrZf4lOnnixRagjjLiuULiwlCzabf6jPoAKG5HuD/4Q ZS8oizjdOWkU+m1RlAe01LU/iYsNo3CdfWNntSGg+aZ7Qw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ej1-f46.google.com) smtp.remote-ip=209.85.218.46; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1653528398; bh=1Z+q6on5izVtbxGyMm1efr/S6E4/MrE95KqIrGSpR9M=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=IAGeSnhEFvQboIB5ewyUZaLmjKNal3ZbQpuXbCjJLJQ6dbBxbjzl4oKbnNoqhpISh9hNoCY9OG x7Ft0vjylOcFreyBftV6pbDSIWgcgTctMxuZPhwX8/HteNA1Eb8MC55HY4XgqrSaXAgVkrGv8K EsnBVraiQAV3plFk/mXdSFms0CIzFJMtOASXuTfoAQpAhnvSgULfa4jaLXzp1Xj8RYZjzXNFMW MNQy9RjiouOcS118j9EEBgQgzO1sZrxUZNB6/5u+nd7KG8Bu//x+W9DESrdxYKZkQjNyRP9Lgx BZGWgWMW1oB9oci4qA+a7zrMhg7h2u7rVNcalk03y2HbWA==; 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-Type:To:Subject:Message-ID: Date:From:In-Reply-To:References:MIME-Version:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=0eGrIy+jm1HYNLCnBQskmsYhQI3OSfvYq3lepmhRPCg=; b=LBYOKRyNIlmWG/95KGj7OEYWOW hFf/fYPY2Bji/QJaIabIRO8Ftc0yuPtWpwWyR8IVLio4NwPcJs7/44DjvhwFcy65YqWUOVTfKUlEk gOpWCH82rYNXL8Ro9Q+z9WvJrkYoSlmRx8BGPf0Jx7pacpS9gmzcTVp4tR/3ai06Kz2h+4D9UfdKb +17sClU0d3smMZe+XDGtY3UwgF1rcWQMX8ypWOD+QUTxEeXh8+VDXilVBaL2kzGeJdJ/mYWkGFH68 AEtlT7B+pJ6F20R6wmQTD9ov7YDhE3cz9W0dnXDNNVuU7bzKuIEIlo4EhvoZf8QjUXGB8J+Fkgfsw szNwr2qg==; Received: from authenticated user by zero.zsh.org with local id 1nu2Gq-0001nK-Os; Thu, 26 May 2022 01:26:36 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ej1-f46.google.com) smtp.remote-ip=209.85.218.46; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ej1-f46.google.com ([209.85.218.46]:37417) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1nu2G8-00016N-9K; Thu, 26 May 2022 01:25:54 +0000 Received: by mail-ej1-f46.google.com with SMTP id rq11so376592ejc.4 for ; Wed, 25 May 2022 18:25:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=0eGrIy+jm1HYNLCnBQskmsYhQI3OSfvYq3lepmhRPCg=; b=Xzq6QVSv8nBTmBKdgLZ3FhwvqtmeFn6Y+ewRiVAfByAzHorjTxnuh64VdckaWWoq0T scSU3AyXuQJKt/d8cLWWTtPcjVhnCw5rf4sEGMAWC7BnTVJ6+TM/4wlmtyt37FLt/k7q tmv7l6oD/jK5oHTh2dtC8fZBvz2XRKTKzXap7l/AJ3v44wHR+2Mqc1pJEoE3XPaZQHsa cZlnBU5MGArbttfRfG22yq+zi7XyZLlfykMEIxB5O5v/rz7bnyNfpDRFjAhzai9lT0T+ s1lRvMbxvmZKrK041XpTARcWtirWHc41uxI5pcn6ggXYWUujb1gxxKffz2y9xaw6hWkg aqMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=0eGrIy+jm1HYNLCnBQskmsYhQI3OSfvYq3lepmhRPCg=; b=2lwMk9yyjfju9Y7RFuL6nCJmdYONFPYYxtv0licVmBh30jfVEvTjXd2t1bfCM5fFtI TgxbIun3sg+GaN9ukt+cG97fmBMX/ITFUDxLVvVvRD3iqE+2nV5WKpnmUnNXkDEOSR45 IbyErrHaH/H/XMrIMmtPbDOK3tCy58IIsrnI2ANFUtCLfizT+17Q3YGMD1PUPP5wBIJo 2RlJ3M090WlHlVMjhXI4y/Rdc2iCXEy8KebpKCALcY7gz9wG73bcO84iD3uEAm9xshBm uoVI2xUgFfXZlumvNyFoRu2sbIxNTLm7PPc5kIJhsRFGzaaBOSvTn0eOJBS0sgb5+uiP BQbQ== X-Gm-Message-State: AOAM531dxhapE6im32lq7CaapFLfaoeTCoh3UZUl6V0hSsUT6bmSSOD0 Sy+0FfeOxJE4QsbqN+ML8+7fcT+3LjtYgwC2h1i1QXL43fA= X-Google-Smtp-Source: ABdhPJx8r4oODFKuA4s306HEsZcFVUAEH3dC1vQs1zmEV5AHxZ3fqYvPB1wZYimmiwBzQa970MVyYBga5MgY5OAXJho= X-Received: by 2002:a17:906:6009:b0:6fe:9813:14ea with SMTP id o9-20020a170906600900b006fe981314eamr30203399ejj.732.1653528351304; Wed, 25 May 2022 18:25:51 -0700 (PDT) MIME-Version: 1.0 References: <20220524154738.GA35284@cventin.lip.ens-lyon.fr> <20220525025403.GA97860@zira.vinc17.org> <20220525084920.GB97860@zira.vinc17.org> In-Reply-To: <20220525084920.GB97860@zira.vinc17.org> From: Bart Schaefer Date: Wed, 25 May 2022 18:25:40 -0700 Message-ID: Subject: Re: prevent some lines directly coming from the history from being executed To: Zsh Users Content-Type: text/plain; charset="UTF-8" X-Seq: 27801 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 Wed, May 25, 2022 at 1:49 AM Vincent Lefevre wrote: > > There are some display issues in some cases due to the "Confirm"... Probably the same underlying issue as I recently reported with zle -M ... but read -q confirm$'?\nConfirm? ' might work more consistently. > Instead, if the condition is met, is it possible to remain in ZLE > with the current buffer, as if I didn't do accept-line? [...] > Or perhaps I could change the bindings to use a wrapper around > accept-line (ditto for accept-line-and-down-history). Yes, this could be done as a wrapper. If you want to try to keep it in zle-line-finish, replace ... || BUFFER="" with ... || { print -z $BUFFER && BUFFER="" } or similar. > zle -A accept-line real-accept-line There's the built-in ".accept-line" widget for this sort of thing, so you don't have to create a new alias. > zle -N accept-line accept-line-wrapper > > where $PS1 contains "%3v", and with psvar[3]="" in precmd(). > > Could there be any issue? Or is there anything to add? I don't see any particular problem with that approach.