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

Re: zsh 3.0.0 - ^D does not exit shell



On Aug 26, 12:53am, Sven Guckes wrote:
} Subject: zsh 3.0.0 - ^D does not exit shell
}
} I noticed that the zsh does not exit when I press ^D.
} 
} It does not happen always, eg right after starting the zsh it does work.
} I could not find a situation where it will always happen.

The most likely cause is that you are running another program, such as a
text editor, which intends to temporarily reset the TTY characterstics
and accidentally clobbers the EOF character in the process.

This is an extremely easy mistake for programmers to make, because the
termio and termios implementations on many systems overload an array
in the terminal-driver structure such that the EOF character position
doubles as the is-input-timeout-active boolean; so EOF frequently ends
up being set to 1 (control-A) or 0 (control-space or control-@).  Zsh
itself had this bug at one time (but hasn't since 2.4.something).

The workaround is to use the zsh `ttyctl -f' builtin to cause zsh to
forcibly reset your terminal driver whenever it prompts for input.
This prevents such external programs from permanently messing up your
tty settings.

-- 
Bart Schaefer                             Brass Lantern Enterprises
http://www.well.com/user/barts            http://www.nbn.com/people/lantern

New male in /home/schaefer:
>N  2 Justin William Schaefer  Sat May 11 03:43  53/4040  "Happy Birthday"



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