Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as text by EdelweiS ( 19 years ago )
function title {
if [[ $TERM == "screen" ]]; then
# Use these two for GNU Screen:
print -nR $' 33k'$1$' 33'
print -nR $' 33]0;'$2$''
elif [[ $TERM == "xterm" || $TERM == "rxvt" ]]; then
# Use this one instead for XTerms:
print -nR $' 33]0;'$*$''
fi
}
function precmd { title zsh "$PWD" }
function preexec {
emulate -L zsh
local -a cmd; cmd=(${(z)1})
title $cmd[1]:t "$cmd[2,-1]"
}
Revise this Paste