termtitle Script
#!/bin/sh
# termtitle.sh: Sets terminal title to argument
# Note: ^[ = "Ctrl-v" then "Esc"
# Note: ^G = "Ctrl-v" then "Ctrl-g"
if [ $# -ge 1 ]; then
case "$TERM" in
xterm | dtterm)
if [ `uname` = "SunOS" ]; then
echo "^[]0;$1^G"
else
echo -n "^[]0;$1^G"
fi
;;
iris-ansi )
# winterm has different escape sequences
# This sets the window title
echo -n "^[P1.y$1^[\\"
# This sets the icon title
echo -n "^[P3.y$^[\\"
;;
esac
fi
page revision: 2, last edited: 25 Aug 2011 06:31