diff options
author | Bram Moolenaar <Bram@vim.org> | 2005-11-23 21:25:05 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2005-11-23 21:25:05 +0000 |
commit | a5792f58905da28f0ab37e1c4c3cfd8171b2e602 (patch) | |
tree | 258ddcfde89bbf98b90d42dd6c297e1b22a20d09 /src/os_unix.c | |
parent | af289d333a2985051948a53d510fa345df1ddeb3 (diff) | |
download | vim-git-a5792f58905da28f0ab37e1c4c3cfd8171b2e602.tar.gz |
updated for version 7.0158v7.0158
Diffstat (limited to 'src/os_unix.c')
-rw-r--r-- | src/os_unix.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/src/os_unix.c b/src/os_unix.c index 491d41a2e..f951f1846 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -3709,6 +3709,11 @@ mch_call_shell(cmd, options) putenv(envbuf_Columns); # endif + /* + * stderr is only redirected when using the GUI, so that a + * program like gpg can still access the terminal to get a + * passphrase using stderr. + */ # ifdef FEAT_GUI if (pty_master_fd >= 0) { @@ -3719,8 +3724,11 @@ mch_call_shell(cmd, options) dup(pty_slave_fd); close(1); dup(pty_slave_fd); - close(2); - dup(pty_slave_fd); + if (gui.in_use) + { + close(2); + dup(pty_slave_fd); + } close(pty_slave_fd); /* has been dupped, close it now */ } @@ -3739,9 +3747,14 @@ mch_call_shell(cmd, options) dup(fd_fromshell[1]); close(fd_fromshell[1]); - /* set up stderr for the child */ - close(2); - dup(1); +# ifdef FEAT_GUI + if (gui.in_use) + { + /* set up stderr for the child */ + close(2); + dup(1); + } +# endif } } |