Calling cmd.exe in Windows follows a very different pattern from Vim.
The primary difference is that Vim does a nested call to cmd.exe, e.g.
the following call in Vim
system('echo a 2>&1')
spawns the following processes
"C:\Program Files (x86)\Vim\vim80\vimrun" -s C:\Windows\system32\cmd.exe /c (echo a 2^>^&1
^>C:\Users\dummy\AppData\Local\Temp\VIoC169.tmp 2^>^&1)
C:\Windows\system32\cmd.exe /c C:\Windows\system32\cmd.exe /c (echo a 2^>^&1
^>C:\Users\dummy\AppData\Local\Temp\VIo3C6C.tmp 2^>^&1)
C:\Windows\system32\cmd.exe /c (echo a 2>&1
>C:\Users\dummy\AppData\Local\Temp\VIo3C6C.tmp 2>&1)
The escaping with ^ is needed because cmd.exe calls itself and needs to
preserve the special metacharacters for the last call. However in nvim
no nested call is made, system('') spawns a single cmd.exe process.
Setting shellxescape to "" disables escaping with ^.
The previous default for shellxquote=( wrapped any command in
parenthesis, in Vim this is more meaningful due to the use of tempfiles
to store the output and redirection (also see &shellquote). There is
a slight benefit in having the default be empty because some expressions
that run in console will not run within parens e.g. due to unbalanced
double quotes
system('echo "a b')
Disable CommandLineToArgvW-standard quoting for cmd.exe.
libuv assumes spawned processes follow the convention expected by
CommandLineToArgvW(). But cmd.exe is non-conformant, so for cmd.exe:
- With system([]), the caller has full control (and responsibility) to
quote arguments correctly.
- With system(''), shell* options are used.
libuv quoting is disabled if argv[0] is:
- cmd.exe
- cmd
- $COMSPEC resolving to a path with filename cmd.exe
Closes#6329
References #6387
On Windows, `mch_open_rw` is not actually doing what it claims. This
manifests as "E301: Oops, lost the swap file !!!" when filename is
changed with :file {name}.
Steps to reproduce (covered by test/functional/ex_cmds/file_spec.lua):
nvim -u NONE
:edit test
:file test2
E301 Oops, lost the swap file!!!
From libuv/src/win/fs.c:
void fs__open(uv_fs_t* req) {
...
attributes |= FILE_ATTRIBUTE_NORMAL;
if (flags & _O_CREAT) {
if (!((req->fs.info.mode & ~current_umask) & _S_IWRITE)) {
attributes |= FILE_ATTRIBUTE_READONLY;
}
}
Lua has too many pitfalls here:
- os.execute() requires shell-escaping
- os.execute() has breaking changes between Lua 5.1 and 5.2
- No native way in Lua to handle "readonly" etc. on Windows
Problem: Toupper and tolower don't work properly for Turkish when 'casemap'
is empty. (Bjorn Linse)
Solution: Check the 'casemap' options when deciding how to upper/lower case.
3317d5ebbe
vim-patch:8.0.0553
Problem: Toupper/tolower test with Turkish locale fails on Mac.
Solution: Skip the test on Mac.
9f4de1f543
vim-patch:8.0.0554
Problem: Toupper and tolower don't work properly for Turkish when 'casemap'
contains "keepascii". (Bjorn Linse)
Solution: When 'casemap' contains "keepascii" use ASCII toupper/tolower.
1cc482069a
vim-patch:8.0.0555
Problem: Toupper/tolower test fails on OSX without Darwin.
Solution: Skip that part of the test also for OSX. (Kazunobu Kuriyama)
d2381a2cad
Problem: When making a character lower case with tolower() changes the byte
cound, it is not made lower case.
Solution: Add strlow_save(). (Dominique Pelle, closesvim/vim#1406)
cc5b22b3bf
Join almost identical strup_save and strlow_save functions to one
Function.
Should provide some compatibility with old busted. And also removes duplicate
parts from successString and skippedString, making them more like failureString
and errorString which do not have times for technical reasons (busted for some
reason did not yet compute duration before running the relevant handlers).
Reasoning:
1. gtest is better then something like utfTerminal, yet it is way too verbose.
2. gtest cannot be configured to show colors always.
3. Actually I am going to add a CMake target which will allow running tests
(especially, functional tests) in parallel, but this is not going to work
well with any of the default output handlers. Build in this case must be more
or less silent, yet debuggable. New handler does not support this in this
commit though.