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
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License