bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

stty not restored in trap when executing read with options


From: Quentin L'Hours
Subject: stty not restored in trap when executing read with options
Date: Sun, 16 Jul 2017 15:59:19 -0700
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.2.1

Hello,

bash: 4.4.12(1)-release
stty: 8.25 (GNU version)

When running this small script:

> trap 'stty echo; exit 0' INT
> stty -echo
> read -d a

and hitting Ctrl-c

stty should be restored in the trap, but doesn't (the trap code is executed though).
This also seems to happen with read -s and -n options.

Calling read without options restores stty as expected.

ksh (93u+) and zsh (5.2) also restores stty as expected.

Finally tested this on bash 3.2.57(1)-release and it's working as expected, stty is restored in the trap.

--
Quentin L'Hours



reply via email to

[Prev in Thread] Current Thread [Next in Thread]