-
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
[QUESTION] How do I escape asterisk (*) when typing a command or creating a keybinding #744
Comments
Thanks for your bug report! Upon a first glance, I can reproduce this, but am unsure what is happening behind the scenes. I will try to take a detailed look tonight after work 😊 |
So, this is very much intertwined with the wildcard havoc discussed in #652. I have pushed a few more commits to the related However, this is still not complete as the completion (and related commandline escaping) for paths which contain glob chars ( |
The issue seems to be much more complex than I was thinking. External commands starting with
From my perspective, globbing is a shell feature. Having shell-like features on an external command If one wants globbing feature while running external commands, About the another special characters (
On problems like this, I like to see how well established tools like > touch 'This*is*a*file.txt'
> touch 'This?is[a]file.txt'
> ls -l
合計 0
-rw-r--r-- 1 mateus mateus 0 11月 28 11:04 This*is*a*file.txt
-rw-r--r-- 1 mateus mateus 0 11月 28 11:04 This?is[a]file.txt Then I expand this using glob. First I type: ls -l *.txt Then press ls -l This\*is\*a\*file.txt This\?is\[a\]file.txt So instead of reinventing the wheel, the ideal is to imitate what the shell do. The shell developers already solved the problem, this is probably the best solution, there is no need to solve the same problem again in another way. My 2 cents... 😇 |
Thanks for your detailed thoughts! 😊 I tend to agree with you on all points raised (bar the fact that we will of course not have the funky expansion on The current implementation in the This currently leaves at least these two bugs I can see:
|
Oh yes, it was a reference example, I did not mean to have a new feature 😆 So if I understood correctly:
|
This is pretty much it, let me add to your points:
I suppose we could figure out the context after the split and then (re-) escape accordingly? Maybe your systematic approach also works. In any case, will need some solid testing and fiddling 😆 Maybe I take the time over the week-end 🤞 |
Greetings.
I'm trying to set my wallpaper in sway using the image I'm currently viewing in
vimiv
. The command is!swaymsg output * bg % fill
, but I noticed that the*
is being expanded to all files in the current directory.I tried:
!swaymsg output '*' bg % fill
!swaymsg output "*" bg % fill
!swaymsg output \* bg % fill
I have no idea what else I could try. In
fish
I can just use single quotations and it works.I also tried using
spawn
, but it always say something on the lines/usr/bin/fish: option '--command' requires an argument
.Here some of my attempts:
spawn swaymsg output '*' bg % fill
spawn --shell=fish --shellarg=--command swaymsg output '*' bg % fill
spawn swaymsg output '*' bg % fill --shell=fish --shellarg=--command
The text was updated successfully, but these errors were encountered: