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

Tilde (%~) prompt expansion inconsistent with named directories?



After starting up zsh, if I cd into another home folder, it prints out the full path. If I then do "cd ~<tab>", it starts printing out the named directory for the home folder.

For example:

$ cd /home/ftp
$ print -P '%~'
/home/ftp
$ cd ~<tab>
$ print -P '%~'
~ftp

I'm guessing this has to do with the named directory cache not being populated. Shouldn't the expansion of %~ populate it automatically?

Also, how is a directory determined to be named in prompt expansion? If I run "cd ~www-data", "print -P '%~'" prints /var/www instead of ~www-data. I actually prefer this behavior, but I'm wondering how zsh makes the distinction in that case.



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