From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10337 invoked by alias); 23 Mar 2015 21:40:17 -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: 34766 Received: (qmail 22384 invoked from network); 23 Mar 2015 21:40:05 -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=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-Originating-IP: [80.3.228.158] X-Spam: 0 X-Authority: v=2.1 cv=AoZg3YNP c=1 sm=1 tr=0 a=P+FLVI8RzFchTbbqTxIDRw==:117 a=P+FLVI8RzFchTbbqTxIDRw==:17 a=kj9zAlcOel0A:10 a=NLZqzBF-AAAA:8 a=q2GGsy2AAAAA:8 a=oZo-CEAlRShI459_QboA:9 a=CjuIK1q_8ugA:10 Date: Mon, 23 Mar 2015 21:34:26 +0000 From: Peter Stephenson To: "Zsh Hackers' List" Subject: Re: capturing output of !! not working Message-ID: <20150323213426.21fd79c8@ntlworld.com> In-Reply-To: <150322162235.ZM1728@torch.brasslantern.com> 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> <150322162235.ZM1728@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Sun, 22 Mar 2015 16:22:35 -0700 Bart Schaefer wrote: > 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 What appears to be happening here is that because there's no end of word character after the expanded "{" we run straight onto the "bar" and only call ihwend() via hwend() after that. As alias expansion is tied to word-handling, we only then look at the test that resets the position in the history line, which is too late. I'm not sure how to fix this. Ideally, I think we'd handle not adding the alias text to history the way we've been doing in other cases by checking INP_* flags, which is much less hit and miss. That ought not to be too difficult, but I haven't really got my mind round the consequences yet. Everything else I can think of is a bit of a hack (and surely we'd never etc. etc.) > 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. Looks fine. I'll try to expand it when it appears. pws