zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Bug with ZLE special variables and traps?
Date: Mon, 22 Mar 2010 07:57:03 -0700	[thread overview]
Message-ID: <100322075703.ZM21762@torch.brasslantern.com> (raw)
In-Reply-To: <20100322084226.GA26739@fermat.math.technion.ac.il>

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> echo<INTERRUPT>prebuffer: '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% 


       reply	other threads:[~2010-03-22 14:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <c16a574a0809181450t61a5b5ddq2e80797fde37636e@mail.gmail.com>
     [not found] ` <20080919162045.GA22435@ruderich.org>
     [not found]   ` <20090706151644.6BF508027106@bifrost.dotsrc.org>
     [not found]     ` <20090706154309.GA15663@fermat.math.technion.ac.il>
     [not found]       ` <20090706155337.GB15663@fermat.math.technion.ac.il>
     [not found]         ` <20100315164237.GA23224@fermat.math.technion.ac.il>
     [not found]           ` <100320105027.ZM20067@torch.brasslantern.com>
     [not found]             ` <20100322084226.GA26739@fermat.math.technion.ac.il>
2010-03-22 14:57               ` Bart Schaefer [this message]
2010-03-22 16:07                 ` Peter Stephenson
2010-03-22 23:12                   ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=100322075703.ZM21762@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).