summaryrefslogtreecommitdiff
path: root/Src/utils.c
diff options
context:
space:
mode:
authorBart Schaefer <schaefer@zsh.org>2024-01-24 17:27:41 -0800
committerBart Schaefer <schaefer@zsh.org>2024-01-24 17:27:41 -0800
commit3406089647393c7593e37ee0661a179a9d848c49 (patch)
tree8f151231ff1f1df650209de167065b14598ea513 /Src/utils.c
parentdde12593db1d1ed83e985c8ca5e82fee2ad400be (diff)
downloadzsh-3406089647393c7593e37ee0661a179a9d848c49.tar.gz
zsh-3406089647393c7593e37ee0661a179a9d848c49.zip
52468: save and restore state of correct TTY when using read -s / -d
Diffstat (limited to 'Src/utils.c')
-rw-r--r--Src/utils.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/Src/utils.c b/Src/utils.c
index 0f66984cd..1a4f4c14b 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -1731,6 +1731,13 @@ freestr(void *a)
mod_export void
gettyinfo(struct ttyinfo *ti)
{
+ fdgettyinfo(SHTTY, ti);
+}
+
+/**/
+mod_export void
+fdgettyinfo(int SHTTY, struct ttyinfo *ti)
+{
if (SHTTY != -1) {
#ifdef HAVE_TERMIOS_H
# ifdef HAVE_TCGETATTR
@@ -1756,6 +1763,13 @@ gettyinfo(struct ttyinfo *ti)
mod_export void
settyinfo(struct ttyinfo *ti)
{
+ fdsettyinfo(SHTTY, ti);
+}
+
+/**/
+mod_export void
+fdsettyinfo(int SHTTY, struct ttyinfo *ti)
+{
if (SHTTY != -1) {
#ifdef HAVE_TERMIOS_H
# ifdef HAVE_TCGETATTR