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
mv '[].txt a' crashes, problems with bracket / glob pattern #4811
Nushell cannot handle Brackets correctly in some cases, example being when trying to mv a file containing them. This seem to be the same for multiple commands using globs, Would be nice to be able to disable globs if requested.
How to reproduce
Have a file with name containing []
use mv to move/rename the file.
Expected behavior
I expect the file to be renamed, without an error.
changed the title [-]`mv '[].txt a'` crashes, problems with bracket / glob pattern[/-][+]mv '[].txt a' crashes, problems with bracket / glob pattern[/+]on Mar 10, 2022
i personally want to keep globs and even enhance them so we could do ls [a-z]*.txt or ls [a..z]*.txt but I think we also need to be able to escape them. Maybe we need to add [ and ] as characters we can escape so we could do mv "blah\[something\]" something_else?
It looks like it's going to take more work than just adding more escape characters. i think we'll need to change how each command interacts with globs or have a helper function somewhere that every command can use when dealing with globs.
Activity
[-]problems with bracket [/-][+]`mv '[].txt a'` crashes, problems with bracket / glob pattern[/+][-]`mv '[].txt a'` crashes, problems with bracket / glob pattern[/-][+]mv '[].txt a' crashes, problems with bracket / glob pattern[/+]fdncred commentedon Mar 10, 2022
i personally want to keep globs and even enhance them so we could do
ls [a-z]*.txtorls [a..z]*.txtbut I think we also need to be able to escape them. Maybe we need to add[and]as characters we can escape so we could domv "blah\[something\]" something_else?fdncred commentedon Mar 10, 2022
It looks like it's going to take more work than just adding more escape characters. i think we'll need to change how each command interacts with globs or have a helper function somewhere that every command can use when dealing with globs.
fdncred commentedon Mar 13, 2022
@FilipAndersson245 does #4818 fix this?
FilipAndersson245 commentedon Mar 13, 2022
Yes now it works