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,FREEMAIL_FROM,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 3967ad08 for ; Thu, 14 Nov 2019 15:57:02 +0000 (UTC) Received: (qmail 5221 invoked by alias); 14 Nov 2019 15:56:56 -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: 24436 Received: (qmail 21816 invoked by uid 1010); 14 Nov 2019 15:56:56 -0000 X-Qmail-Scanner-Diagnostics: from mail-pl1-f171.google.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(209.85.214.171):SA:0(-2.0/5.0):. Processed in 3.146193 secs); 14 Nov 2019 15:56:56 -0000 X-Envelope-From: congdanhqx@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.214.171 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=sv8QzjjEaW33ZZa8tdfuM6FnHCZIJ2qktlbfTXiKUng=; b=YV8mcjwPejbERM3nh44WbMqZIYw9LpMvE3WToCJ0DjXwcKgk4/k1IUo2LWOPCZc5+Q Xk7wDKnsx2ShUeVdCVPH9FJCHaqHlslExgrZM32K68HH5mLBkUmqr4c8ENUlbAjVC4SU q6Pb0z9j2X1KZ2m2ICcJxhgyQq4GnUtueudREA1T/RBlGBkeFJQgwut93may2nahgjCO zjhvU52fpBDP0vMJTci9/65Mrs6Gcat1zmkODxafKyNl009FmoURVsLz54GxESHStQr8 Gsx++6tYnuMuBvfIJZV1KWdGvzyWTJYWE7KCw9jdKt6la8uJfzr2LgERoL+NLt9Fe6j9 U3OQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=sv8QzjjEaW33ZZa8tdfuM6FnHCZIJ2qktlbfTXiKUng=; b=XXV5gfGsJ9ZVxdRVGDg8LJQOyu0jSww9/SpC/FfwEltKCi7ptjI+fZjyoPTqMHRxMh xYHRymHW/X9RqWQWyLJ3dbQ9HqKfwOe9e27qzl4mE61g5EeDmddd9oEWQgPnHtE0ecev vSJAp29QxPR5GwXEksdDkDKfRj9WG/qQpUY4s2HCy7F22ftNeeDSgMBiRPFX/Bf1tbav MZdfy1I8HSu2OjB9CO3OXrvu97odX1Q2m9OTkr+PyLe6A5FFOGTEnq1OXpQyNIKQAK0+ 8DNhnAOy3cXX0hEPcNGDNbb+D/pZkkIQBZ5Pq5h0B3iA3HeNGedArQlmfPec5jJrtw/T iW2A== X-Gm-Message-State: APjAAAXLmRX/3sMoYQM2Jec5TwUhsoNz1YUNAxl40xvGGtDXJd1pOXJ8 zGJ1VEpFUMSjfVvefAQ3KXOWjQhD X-Google-Smtp-Source: APXvYqzZMzmExP1wMW43lQ5xKaN06bYKPA34JGxZZWkrg7Xqns4k5m6Ng0zHvxwkRYC+xZdlUVdKzQ== X-Received: by 2002:a17:902:a70b:: with SMTP id w11mr8680212plq.27.1573746979769; Thu, 14 Nov 2019 07:56:19 -0800 (PST) Date: Thu, 14 Nov 2019 22:56:17 +0700 From: Danh Doan To: Daniel Shahaf Cc: Perry Smith , zsh-users Subject: Re: Change interactive command into a comment Message-ID: <20191114155617.GA20228@danh.dev> References: <20191114044120.GA7796@danh.dev> <91E3129F-1C3C-46FD-BAD9-3FF5F073455D@easesoftware.com> <20191114154013.z2x5ot3sndadepbh@tarpaulin.shahaf.local2> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20191114154013.z2x5ot3sndadepbh@tarpaulin.shahaf.local2> User-Agent: Mutt/1.12.2 (2019-09-21) On 2019-11-14 15:40:13+0000, Daniel Shahaf wrote: -------8<----------------------- # add a command line to the shells history without executing it commit-to-history () { print -rs ${(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. > > Shouldn't it be «print -rs -- ${(z)BUFFER}»? Yes, that's right, without `-r', escaped character will be evaluated. Thanks. -- Danh