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
Escaping spaces broken; mysterious missing directory; data loss #1843
Comments
Hey @OJFord, thanks for reporting. See #1432 for a long discussion of this issue. As for what happened, you created two directories, one called |
From $ __xonsh_history__[idx]
'cd ~/Documents\foo\\ bar' |
Oops, thanks @gforsyth, sorry I missed the duplicate.
That's not what happened though - none of those exist anywhere (I've checked |
Not sure, then, since that's the behavior I see: il@bad_cat ~/tmp 🐚 mkdir Documents
gil@bad_cat ~/tmp 🐚 mkdir Documents/foo\ bar
gil@bad_cat ~/tmp 🐚 touch thing
gil@bad_cat ~/tmp 🐚 mv thing Documents/foo\ bar
gil@bad_cat ~/tmp 🐚 ls
Documents bar
gil@bad_cat ~/tmp 🐚 ls bar/
'foo\' thing
gil@bad_cat ~/tmp 🐚 |
Oh, sorry, no I found it.. I overspecified previously. My actual case was more confusing since I had 5 escape characters; so it did what you described just with more things. Thanks! I think I know where I come down on "to quote or not to quote" though... I can't imagine ever wanting a literal backslash in this way; quite often if I start typing I'll escape instead of go back to quote - though of course the tab completion helps, just not in the mkdir/mv-to-new case. Thanks again for such quick help! 😁 |
Happy to help! And agreed, the literal backslash is hardly ever what anyone wants. |
As a quick though, maybe we could have an escape xontrib (as part of bashisms?) that has a precommand hook that let's people use their muscle memory? This would only affect the shalle and not scripts / the language, like other potential bashisms. It might be a good middle ground. |
It seems that spaces cannot be escaped:
This somehow allowed me to create a directory, move something into it, and now not have that directory accessible at all?!
The escaping issue is annoying; potentially harmful. But I can't even figure out what
mkdir
ormv
did with the arguments they did receive?Brought it on myself by using spaces in a way - I was just trying to be consistent with existing directories, but this definitely shouldn't fail as hard as this.
Fortunately my only data loss was a git repo without unpushed changes.
The text was updated successfully, but these errors were encountered: