-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix handling of paths with special characters / wildcards #652
base: master
Are you sure you want to change the base?
Conversation
I have tested the reported cases and your PR seems to fix them. I was also not able to observe anything unusual when using tiles in the file name. |
Thanks, I can reproduce it with external commands, especially together with quoting this is complete havoc currently. I believe we will have to clarify and change some of the requirements here. In principle we have a matrix of combinations here, with different wildcards as the rows (internal like %, the tilde, python globbing, shell expansion) and different command types as the columns (regular command, path command such as :open, external without sub-shell using !, external with sub-shell using yes / no indicates whether this combination should be supported. I am unsure on the ones colored, any feedback or discussion would be great. Here green means this is the way it is currently, red is a deviation. Removing globbing from external commands would save us a lot of escaping-havoc, and we could strictly split shell escaping and glob escaping, as they never overlap. I am honestly not 100 % sold on changing this, yes it could be useful to run something along tl;dr different wildcards meet different command types, can we remove globbing from external commands? Should we add some further expansions to internal (non-path) commands? |
I think globbing could be useful in external commands. I don't think it's currently possible to escape the globbing symbols? I think either it should be removed or \ escaping added. As for the external commands issue, tilde and globbing expansion could probably be done before internal symbol expansion so the issue doesn't occur? |
Works with two backslashes, i.e. I am not really sold on globbing in external commands though. Mainly to avoid actually using a sub-shell with |
* Aliases first, as these can contain additional wildcards * Then "path-like" expansion of the tilde * Finally internal expansions, to avoid extra expansions of the true path names
db28e84
to
4faa7b8
Compare
No need to expand internal wildcards already here as it is done in the next step.
4faa7b8
to
7bfe9c0
Compare
Escapes the characters
[]?*
properly when expanding wildcards such as%
and%m
.fixes #553
@pglira @TeaWhyDee @jcjgraf could one of you give this a quick check?
In addition, I was not able to find out what the issue with
image.jpg~
should be, all playing around I did with tilde worked just fine. Could someone elaborate, so I can potentially add this to the PR?