[nycbug-talk] PROMPT_COMMAND in zsh?
George Georgalis
george
Sun Jun 26 20:05:08 EDT 2005
On Sun, Jun 26, 2005 at 05:22:58PM -0400, George Georgalis wrote:
>I'm trying to find a "bash PROMPT_COMMAND" equivalant for zsh,
then answers own question...
zsh uses functions...
# If this is an xterm set the title to user at host:dir
case $TERM in
xterm*)
chpwd () { echo -en "\033]0;$(print -P "$USER@%m:%~")\007" ;} # oddly %h expands like %!
;;
*)
;;
esac
maybe there is a way to make print work like echo -en, or to have print
-P properly expand %h, but I'm not sure...
// George
--
George Georgalis, systems architect, administrator Linux BSD IXOYE
http://galis.org/george/ cell:646-331-2027 mailto:george at galis.org
More information about the talk
mailing list