Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bug in zsh-4.2.0-4?
- X-seq: zsh-users 7374
- From: Clint Adams <schizo@xxxxxxxxxx>
- To: Ben Pearre <bwpearre@xxxxxxxxxxxxxxxxxxxx>
- Subject: Re: Bug in zsh-4.2.0-4?
- Date: Tue, 20 Apr 2004 10:07:02 -0400
- Cc: zsh-users@xxxxxxxxxx
- In-reply-to: <20040420012700.GA4401@xxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20040420012700.GA4401@xxxxxxxxxxxxxxxxxxxx>
Are there any jobs at all in your job table when you experience this
problem?
On Mon, Apr 19, 2004 at 07:27:00PM -0600, Ben Pearre wrote:
> Hi... I'm running the latest debian unstable, including zsh 4.2.0-4.
> An instance of zsh will work fine for a while, and then start doing
> this on every command:
>
> (0)# cd
> preexec:1: job table full
> precmd:1: job table full
>
> The command runs, but the preexec and precmd scripts don't. Here is
> what they are defined to (just FYI; simpler examples follow):
You can avoid the problem by not using command substitutions at all.
> SHOST=`echo $HOST | cut -d. -f1`
> PS1='%B(%?)%#%b '
> precmd () {
> EPWD=`pwd | sed 's/\/home\/ben/~/g'`
> echo -ne "\033]0;${SHOST} ${EPWD}\007"
> }
> preexec () {
> EPWD=`pwd | sed 's/\/home\/ben/~/g'`
> echo -ne "\033]0;$1 (${SHOST} ${EPWD})\007"
> }
Try
PS1='%B(%?)%#%b '
precmd () {
print -nP "\033]0;${HOST%%.*} %~\007"
}
preexec () {
print -nP "\033]0;$1 (${HOST%%.*} %~)\007"
}
If you actually want the behavior of changing /home/ben to ~, rather
than what %~ does, you can change the occurrences of %~ above to
${PWD/\/home\/ben/\~}
Either way, that's going to be more efficient than actually running pwd
and sed and cut.
> Once the problem starts, I can redefine, say, precmd to something that
> does not include a variable assignment:
>
> precmd () {
> pwd | sed 's/\/home\/ben/~/g'
> }
>
> The error goes away. But as soon as I assign the output of a command
> to a shell variable
>
> precmd () {
> A=`pwd`
> }
>
> the problem comes back immediately.
>
> If I can be useful in debugging this, please tell me what to do!
Messages sorted by:
Reverse Date,
Date,
Thread,
Author