From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 20dcc804 for ; Thu, 14 Nov 2019 15:41:14 +0000 (UTC) Received: (qmail 5134 invoked by alias); 14 Nov 2019 15:41:05 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 24435 Received: (qmail 16525 invoked by uid 1010); 14 Nov 2019 15:41:05 -0000 X-Qmail-Scanner-Diagnostics: from out2-smtp.messagingengine.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.0/25628. spamassassin: 3.4.2. Clear:RC:0(66.111.4.26):SA:0(-2.6/5.0):. Processed in 6.131997 secs); 14 Nov 2019 15:41:05 -0000 X-Envelope-From: d.s@daniel.shahaf.name X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at daniel.shahaf.name does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=date:from:to:cc:subject:message-id :references:mime-version:content-type:content-transfer-encoding :in-reply-to; s=fm1; bh=vnq0VwOwh6sNu+A1gAn3C64WWW0jMJE3VpahkQbI 0bo=; b=UpDBE8kkNYNJN/M9rEmp6TAOJATARuUft2wljrnDDRykHBsVmx7+6QPS Q6n1+QBOvyBeWQgI2D0F6YwrlTVg0fbiCk8bTxuAD1xQptvTBDZ8o1Y+fQs4aJ6W ZCS29MiXtTh0wUJ/Tv02/CFVosBSgUrK+F7+ZnAKwSe7AkfIO/vOU2kdCB63L5zL 3gWVzyP7ZARdA66IqVqUCvcrhTJ9Sl9ia4wXFexJArHJQfbyvvXl7JqfWm6Sjy8R 8lAJQ7Z588JVgyniasQzDkVrMuuQJBlnIpoivwsy+lFZfbKHIksrDW4Hdqf6ejUx Ugn8a+5Z5bbb5R0RPkRURQ3NE5ZK1Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=vnq0VwOwh6sNu+A1gAn3C64WWW0jMJE3VpahkQbI0 bo=; b=r/5C+GihpWluydcZCcBSE72e5v6/nWc6/OZViv8OJdmJKs/I2cxMKswRl 81y9zPb3/ndqD+a2DGYJw7YwSRseq0wVSCBk9F1i//I/v+58k6qh8n7ESOImHGaC 7amc/K7Dm6bI/JgtVgAVCASaAcncCol6Hy2sW/RjJLy7G7PH9HAevpmu56Evk9gK 4jnNYa7tZoNv934S7iREEdW6Xl76SfSG0CZWemfEmzHEedlWdT0KaWWlfaX8Mfm0 rCzR4K+f6tg7ubhD4Jxeo1X8D17SAUk9+muXG2ox3Qo3Eeksfsjo+5LcV9VR40sC 0Oqv8Fe2/4J11uLRm2EFrVON9YIyA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrudeffedgjeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvuffkfhggtggugfgjfgesth ektddttderjeenucfhrhhomhepffgrnhhivghlucfuhhgrhhgrfhcuoegurdhssegurghn ihgvlhdrshhhrghhrghfrdhnrghmvgeqnecukfhppeejledrudektddrheejrdduudelne curfgrrhgrmhepmhgrihhlfhhrohhmpegurdhssegurghnihgvlhdrshhhrghhrghfrdhn rghmvgenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Date: Thu, 14 Nov 2019 15:40:13 +0000 From: Daniel Shahaf To: Perry Smith Cc: Danh Doan , zsh-users Subject: Re: Change interactive command into a comment Message-ID: <20191114154013.z2x5ot3sndadepbh@tarpaulin.shahaf.local2> References: <20191114044120.GA7796@danh.dev> <91E3129F-1C3C-46FD-BAD9-3FF5F073455D@easesoftware.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <91E3129F-1C3C-46FD-BAD9-3FF5F073455D@easesoftware.com> User-Agent: NeoMutt/20170113 (1.7.2) Perry Smith wrote on Thu, Nov 14, 2019 at 07:19:01 -0600: > > > > On Nov 13, 2019, at 10:41 PM, Danh Doan wrote: > > > > On 2019-11-13 12:34:35 -0600, Perry Smith wrote: > >> With bash, I got into the following habit. If I started typing > >> a long command and then decided I didn’t want to execute it right > >> now for some reason, I would hit control-A to get back to the start > >> of the line and then add a # in front and hit return. > >> > >> This would put the command into history and so later I could recall > >> it, remove the #, and execute the command. > > > > Not an answer for your question, but this piece of code from grml zsh > > config may interest you: > > > > -------8<----------------------- > > > > # add a command line to the shells history without executing it > > commit-to-history () { > > print -s ${(z)BUFFER} > > zle send-break > > } > > zle -N commit-to-history > > bindkey -M viins "^x^h" commit-to-history > > bindkey -M emacs "^x^h" commit-to-history > > > > -------8<------------------------ > > > > With this piece of code in your zshrc, you could press C-x C-h to > > commit your current command to history without executing it. > > Cool! Thanks. Shouldn't it be «print -rs -- ${(z)BUFFER}»?