Skip to content
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

It's impossible to enter a literal tab (\t) in the shell #71

Open
JelteF opened this issue Jan 23, 2018 · 3 comments · May be fixed by #84
Open

It's impossible to enter a literal tab (\t) in the shell #71

JelteF opened this issue Jan 23, 2018 · 3 comments · May be fixed by #84

Comments

@JelteF
Copy link

JelteF commented Jan 23, 2018

It seems shlex has quite weird behaviour for escaped characters.
If you enter:

>>> command "a\tb"

The argument you get will be atb. Typing an actual literal tab character is ignored by the shell, so it's also not possible to enter a tab that way.

I don't see a very easy way to fix this, especially since shlex is not maintained anymore. Would you be okay with a PR that removes the dependency on shlex and uses strconv.Unquote() to handle escaping and quoting?

@abiosoft
Copy link
Owner

It is more complex than simply unquoting. There are cases where you can have mixed quotes, special characters e.t.c. I considered handling the parsing but shlex has many edge cases handled already.

@JelteF
Copy link
Author

JelteF commented Jan 24, 2018

Thanks for the explaination. I forked shlex to support Go escape sequences as well as it's regular escapes. I'm trying it out now on my own project and it seems to work great so far. I'm happy to make a pull request to ishell use the fork if you're open to that.

@abiosoft
Copy link
Owner

Sure, I'm open to it. Thanks.

@JelteF JelteF linked a pull request Mar 26, 2018 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants