Bug 269292 - shells/zsh fails to reset tty state on TMOUT
Summary: shells/zsh fails to reset tty state on TMOUT
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Baptiste Daroussin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-02 19:08 UTC by J.R. Oldroyd
Modified: 2023-02-02 19:08 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (bapt)


Attachments
patch to make zsh reset tty modes on TMOUT (288 bytes, patch)
2023-02-02 19:08 UTC, J.R. Oldroyd
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description J.R. Oldroyd 2023-02-02 19:08:06 UTC
Created attachment 239865 [details]
patch to make zsh reset tty modes on TMOUT

shells/zsh fails to reset the tty state if it exits due to TMOUT expiration.

Repeat by:
$ zsh
$ stty -a
speed 9600 baud; 60 rows; 119 columns;
lflags: icanon isig iexten echo echoe -echok echoke -echonl echoctl
	-echoprt -altwerase -noflsh -tostop -flusho -pendin -nokerninfo
	-extproc
iflags: -istrip icrnl -inlcr -igncr ixon -ixoff ixany imaxbel -ignbrk
	brkint -inpck -ignpar -parmrk
oflags: opost onlcr -ocrnl tab0 -onocr -onlret
cflags: cread cs8 -parenb -parodd hupcl -clocal -cstopb -crtscts -dsrflow
	-dtrflow -mdmbuf rtsdtr
cchars: discard = ^O; dsusp = ^Y; eof = ^D; eol = <undef>;
	eol2 = <undef>; erase = ^?; erase2 = ^H; intr = ^C; kill = ^U;
	lnext = ^V; min = 1; quit = ^\; reprint = ^R; start = ^Q;
	status = ^T; stop = ^S; susp = ^Z; time = 0; werase = ^W;
$ TMOUT=2
$
.. wait for timeout..
zsh: timeout
$ stty -a
speed 9600 baud; 60 rows; 119 columns;
lflags: icanon isig iexten echo echoe -echok echoke -echonl echoctl
	-echoprt -altwerase -noflsh -tostop -flusho -pendin -nokerninfo
	-extproc
iflags: -istrip icrnl inlcr -igncr ixon -ixoff ixany imaxbel -ignbrk
	brkint -inpck -ignpar -parmrk
oflags: opost onlcr -ocrnl tab0 -onocr -onlret
cflags: cread cs8 -parenb -parodd hupcl -clocal -cstopb -crtscts -dsrflow
	-dtrflow -mdmbuf rtsdtr
cchars: discard = <undef>; dsusp = <undef>; eof = ^D; eol = <undef>;
	eol2 = <undef>; erase = ^?; erase2 = ^H; intr = ^C; kill = ^U;
	lnext = <undef>; min = 1; quit = <undef>; reprint = ^R;
	start = ^Q; status = ^T; stop = ^S; susp = <undef>; time = 0;
	werase = ^W;

Observe that lots of chars are now <undef> and iflag inlcr is now set when it wasn't before.

I am attaching a simple patch to fix this.

This should probably be sent upstream too.