You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Warn on use of deprecated features (qmark-noglob, & in tokens) #8131
changed the title [-]Warn about deprecated features (qmark-noglob, & in tokens)[/-][+]Warn on use of deprecated features (qmark-noglob, & in tokens)[/+]on Jul 11, 2021
This is almost certainly not the right place to leave this comment, but I'm not sure where is:
Somehow I just encountered the qmark-noglob "feature", after upgrading fish. I spent longer than I'd care to admit getting confused trying to move a set of files from one directory to another. After seeing that ~/Downloads/20*-*.pdf matched too many files, I tried to use ~/Downloads/20??-??.pdf. Eventually I executed the mv command using bash and it worked... leading me to eventually run across the desire to completely remove the questionmark glob character in fish.
I guess other people have different workflows! I use ? as a glob character quite frequently and it's kind of blowing my mind that it's slated to complete removal. (I also don't recall running into a single instance of it getting in the way of something) Is there a replacement planned? (Other than old version of fish or different shell entirely?)
? and & are very often used as part of URL requests.
If you wish to disable the glob for these you can use this command:
# set -U fish_features qmark-noglob
# status features
stderr-nocaret on 3.0 ^ no longer redirects stderr (historical, can no longer be changed)
qmark-noglob on 3.0 ? no longer globs
regex-easyesc on 3.1 string replace -r needs fewer \'s
ampersand-nobg-in-token on 3.4 & only backgrounds if followed by a separator
Could someone explain the reason for making this "impossible" to turn off? And maybe not do that?
It'll be impossible to turn off because we don't want to have multiple dialects of the language. We'll do that for a transitional phase, but we don't want to have the same effect as bash with "nullglob" and "errexit" and "extglob" and so on, where what a line means depends on global state.
It's turned off because it makes ? a special character that needs to be quoted and escaped and in particular makes URLs annoying to use. It also doesn't pull its weight because it is often not actually necessary and can be misused and lead to undermatching - I saw archlinux match python3.? in a script once, which broke once python3.10 came out.
Fish's globs are very simple, and if you need something more specific you can always use find.
Activity
[-]Warn about deprecated features (qmark-noglob, & in tokens)[/-][+]Warn on use of deprecated features (qmark-noglob, & in tokens)[/+]uberjay commentedon Aug 20, 2024
This is almost certainly not the right place to leave this comment, but I'm not sure where is:
Somehow I just encountered the
qmark-noglob"feature", after upgrading fish. I spent longer than I'd care to admit getting confused trying to move a set of files from one directory to another. After seeing that~/Downloads/20*-*.pdfmatched too many files, I tried to use~/Downloads/20??-??.pdf. Eventually I executed themvcommand usingbashand it worked... leading me to eventually run across the desire to completely remove the questionmark glob character in fish.I guess other people have different workflows! I use
?as a glob character quite frequently and it's kind of blowing my mind that it's slated to complete removal. (I also don't recall running into a single instance of it getting in the way of something) Is there a replacement planned? (Other than old version of fish or different shell entirely?)hholst80 commentedon Dec 14, 2024
?and&are very often used as part of URL requests.If you wish to disable the glob for these you can use this command:
norbertkeri commentedon Dec 18, 2024
I just saw in the release notes of 4.0b1 that this (qmark-noglob) will become a read only flag, and it will be "impossible" to turn off
Could someone explain the reason for making this "impossible" to turn off? And maybe not do that?
faho commentedon Dec 18, 2024
It'll be impossible to turn off because we don't want to have multiple dialects of the language. We'll do that for a transitional phase, but we don't want to have the same effect as bash with "nullglob" and "errexit" and "extglob" and so on, where what a line means depends on global state.
It's turned off because it makes
?a special character that needs to be quoted and escaped and in particular makes URLs annoying to use. It also doesn't pull its weight because it is often not actually necessary and can be misused and lead to undermatching - I saw archlinux matchpython3.?in a script once, which broke once python3.10 came out.Fish's globs are very simple, and if you need something more specific you can always use
find.septatrix commentedon Dec 19, 2024
faho commentedon Dec 19, 2024
Fish, by its design philosophy, is not. We try to avoid configuration options, and especially global state options like this.
Anyway, I do believe this discussion has now run its course and trust you'll leave it at that.