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

Completing paths with spaces on windows #106

Open
klemens opened this issue Jan 5, 2017 · 2 comments
Open

Completing paths with spaces on windows #106

klemens opened this issue Jan 5, 2017 · 2 comments

Comments

@klemens
Copy link

klemens commented Jan 5, 2017

Completing paths which include spaces does not work currently, as the space is part of the DEFAULT_BREAK_CHARS array and so extract_word does not extract the whole path.

A workaround is to remove it from the list and making sure that you only pass the path without any prefix to the FilenameCompleter.

A proper fix would probably be doing what windows does: Adding quotes around the path if it contains a space.

@gwenn
Copy link
Collaborator

gwenn commented Jan 6, 2017

Currently the escape/unescape logic works only on unix.
Maybe we can try to use shell-escape (but the crate does not provide the unescape) !

@klemens
Copy link
Author

klemens commented Jan 7, 2017

Yes, using shell-escape seems better than trying to come up with our own logic. However, it always escapes using single quotes on unix, which might not be the desired behaviour (but it certainly is the simplest). Using it only for windows also seems possible, what do you think?

I guess unescape is missing, because it is only ever needed when actually writing a shell. But it shouldn't be too difficult to write a parser for quoted strings for windows. We also need to update extract_word to recognize these partially quoted strings correctly: ls "my pict<TAB>

I will see if I can come up with a pull request implementing this.

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

No branches or pull requests

2 participants