zsh-users
 help / color / mirror / code / Atom feed
* Re: Bug in zsh-4.2.0-4?
       [not found] <20040420012700.GA4401@bach.cs.colorado.edu>
@ 2004-04-20 14:07 ` Clint Adams
  0 siblings, 0 replies; only message in thread
From: Clint Adams @ 2004-04-20 14:07 UTC (permalink / raw)
  To: Ben Pearre; +Cc: zsh-users

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!


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-04-20 14:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20040420012700.GA4401@bach.cs.colorado.edu>
2004-04-20 14:07 ` Bug in zsh-4.2.0-4? Clint Adams

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).