-
-
Notifications
You must be signed in to change notification settings - Fork 631
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
Support for backslash space escape #3595
Comments
Hi @jonathanhogg, thanks for the suggestion and sorry for the delay. |
Thanks. Yes, I am aware how to quote in xonsh – I have been a user for quite some time now :-) I raised the issue because one of @scopatz 's original key user bases for xonsh was mean to be scientists and a large number of scientists use macOS. A side benefit is, of course, familiarity for people moving from other command-line shells that do support backslash escapes. While I agree that Terminal.app here is probably making a poor assumption about the underlying shell, it is also the default terminal app on macOS. Historically, changing the direction of Apple has proven to be harder than open source projects. It was a suggestion that you are, of course, welcome to ignore ;-) |
This has been settled a long time ago. See, for instance, #1432.
It does not only make poor assumptions, but it also chooses the worst implementation possible based on those assumptions. Even for bash and zsh (and other sh-like shells) the correct solution would be to quote the file name using single quotation marks to prevent accidental expansion of special characters. |
Oh, and I completely forgot to mention Subprocess Strings tutorial providing some discussion and explanation. |
Fair enough, I didn't mean to dig up an old can of worms. I was just trying to point out a valid use case for a class of users for which xonsh has a regression vs other shells. The great thing about open source is there's room to fork. |
Just as a note for others who might find the same issue I had. It is not a bug in xonsh but a feature in emacs. It is not just macOS but on non Microsoft Systems emacs call to sanitise shell arguments Emacs code for reference is
(replace-regexp-in-string |
xonfig
Expected Behavior
It would be incredibly useful (to me, at least) if xonsh supported the standard shell backslash space escape on the command line.
While one can work around this by quoting the filename, the specific pain is that dragging a file into a terminal on macOS will helpfully paste the filename into it. Unfortunately, it assumes a regular shell and so uses backslash space escapes when it does this. Since using spaces in filenames is incredibly common in a primarily GUI-driven OS like macOS, that causes significant grief as it means editing the command line after dragging the file in.
Current Behavior
A command line using the backslash space escape won't work in xonsh – the spaces are interpreted as separators and the backslashes as literal backslashes.
Steps to Reproduce
Basically any command line with an escaped space, e.g.:
The text was updated successfully, but these errors were encountered: