Mercurial > vim
comparison src/os_win32.c @ 16984:d4ecdb8a4c58 v8.1.1492
patch 8.1.1492: MS-Windows: when "!" is in 'guioptions' ":!start" fails
commit https://github.com/vim/vim/commit/7c348bb5ad106cfa35dd45560c5ac5d3c8496c96
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jun 8 12:05:22 2019 +0200
patch 8.1.1492: MS-Windows: when "!" is in 'guioptions' ":!start" fails
Problem: MS-Windows: when "!" is in 'guioptions' ":!start" fails.
Solution: Do not use a terminal window when the shell command begins with
"!start". (Yasuhiro Matsumoto, closes #4504)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 08 Jun 2019 12:15:08 +0200 |
parents | ce04ebdf26b8 |
children | 372f2eaa544a |
comparison
equal
deleted
inserted
replaced
16983:03d245d277fe | 16984:d4ecdb8a4c58 |
---|---|
4638 fprintf(fdDump, "mch_call_shell(\"%s\", %d)\n", cmd, options); | 4638 fprintf(fdDump, "mch_call_shell(\"%s\", %d)\n", cmd, options); |
4639 fflush(fdDump); | 4639 fflush(fdDump); |
4640 } | 4640 } |
4641 #endif | 4641 #endif |
4642 #if defined(FEAT_GUI) && defined(FEAT_TERMINAL) | 4642 #if defined(FEAT_GUI) && defined(FEAT_TERMINAL) |
4643 /* TODO: make the terminal window work with input or output redirected. */ | 4643 // TODO: make the terminal window work with input or output redirected. |
4644 if ( | 4644 if ( |
4645 # ifdef VIMDLL | 4645 # ifdef VIMDLL |
4646 gui.in_use && | 4646 gui.in_use && |
4647 # endif | 4647 # endif |
4648 vim_strchr(p_go, GO_TERMINAL) != NULL | 4648 vim_strchr(p_go, GO_TERMINAL) != NULL |
4649 && (options & (SHELL_FILTER|SHELL_DOOUT|SHELL_WRITE|SHELL_READ)) == 0) | 4649 && (options & (SHELL_FILTER|SHELL_DOOUT|SHELL_WRITE|SHELL_READ)) == 0) |
4650 { | 4650 { |
4651 /* Use a terminal window to run the command in. */ | 4651 char_u *cmdbase = cmd; |
4652 x = mch_call_shell_terminal(cmd, options); | 4652 |
4653 // Skip a leading quote and (. | |
4654 while (*cmdbase == '"' || *cmdbase == '(') | |
4655 ++cmdbase; | |
4656 | |
4657 // Check the command does not begin with "start " | |
4658 if (STRNICMP(cmdbase, "start", 5) != 0 || !VIM_ISWHITE(cmdbase[5])) | |
4659 { | |
4660 // Use a terminal window to run the command in. | |
4661 x = mch_call_shell_terminal(cmd, options); | |
4653 # ifdef FEAT_TITLE | 4662 # ifdef FEAT_TITLE |
4654 resettitle(); | 4663 resettitle(); |
4655 # endif | 4664 # endif |
4656 return x; | 4665 return x; |
4666 } | |
4657 } | 4667 } |
4658 #endif | 4668 #endif |
4659 | 4669 |
4660 /* | 4670 /* |
4661 * Catch all deadly signals while running the external command, because a | 4671 * Catch all deadly signals while running the external command, because a |