From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4224 invoked by alias); 22 Mar 2015 23:22:55 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 34760 Received: (qmail 28357 invoked from network); 22 Mar 2015 23:22:42 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version:content-type; bh=jLkYFEEdqsXj8iXY/kRq1hnQtcMwrdZlCbWskbRI6Qg=; b=eHJu7vmQcvS0cqaVey7gUwR6SXs7wnAJS7wyjH7KVbvqfJebuVLWcEJuu4Lj5/BpTH 1gYXgQXp77fwvxh4q9Qdk4RHtNKX19huafM4HDTjB5k0Vh5VOuVAlaG2LYVBRHoSYhJ/ 4dZBZ5QXSzCnUuwWNhEIB8+KE9C/I4SNuj10UtfTu6wQb0pKXShKRQjxaYLp9KuXhwTY RkDDVrzZUTi0GfGGzuNI1Uj98NSXZImPu9IkP4RZtzcRfR22qKx8CsKTDrZ9n+dR8A4M ZYyg6nIUe/YBd1ulkH5G/+W9MMK98x2MVMJpf3R/O3VzfhIUfFEa7gRRHxsHk8mVNHMS voNQ== X-Gm-Message-State: ALoCoQlpYZkpfVJ0WUXbGdTJp6BtRDlvSU7/b4gw8ts+ml4f3dmn16yHm06fuhm7gtvXMqrQwB87 X-Received: by 10.202.45.214 with SMTP id t205mr37758796oit.100.1427066558922; Sun, 22 Mar 2015 16:22:38 -0700 (PDT) From: Bart Schaefer Message-Id: <150322162235.ZM1728@torch.brasslantern.com> Date: Sun, 22 Mar 2015 16:22:35 -0700 In-Reply-To: <20150322183556.1fa0f143@ntlworld.com> Comments: In reply to Peter Stephenson "Re: capturing output of !! not working" (Mar 22, 6:35pm) References: <20150319105716.620cd931@pwslap01u.europe.root.pri> <20150319125351.1e270c2d@pwslap01u.europe.root.pri> <20150320105703.2754b6af@pwslap01u.europe.root.pri> <150320090420.ZM21908@torch.brasslantern.com> <20150322183556.1fa0f143@ntlworld.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: "Zsh Hackers' List" Subject: Re: capturing output of !! not working MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Mar 22, 6:35pm, Peter Stephenson wrote: } } As I've noted in the comment, to get this stuff to work cleanly we need } to capture character-by-character input at a level over the history, but } we don't have one and there are probably too many levels anyway. So } this will have to do --- it's at least fairly obvious what's going on. OK, now we just need to do something similar for this: torch% alias '{'=echo torch% {bar zsh: command not found: echobar torch% fc -l 1 alias '{'=echo 2 {echobar That must be the same problem as the "!!echo" in my $( !! ) example, no? Here's a test, which I have dropped in the previously-unused "W" category for "builtin interactive commands and constructs". If that doesn't seem correct, rename to D10history. diff --git a/Test/W01history.ztst b/Test/W01history.ztst new file mode 100644 index 0000000..2bdcc32 --- /dev/null +++ b/Test/W01history.ztst @@ -0,0 +1,15 @@ +# Tests for BANG_HIST replacements + +%test + + $ZTST_testdir/../Src/zsh -fis <<<' + echo foo bar + echo $(!!) again + echo more $( !! )' +0:Regression test for history references in command substitution +>foo bar +>foo bar again +>more foo bar again +*?* +F:Check that a history bug introduced by workers/34160 is working again. +F:Discarded line of error output consumes prompts printed by "zsh -i". -- Barton E. Schaefer