summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorStephane Chazelas <stephane.chazelas@gmail.com>2017-06-13 21:34:55 -0400
committerEric Cook <illua@users.sourceforge.net>2017-06-13 21:34:55 -0400
commit4d007e269d1892e45e44ff92b6b9a1a205ff64d5 (patch)
tree87b4b3c6acaac28cf75d57187c303ea10a0688f0 /Src
parenteb783754bdb74377f3cea4ceca9c23a02ea1bf58 (diff)
downloadzsh-4d007e269d1892e45e44ff92b6b9a1a205ff64d5.tar.gz
zsh-4d007e269d1892e45e44ff92b6b9a1a205ff64d5.tar.xz
zsh-4d007e269d1892e45e44ff92b6b9a1a205ff64d5.zip
41275: Leave stdin open when executing widgets
Diffstat (limited to 'Src')
-rw-r--r--Src/Zle/zle_main.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c
index 6c271b5d0..be2b062b0 100644
--- a/Src/Zle/zle_main.c
+++ b/Src/Zle/zle_main.c
@@ -1485,6 +1485,13 @@ execzlefunc(Thingy func, char **args, int set_bindk)
 	    int inuse = w->flags & WIDGET_INUSE;
 	    w->flags |= WIDGET_INUSE;
 
+	    if (osi > 0) {
+		/*
+		 * Many commands don't like having a closed stdin, open on
+		 * /dev/null instead
+		 */
+		open("/dev/null", O_RDWR | O_NOCTTY); /* ignore failure */
+	    }
 	    if (*args) {
 		largs = newlinklist();
 		addlinknode(largs, dupstring(w->u.fnnam));