summaryrefslogtreecommitdiffstats
path: root/src/os_win32.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 07:39:41 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 07:39:41 +0000
commit00c068502d170f9f9b59c4a68aa12e8835859f6c (patch)
tree2047fc01b8c70326d9b87b47a575e7e5f2141b62 /src/os_win32.c
parentAdding upstream version 2:9.1.0016. (diff)
downloadvim-00c068502d170f9f9b59c4a68aa12e8835859f6c.tar.xz
vim-00c068502d170f9f9b59c4a68aa12e8835859f6c.zip
Adding upstream version 2:9.1.0199.upstream/2%9.1.0199
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/os_win32.c')
-rw-r--r--src/os_win32.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/os_win32.c b/src/os_win32.c
index dbfc4ee..9947150 100644
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -5155,8 +5155,7 @@ mch_system_piped(char *cmd, int options)
)
{
len = 0;
- if (!(options & SHELL_EXPAND)
- && ((options &
+ if (((options &
(SHELL_READ|SHELL_WRITE|SHELL_COOKED))
!= (SHELL_READ|SHELL_WRITE|SHELL_COOKED)
# ifdef FEAT_GUI
@@ -5176,7 +5175,7 @@ mch_system_piped(char *cmd, int options)
{
/*
* For pipes: Check for CTRL-C: send interrupt signal to
- * child. Check for CTRL-D: EOF, close pipe to child.
+ * child.
*/
if (len == 1 && cmd != NULL)
{
@@ -5186,10 +5185,22 @@ mch_system_piped(char *cmd, int options)
// now put 9 as SIGKILL
TerminateProcess(pi.hProcess, 9);
}
- if (ta_buf[ta_len] == Ctrl_D)
+ }
+
+ /*
+ * Check for CTRL-D: EOF, close pipe to child.
+ * Ctrl_D may be decorated by _OnChar()
+ */
+ if ((len == 1 || len == 4 ) && cmd != NULL)
+ {
+ if (ta_buf[0] == Ctrl_D
+ || (ta_buf[0] == CSI
+ && ta_buf[1] == KS_MODIFIER
+ && ta_buf[3] == Ctrl_D))
{
CloseHandle(g_hChildStd_IN_Wr);
g_hChildStd_IN_Wr = NULL;
+ len = 0;
}
}