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 27787 invoked from network); 24 May 2022 15:48:37 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 24 May 2022 15:48:37 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1653407317; b=SlkHcBO+kjnwQEPgkWsL3Zu83TGaS8+6uZ/xbECmB+8/+gR7Qx0+OEYA5j4I7EkottWbIB+sjV 7E6Rv5qMOz7z6r1iBHDry5y+ancuThYq/eiHNo0hMqUk6vBj6ne2HXaZHUQoEu9qbKRdMfMkO0 nsJxqxtzi6NE6KKUmQuFjWHOJqczKVngHJ9ocVxpMdd4zI3qcuSXb+eYIWj+Lxe7WpZ3+u67BD XX9lwSoClm9IYVXw895MRjy7+5v4E2k4+A7hkBSh9ZRwLFZUc6LkUUk8Ub+55UzzcHTgJDaxoy V3ZeVOZKplcns1XA08iW8Kksr1pdiHf7lxaw8pwIUOeHRw==; 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=1653407317; bh=ssU6x49tzW4LdVF2s4VLH66kLH5Q+rSHd0nbem/w7Vc=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:MIME-Version: Message-ID:Subject:To:From:Date:DKIM-Signature; b=GQfUujUWDdC8qZG8qNCCZ/gpLtUbEI3T4h/ywTDOaWSYCBKlULAhQ3g3yHpPNKT46O2Mu6qgKn Q08W0lWQEd6DtG3EJOhO6JrDFoz38nL8FDDFUQHj7Ny+556i6wcquqh1kaCaEdKtIIgVe4h3Bm hHyuRGK4dsM4OdiwOX2YUNSS97qjmyyxXndroHwkcEE2RY0pwf+5YWAxRQgPVhlAmvlfp646NU dxqKyeM4ELFL3m995LGmdvn0Aa1Vo+tkgDtRPer4u6J5lYOZNLwfAPXVMhkmA24pw5urZ5MkKs Ji+gju3mLw+BzJM0W4Ihpq/Ea+X4mVbzDSha2V/W8+UkHw==; 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:MIME-Version: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:In-Reply-To:References; bh=wmEiT4ynpUFC1uz7ZkzVU20klAaX5zwtxjL6VTNLtdc=; b=JKUpHQA1IaPWnGadmmTspAzNMH HgIOOfNCNpgZrCYh9sj9Nib64rx2QzvK3oBIjccAM2V8KYidabCTaPCucfUS8dZpfvE9ztct+XldL ApQi4aT0ZmQMxlEbT/mntcbKAjvdwF7rvqnSqUokrN3jo1FlhP2EwIpuzozZr7QZX90nbRrpAzg2U gOmtoQRxCKqT1sB+fiYFADvGf0UHbcvbAbCU+uwZ8WmtH2lZ+0TMSPo5l1D7pYMZZGZNx4pMOTv+G VPMhD3btmaH9VHIOGV87iSw4JDonhefoQHXKs2McLNPXE2s6dYTg5mgZT+RhNGsX4ha3bEj1K6NN+ 3toDDguw==; Received: from authenticated user by zero.zsh.org with local id 1ntWlw-000Jrj-7P; Tue, 24 May 2022 15:48:36 +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]:47734) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1ntWl0-000J8D-G8; Tue, 24 May 2022 15:47:39 +0000 Received: from vlefevre by cventin.lip.ens-lyon.fr with local (Exim 4.95) (envelope-from ) id 1ntWl0-0009Kq-1T; Tue, 24 May 2022 17:47:38 +0200 Date: Tue, 24 May 2022 17:47:38 +0200 From: Vincent Lefevre To: zsh-users@zsh.org Subject: prevent some lines directly coming from the history from being executed Message-ID: <20220524154738.GA35284@cventin.lip.ens-lyon.fr> Mail-Followup-To: zsh-users@zsh.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Mailer-Info: https://www.vinc17.net/mutt/ User-Agent: Mutt/2.2.5+22 (1066be97) vl-138565 (2022-05-21) X-Seq: 27796 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: Hi, Some lines coming from the history may be "dangerous", in the sense that one may not want to executed them by mistake (e.g. for lines recalled with a quick Ctrl-R ... [Return]). Is there some mechanism to prevent such lines from being executed if they were not modified after recalling them from the history? E.g. something like a hook that would inspect such lines and return 0 or 1, depending on what one wants to do. Note: I do not want to blacklist such lines from the history. That is, such lines should still be there in the history to make sense, but they need some kind of confirmation before execution. -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)