1 To: vim_dev@googlegroups.com
4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
11 Problem: MS-Windows: Can't run an external command without a console window.
12 Solution: Support ":!start /b cmd". (Xaizek)
13 Files: runtime/doc/os_win32.txt, src/os_win32.c
16 *** ../mercurial/vim73/src/os_win32.c 2011-05-05 18:31:54.000000000 +0200
17 --- src/os_win32.c 2011-05-25 16:45:31.000000000 +0200
23 PROCESS_INFORMATION pi;
24 + DWORD flags = CREATE_NEW_CONSOLE;
31 si.dwFlags = STARTF_USESHOWWINDOW;
32 si.wShowWindow = SW_SHOWMINNOACTIVE;
34 + else if ((STRNICMP(cmdbase, "/b", 2) == 0)
35 + && vim_iswhite(cmdbase[2]))
37 + cmdbase = skipwhite(cmdbase + 2);
38 + flags = CREATE_NO_WINDOW;
39 + si.dwFlags = STARTF_USESTDHANDLES;
40 + si.hStdInput = CreateFile("\\\\.\\NUL", // File name
41 + GENERIC_READ, // Access flags
43 + NULL, // Security att.
44 + OPEN_EXISTING, // Open flags
45 + FILE_ATTRIBUTE_NORMAL, // File att.
47 + si.hStdOutput = si.hStdInput;
48 + si.hStdError = si.hStdInput;
51 /* When the command is in double quotes, but 'shellxquote' is
52 * empty, keep the double quotes around the command.
55 NULL, // Process security attributes
56 NULL, // Thread security attributes
57 FALSE, // Inherit handles
58 ! CREATE_NEW_CONSOLE, // Creation flags
60 NULL, // Current directory
61 &si, // Startup information
63 NULL, // Process security attributes
64 NULL, // Thread security attributes
65 FALSE, // Inherit handles
66 ! flags, // Creation flags
68 NULL, // Current directory
69 &si, // Startup information
73 EMSG(_("E371: Command not found"));
76 + if (si.hStdInput != NULL)
78 + /* Close the handle to \\.\NUL */
79 + CloseHandle(si.hStdInput);
81 /* Close the handles to the subprocess, so that it goes away */
82 CloseHandle(pi.hThread);
83 CloseHandle(pi.hProcess);
84 *** ../vim-7.3.202/src/version.c 2011-05-25 15:16:06.000000000 +0200
85 --- src/version.c 2011-05-25 17:05:59.000000000 +0200
89 { /* Add new patch number below this line */
95 hundred-and-one symptoms of being an internet addict:
96 108. While reading a magazine, you look for the Zoom icon for a better
99 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
100 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
101 \\\ an exciting new programming language -- http://www.Zimbu.org ///
102 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///