Open xterm
, run tty
and see pseudo terminal slave file (let's say it is /dev/pts/0
).
Then open another xterm
and run
$ stty -F /dev/pts/0
speed 38400 baud; line = 0;
lnext = <undef>; discard = <undef>; min = 1; time = 0;
-brkint -icrnl -imaxbel iutf8
-icanon -echo
Then run /bin/sleep 1000
in first xterm. Then run the same stty
command in second xterm again:
$ stty -F /dev/pts/0
speed 38400 baud; line = 0;
-brkint -imaxbel iutf8
Then terminate sleep
command in first xterm. Then run the same stty
command in second xterm again:
$ stty -F /dev/pts/0
speed 38400 baud; line = 0;
lnext = <undef>; discard = <undef>; min = 1; time = 0;
-brkint -icrnl -imaxbel iutf8
-icanon -echo
We see that bash changes tty attributes before running a command and restores them back after running a command. Where is it described in bash documentation? Are all tty attributes restored, or some attributes may not be restored if they are changed by program?