]> code.delx.au - dotfiles/commitdiff
Fix Mutt set_xtitle to use terminfo
authorJames Bunton <jamesbunton@delx.net.au>
Fri, 6 Jun 2008 02:04:44 +0000 (12:04 +1000)
committerJames Bunton <jamesbunton@delx.net.au>
Fri, 6 Jun 2008 02:04:44 +0000 (12:04 +1000)
.mutt/set_xtitle

index 8bf63b1f207ab12c22982877ae0870f20b251898..a72d9b298f0973d2e321107efc775fc95d37667f 100755 (executable)
@@ -3,11 +3,9 @@
 # set status_format="mutt_xtitle 'xterm titlebar fmt' 'mutt status fmt'|"
 
 # Set the xterm title
-case "${TERM}" in
-xterm*|rxvt*|screen*)
-       echo -ne "\033]0;$1\007" > /dev/tty
-       ;;
-esac
+if tput hs || tput tsl &> /dev/null; then
+       (tput tsl; echo -n "$1"; tput fsl) > /dev/tty
+fi
 
 # Return the string unchanged
 echo "$2"