set terminal heading regardless of where we are
This commit is contained in:
parent
372c6bfb13
commit
e978a3017c
1 changed files with 20 additions and 0 deletions
20
.zsh/window.zsh
Normal file
20
.zsh/window.zsh
Normal file
|
@ -0,0 +1,20 @@
|
|||
|
||||
# From http://dotfiles.org/~_why/.zshrc
|
||||
# Sets the window title nicely no matter where you are
|
||||
function title() {
|
||||
# escape '%' chars in $1, make nonprintables visible
|
||||
a=${(V)1//\%/\%\%}
|
||||
|
||||
# Truncate command, and join lines.
|
||||
a=$(print -Pn "%40>...>$a" | tr -d "\n")
|
||||
|
||||
case $TERM in
|
||||
screen)
|
||||
print -Pn "\ek$a:$3\e\\" # screen title (in ^A")
|
||||
;;
|
||||
xterm*|rxvt)
|
||||
print -Pn "\e]2;$2\a" # plain xterm title ($3 for pwd)
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue