Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: zpty: register pty fd as FDT_MODULE so it isn't closed when forking



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





Messages sorted by: Reverse Date, Date, Thread, Author