PATCH: zpty: register pty fd as FDT_MODULE so it isn't closed when forking
Mikael Magnusson <[email protected]> Thu, 11 Jun 2026 06:35:55 +0200
| Newsgroups | gmane.comp.shells.zsh.devel |
|---|---|
| Message-ID | <[email protected]> |
This lets us remove these mysterious braces too.
---
Src/Modules/zpty.c | 3 +--
Test/W02jobs.ztst | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/Src/Modules/zpty.c b/Src/Modules/zpty.c
index 5f3a8f24e2..6e201e76bb 100644
--- a/Src/Modules/zpty.c
+++ b/Src/Modules/zpty.c
@@ -447,9 +447,8 @@ newptycmd(char *nam, char *pname, char **args, int echo, int nblock)
return 1;
}
}
-#else
- addmodulefd(master, FDT_INTERNAL);
#endif
+ addmodulefd(master, FDT_MODULE);
p = (Ptycmd) zalloc(sizeof(*p));
diff --git a/Test/W02jobs.ztst b/Test/W02jobs.ztst
index f8011810c9..050de213a1 100644
--- a/Test/W02jobs.ztst
+++ b/Test/W02jobs.ztst
@@ -23,8 +23,7 @@
zpty_stop() {
# exit twice in case of check_jobs
zpty -w zsh $'exit\nexit\n'
- # zpty gives no output when piped without these braces (?)
- { zpty -r zsh } | sed $'/[^[:space:]]/!d; s/\r$//;'
+ zpty -r zsh | sed $'/[^[:space:]]/!d; s/\r$//;'
zpty -d
:
}
--
2.38.1