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

Re: howto avoid ~irc in %~ ?



On Jun 14,  1:16pm, Andy Spiegl wrote:
} 
} I use %~ in my prompt [but then] when I change to
}  /var/www
} my prompt is:
}  machine:~irc/www>

Zsh doesn't do this all by itself.  You must at some point have used ~irc
before zsh would add an entry for irc to its hash table of named dirs.

E.g. starting from `zsh -f':

zagzig% cd /home/ftp
zagzig% pwd
/home/ftp
zagzig% print -P %~
/home/ftp

But:

zagzig% cd ~ftp
zagzig% pwd
/home/ftp
zagzig% print -P %~
~ftp

So if you don't want zsh to use the abbreviations, don't use them yourself.

Zsh does have a rule that it won't show the tilde-form if the real name of
the directory is shorter, but in the case of ~irc and /var they happen to
be exactly the same length.

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

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



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