Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: cdablevars and cd completion in 3.1.5



On Dec 1, 10:55am, Sweth Chandramouli wrote:
} Subject: Re: cdablevars and cd completion in 3.1.5
}
} > (the difference being that the 3.0.5 completion returns directories that
} > begin with a "." anytime there are no other matching directories, whereas
} > the -/ completion always requires that the "." be explicitly typed).
} 
} 	i'm running 3.1.4, with "compctl -g '*(-/)' cd pushd", and i
} get tab completion on all matching directories, including ones with
} dot-prefixes, even if not explicitly typed... i just checked, and i
} get the same behaviour with just "compctl -/ cd pushd".

It sounds like you have the globdots option set.

} the manpage
} for zshcompctl describes the -/ flag as completing "Just filesystem
} paths"; what about that would imply that dot-prefixes should not be
} included?

Nothing except that dot-prefixed files are traditionally hidden from
globbing and ls and so forth, so -/ continues the trend.

} is the behaviour you describe a change in 3.1.5?

It's not a behavior change.

} > zsh% cd HE
} >          ^
} > 	 With cursor here, this calls cdmatch and completes HOME/.
} > zsh% cd HOME/zn
} >               ^
} > 	      with the cursor here, I can complete to HOME/zshfun.
} 
} 	at first, i assumed you meant $HOME and not just HOME.  some
} further checking, however, shows that zsh seems to do a check of
} environment variables if you try to cd to a directory that is not in
} your path and not a named directory, and if it finds a matching env.
} var., it implicitly names the corresponding directory:

Any variable whose value begins with a / character, not just environment
variables; but only if you have the cdablevars option set, which it seems
you do.

} 	my tab-completion doesn't work at all against named directories
} unless i've explicitly prefixed them with a ~ (e.g. "cd ~sw<TAB>" to
} get "cd sweth", vs. "cd sw<TAB>", which does nothing)

That's correct; the whole point of my posting was to cause completion
to work even without the leading tilde, just for people who want to
use cdablevars.  I admit it's probably not all that widely useful.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



Messages sorted by: Reverse Date, Date, Thread, Author