From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2402 invoked by alias); 22 Mar 2010 14:57:33 -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: 27821 Received: (qmail 6640 invoked from network); 22 Mar 2010 14:57:23 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <100322075703.ZM21762@torch.brasslantern.com> Date: Mon, 22 Mar 2010 07:57:03 -0700 In-reply-to: <20100322084226.GA26739@fermat.math.technion.ac.il> Comments: In reply to "Nadav Har'El" "Re: Append cancelled commands to history" (Mar 22, 10:42am) References: <20080919162045.GA22435@ruderich.org> <20090706151644.6BF508027106@bifrost.dotsrc.org> <20090706154309.GA15663@fermat.math.technion.ac.il> <20090706155337.GB15663@fermat.math.technion.ac.il> <20100315164237.GA23224@fermat.math.technion.ac.il> <100320105027.ZM20067@torch.brasslantern.com> <20100322084226.GA26739@fermat.math.technion.ac.il> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Bug with ZLE special variables and traps? MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Hey, zsh-workers: Is this a recently-introduced bug? Why is PREBUFFER empty in a signal handler at patchlevel 1.4940 when it is not at 1.4705? On Mar 22, 10:42am, Nadav Har'El wrote: } Subject: Re: Append cancelled commands to history } } On Sat, Mar 20, 2010, Bart Schaefer wrote about "Re: Append cancelled commands to history": } > } > Hmm. When I use TRAPINT, $PREBUFFER is always empty. } > } > torch% print $ZSH_VERSION $ZSH_PATCHLEVEL } > 4.3.10-dev-1 1.4940 } } Thanks for the explanations. For me, $PREBUFFER does work: } } $ print $ZSH_VERSION $ZSH_PATCHLEVEL } 4.3.10 1.4705 } $ cat /etc/redhat-release; rpm -qf =zsh } Fedora release 12 (Constantine) } zsh-4.3.10-4.fc12.x86_64 } } $ functions TRAPINT } TRAPINT () { } zle && [[ $HISTNO -eq $HISTCMD ]] && print -s -r -- "$PREBUFFER$BUFFER" } echo "prebuffer: '$PREBUFFER'" } return $1 } } } } $ for i in * } for> do } for> echoprebuffer: 'for i in * } do } ' } } $ torch% echo $ZSH_VERSION $ZSH_PATCHLEVEL 4.3.10-dev-1 1.4940 torch% TRAPINT () { function> zle && [[ $HISTNO -eq $HISTCMD ]] && print -s -r -- "$PREBUFFER$BUFFER" function> echo "prebuffer: '$PREBUFFER'" function> return $1 function> } torch% for i in * for> do for> echoprebuffer: '' torch%