You are not logged in.

#1 2008-07-31 12:24:32

pseup
Member
Registered: 2008-06-06
Posts: 103

[Solved] Zsh vs Bash basic tab functionality question.

Howdy. So, I've been playing with Zsh on and off for a few weeks now. And now I don't know if I just imagined some functionality, or it is in fact not working properly.

I've noticed that in Bash, I can tab complete directory names inside the current working directory, but in Zsh I cannot.

Consider this scenario:
I am sitting in my home directory "/home/pseup/". And I want to run a script, eg "/home/pseup/scripts/common/myscript.sh".

In bash I am able to just type:

$ scr<tab>co<tab>my<tab>
# becomes:
$ scripts/common/myscript.sh

Switch over to zsh, and type:

$ scr<tab>

and nothing happens.
If I type the full dir name, then hit tab, all subdirectories / files within can be tab completed.

$ scripts/co<tab>my<tab>
# becomes:
$ scripts/common/myscript.sh

So, am I supposed to be able to use the bash method above, or did I just imagine it working in zsh like this? I can always start the path with ./ and it works fine from there, but this is really bugging me big_smile

It bugged me enough to make a new user to test it, so my .zshrc is very simple:

autoload -U compinit
compinit

So please, tell me if I am mad or in fact have a zsh problem, however minor it may be big_smile

Last edited by pseup (2008-07-31 13:02:11)

Offline

#2 2008-07-31 12:51:32

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: [Solved] Zsh vs Bash basic tab functionality question.

With the default setup, <tab> don't completes folders/files unless it's executable, the fastest 'workaround' is:

./s/c/m<tab> -> ./scripts/common/myscript.sh
./s<tab> -> ./scripts/c<tab> -> ./scripts/common/m<tab> -> ./scripts/common/myscript.sh

Last edited by Mr.Elendig (2008-07-31 12:55:00)


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#3 2008-07-31 13:01:14

pseup
Member
Registered: 2008-06-06
Posts: 103

Re: [Solved] Zsh vs Bash basic tab functionality question.

Thank you! I'd assumed there wasn't a problem, my mind just insisted the bash method 'used' to work. Guess I'll just have to get used to hitting ./ more.

Last edited by pseup (2008-07-31 13:01:26)

Offline

#4 2008-07-31 13:15:17

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: [Solved] Zsh vs Bash basic tab functionality question.

You can change it to complete files/folders too, but don't ask me how tongue
Anyway, I like the fact that it don't, since it don't clutter the completion when you want to run a command instead, and ofcause, if you e.g. type ls <tab> then it will complete files/folders without the need for ./


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

Board footer

Powered by FluxBB