diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2023-08-24 23:10:10 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2023-08-24 23:10:10 -0700 |
commit | b8bc0295ba6bb9dfddb8c1ccbe530ecedf8188a4 (patch) | |
tree | 72b7d8d5135fdf9180d016a568609b5c542f649c | |
parent | 1bc984704ce4452ff85e68cfa2223a932fa67f4f (diff) | |
download | basta-b8bc0295ba6bb9dfddb8c1ccbe530ecedf8188a4.tar.gz basta-b8bc0295ba6bb9dfddb8c1ccbe530ecedf8188a4.tar.bz2 basta-b8bc0295ba6bb9dfddb8c1ccbe530ecedf8188a4.zip |
Improve TTY handling in basta.check_cursor.
- We don't save and restore the TTY settings. They might not
be good anyway. We go for "stty sane".
- Add -echo to raw mode. I'm seeing a glitch whereby if I hold
down the Enter key, sometimes I see ^M being echoed; this
makes it go away.
-rw-r--r-- | basta.sh | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -70,8 +70,7 @@ basta.update_status() basta.check_cursor() { - local saved_tty=$(stty -g) - stty raw + stty raw -echo if ! read -t 0; then local exit=$? @@ -83,7 +82,7 @@ basta.check_cursor() fi fi - stty "$saved_tty" + stty sane } basta.do_exit_status() |