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

Add env variable for whether quotes should be added to tab-completions of files with spaces inthe name #181

Closed
scopatz opened this issue Apr 2, 2015 · 9 comments
Milestone

Comments

@scopatz
Copy link
Member

scopatz commented Apr 2, 2015

See #68

@scopatz scopatz added the feature label Apr 2, 2015
@scopatz scopatz added this to the v0.2 milestone Apr 2, 2015
@adqm
Copy link
Member

adqm commented Apr 3, 2015

I am not sure how I feel about this. Not adding quotes means that tab completion (as currently implemented) would lead to completions that aren't valid. To me, it seems like if you want to turn off quotes, the only other valid option is not to offer completions for names with spaces in them. Alternatively, we could allow escaping spaces with \, but that feels weird (to me, the "right" way in xonsh is to use Python strings for this, though I could understand that that might be a turn-off for some).

@scopatz
Copy link
Member Author

scopatz commented Apr 3, 2015

I am not a huge fan of this either, which is why I won't implement it personally :). Though I do empathize with people who want tools to work for them. So if someone plopped down a PR that implemented this, I'd be all for including it. I think the current behaviour should remain as the default, though.

@adqm adqm mentioned this issue Apr 3, 2015
@scopatz scopatz modified the milestones: v0.2, v0.3 Sep 12, 2015
@mfeif
Copy link

mfeif commented Dec 14, 2015

Hi there. You say that you want current behaviour to remain the default;

I'm having a weird thing wherein the "current behavior" is different on my Mac laptop vs my Ubuntu server. On Ubuntu:

touch "my file.txt"
ls my<TAB>
(leads to...)
ls my file.txt

On OSX:

touch "my file.txt"
ls my<TAB>
(leads to...)
ls 'my file.txt'

Interestingly, on Ubuntu, if I preface the m with a " then xonsh changes it into:
ls 'my file.txt'

I just installed xonsh today, after hearing you on the podcast, so the environments should be "pretty" clean. I didn't have any weirdo stuff going on (though trying to set the PROMPT ala the tutorial doesn't work on OSX).

My thought is that "correct" is to make valid commands/filenames, etc. And to conform to how bash/etc work(ed). I like the way it's working on OSX Any idea why these two platforms are different, and how I might be able to address it?

Both shells are being launched directly when logging in (not from an existing bash/sh/tsh/whatever).

@gforsyth
Copy link
Collaborator

Hey @mfeif -- what are the contents of $BASH_COMPLETIONS on your Ubuntu box?

And how did you install xonsh?

@mfeif
Copy link

mfeif commented Dec 14, 2015

In both cases, I installed via pip from a zip file pulled from a github tag (xonsh-0.2.3.zip). In the case of the server, I installed with sudo.

$BASH_COMPLETIONS are: ['/etc/bash_completion', '/usr/share/bash-completion/completions/git']

@gforsyth
Copy link
Collaborator

Ok -- I think I fixed the missing quotes issue in #561 -- would you mind installing from the current xonsh master and seeing if that resolves your issue?

I think with pip you can just

pip install git+git://github.com/scopatz/xonsh.git

@adqm
Copy link
Member

adqm commented Dec 14, 2015

fwiw, I'm also working on something that will make completion of names with spaces a bit more robust (as it is written now, even with your fix, it's a bit on the flaky side)

:)

@gforsyth
Copy link
Collaborator

Hey @scopatz -- no rush on this, but do you want to keep this feature request open? I think with quoted paths working cross-platform that we're probably ok not offering to turn them off. What say ye?

@scopatz
Copy link
Member Author

scopatz commented Jun 15, 2016

Yeah, I am happy to close this since our quote and tab completion handling has vastly improved over tge past year thanks to @adqm!

@scopatz scopatz closed this as completed Jun 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants