When I type z cod and then hit tab, I get this: [jga] ~: z "/Users/jga/code (notice the open quote, but not closing)
[jga] ~: z "/Users/jga/code
That's pretty weird and shouldn't be happening. Are you using bash or zsh?
This happens on both my Mac and Ubuntu machines
I can't replicate this on either my mac or ubuntu machines. I wonder if there are any quotes or weird directory names in your ~/.z file that might somehow be causing this?
If you want, you can take a look at line 107 in z.sh, and change it from:
if( $1 ) print "\"" $1 "\""
if( $1 ) print $1
which should disable quoting of tab completed dirs entirely.
thanks, that fixed it
I am having the same issues here. I am using zsh and here is what happens (a bit different from @jgallen23):
➜ ~ z co[TAB]
➜ ~ z \"/Users/Jean/code
➜ ~ z git[TAB]
➜ ~ z \"/Users/Jean/code/github\"
I have to admit I'm kind of stumped about this issue. Looks like maybe zsh already treats completions as quoted? And I can't replicate the issue on bash.
The easy workaround for anyone affected is to remove the quoting in line 107 as described above, but I kind of hate that.
z tries to tab complete after treating all arguments as regex, so if you do, for example:
z co git[TAB]
it should look like:
z co "/Users/Jean/code/github"
as only the last argument is replaced after completion. So what I do is check if the last when you hit enter argument is a valid directory, and it it is, assume you tab-completed to there. And that will break on "directories with spaces" unless they are quoted correctly. Note, at that point, I'm ignoring the co argument...
I have the same issue on Zsh:
At 222, you're quoting the completion again.
Good point, does removing the outer quotes in 222 work correctly? If so, can you test with a /directory with spaces
/directory with spaces
Actually, no, that didn't work, but if I remove the quotes at line 107, it works properly. Spaces are escaped.
z /Users/sorin/Library/Application\ Support
remove quotes from completions for now