Comments (12)
Linking #28395 since the topic of slash handling got brought up here.
Treating this as a sort of "tracking issue" while the details of what we want to change/fix aren't fully decided yet.
If/when that PR lands, I would try and take stock of what works/doesn't on Windows with various shells and try to implement the "let's have libuv alone handle non-cmd shells" strategy, unless there are strong objections or other things to try first.
from neovim.
That would be a more radical if for my purposes equally workable solution.
I am slightly worried about breaking the ability to use UNC Paths, which are used for referring to files on networked devices without assigning them a drive letter (so it could be worked around within limits). After testing, it seems one can write UNC paths with forward slashes too!
The \\?\
/\\.\
format for paths (which mandates backslashes) used to be the only way to get around the MAX_PATH
limitations on Windows, but as of Windows 10 1607 this is no longer the case. Windows 10 1607 has been end of life since April 2019, so all currently officially supported versions of Windows support the registry setting.
There are still weird edge cases that use the "DOS device" path format, like named pipes. I don't know that we care about this, but for the sake of completeness I'm mentioning it.
from neovim.
Note we claim support for Windows >= 8, but that, too, can be revisited.
I will one-up you and claim we already don't support anything older than Windows 10 "Version 1809" as the :terminal
feature does not work for those systems. It depends on how one interprets what "support" means, but I personally interpret it to mean ALL editor features are supported, rather than that some parts happen to work.
One might argue that this quasi-bump in minimum version was accidental and that it should therefore count more as a bug/accident than intentional. I personally think this is a bit weak stance as documenting this problem is already an admission from our side that we don't see this being resolved soon.
I propose we simply bite the bullet and officially only support Windows 10 "Version 1809" to simplify the question on which windows version we support (which is brought up surprisingly frequently).
from neovim.
For the record, being more restrictive (and explicit) about which "shells" we support on Windows is an option here (though maybe not for 0.10).
from neovim.
In the sense of saying "we only support cmd.exe and powershell", or "we eventually stop supporting cmd.exe"?
I use Neovim on Windows exclusively through an MSYS2 environment, and while I understand it's not an officially supported use case/"platform", I would really like for unix shells to be supported and working. Lots of people use Git Bash on Windows for example.
I think, generally speaking:
For non-cmd.exe, we should completely ignore shellquote/shellxquote/shellxescape/etc, not do any quoting/escaping of our own, and instead let libuv handle it for us. This will work correctly with any program that uses the regular C runtime argument handling (including, I believe, powershell/pwsh).
For cmd.exe, we could continue using the existing code paths and tell libuv to pass the arguments verbatim as we do now. libuv does not handle cmd.exe specially in any way, so this seems reasonable if it's important that the edge cases are handled proper.
I could imagine a future where Neovim simply doesn't support cmd.exe as a shell anymore, and defaults to powershell. I can't think of anything that would definitely break, since users are already free to change the shell settings away from cmd.exe, so nothing inside of Neovim should really have a hard dependency on it, but I still imagine it may cause some churn.
Either way, that decision should not stand in the way of fixing the existing use cases today.
from neovim.
I could imagine a future where Neovim simply doesn't support cmd.exe as a shell anymore, and defaults to powershell.
That's what I was thinking, yes, if it allows things to work better on other platforms (including win shells) and the alternatives are reasonable.
In any case, it would be helpful to gather some data on 1. which shells/platforms are actually used on Windows and 2. the issues each have (what works, what doesn't, what requires jumping through hoops).
from neovim.
Nice analysis!
"we eventually stop supporting cmd.exe"
Seems like a separate topic. Based on this thread, I don't see a reason to drop support for a particular shell?
So, basically, there are two places in the chain that are trying to make the argument vector "windows-friendly": Vim's
shell_build_argv
, and libuv'smake_program_args
. Only one of the two should be done. To only use vim's behaviour, it is probably sufficient to change libuv_process_spawn to always passUV_PROCESS_WINDOWS_VERBATIM_ARGUMENTS
. Sincecmd.exe
already has to use this behaviour since its argument parsing does not follow that of the C runtime (i.e. all other programs), this seems like it will cause the least amount of breakage
Based on the git logs, I don't see a rationale for why f3cc843 special-cased "cmd.exe", I assume it was just conservative.
For non-cmd.exe, we should completely ignore shellquote/shellxquote/shellxescape/etc, not do any quoting/escaping of our own, and instead let libuv handle it for us.
Sure, let's try it. Existing tests are here:
from neovim.
One thing I'd definitely like to fix is this
:make
:!cargo 2>&1| tee F:\msys2\tmp\nvim.0\cn0m97\2
cargo 2>&1| tee F:\msys2 mp
vim.0error
...
E40: Can't open errorfile F:\msys2\tmp\nvim.0\cn0m97\2
The weird printing seems to be zsh specific, but even with bash it still doesn't write the correct file, so quickfix is broken.
I think the temporary file path should be obeying 'shellslash'
:
When set, a forward slash is used when expanding file names. This is
useful when a Unix-like shell is used instead of cmd.exe. Backward
slashes can still be typed, but they are changed to forward slashes by
I'm not sure how involved of a fix that is, but seeing as Neovim doesn't currently use UNC paths, I don't see a big issue.
from neovim.
I think the temporary file path should be obeying 'shellslash':
Or 'shellslash'
should be removed and forward slashes be used unconditionally. The point here is that we are fine making breaking changes for legacy systems that are no longer officially supported, if that helps fixing bugs on supported systems.
from neovim.
(Again, this is just opening a door to more options for a solution to these issues, not a push to do that.)
Note we claim support for Windows >= 8, but that, too, can be revisited. We need to distinguish platform tiers (:h supported
) by version anyway.
from neovim.
We use named pipes. Does it not support forward slashes? In any case I'm not sure we need to care, because we don't treat named pipes as filesystem paths.
from neovim.
It depends on how one interprets what "support" means, but I personally interpret it to mean ALL editor features are supported, rather than that some parts happen to work.
Yes. The current wording implies that ":terminal" is not covered by "support". It's a slippery slope I would like to get off of. It strikes me as weird that we support significantly more versions than our core dependencies (libuv; would have to check tree-sitter).
from neovim.
Related Issues (20)
- nvim_eval_statusline() can return the default statusline HOT 1
- Segfault every few minutes with D- modifier HOT 7
- build: "make install" installs outdated help tags HOT 1
- vim.iter: flatten() non-list input
- Lua: vim.func functional utils HOT 3
- nightly version crash after opened a file HOT 1
- scp under Cygwin on Windows HOT 2
- Floating window with `focusable = false` can become current after window operation involving quickfix window HOT 1
- crash in get_healthcheck_names HOT 1
- `vim.deprecate()` can be significantly slower than deprecated function HOT 1
- Windows: treesitter language parsers are not released, preventing reinstallation HOT 13
- gc Comments C++ incorrectly HOT 4
- make namespaces have global scope by default HOT 1
- SUT functions live on . When using SUT functions in test code, the usage looks like HOT 1
- Defaults: map gd to CTRL-] HOT 10
- Upstream :Lsp commands from nvim-lspconfig HOT 8
- `:finish` can no longer be used in `exrc` files since v0.9.0
- Docs: describe priority between editorconfig and autocmd like FileType
- vim.lsp.rpc.connect doesn't works on windows HOT 5
- laststatus = 0 doesn't remove statusline from horizontal splits HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from neovim.