summaryrefslogtreecommitdiff
path: root/Src/Zle/zle_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/Zle/zle_main.c')
-rw-r--r--Src/Zle/zle_main.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c
index 15ea79643..be2b062b0 100644
--- a/Src/Zle/zle_main.c
+++ b/Src/Zle/zle_main.c
@@ -1245,6 +1245,7 @@ zleread(char **lp, char **rp, int flags, int context, char *init, char *finish)
resetneeded = 0;
fetchttyinfo = 0;
trashedzle = 0;
+ clearflag = 0;
raw_lp = lp;
lpromptbuf = promptexpand(lp ? *lp : NULL, 1, NULL, NULL, &pmpt_attr);
raw_rp = rp;
@@ -1484,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));