Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: zsh hangs (3.0.6-pre-2, 3.1.5-pws-16)



On Apr 29,  2:28pm, Tatsuo Furukawa wrote:
} Subject: zsh hangs (3.0.6-pre-2, 3.1.5-pws-16)
}
} 1. Write following in .zshrc
} 
} RPROMPT="(%l)"
} 
} function TRAPWINCH() {
}         eval $(resize)
}         echo;
}         echo "resized";
}         echo
} } 
} 
} 4. Change terminal size using mouse.
} 
}     Then "resized" message is displayed, and RPROMPT is displayed into
}     'right' place.  (But why is "resized" message displayed twice?)

The message is displayed twice because the "resize" command itself causes
a SIGWINCH to be sent.  So you get one when xterm finishes remapping, and
another when resize runs.  I'm not entirely sure why this doesn't cause
an infinite loop; perhaps resize only sends a SIGWINCH when the values it
reads back from the terminal do not match what's in the environment.

The hang appears to be a race condition in exec.c: getoutput().  Zsh is
blocked forever in sigsuspend() waiting for the SIGCHLD that will tell
it `resize` has exited.  Probably that signal arrived while zsh was
handling the SIGWINCH sent by "resize" and zsh either improperly handled
it then or dropped it on the floor.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



Messages sorted by: Reverse Date, Date, Thread, Author