output asked headers in the order they were asked; avoid header name spoofing by...
[hband-tools.git] / user-tools / terminaltitle
blob5d90797e9c0e63b050a34974675e7c24b376fe38
1 #!/bin/bash
3 true <<EOF
4 =pod
6 =head1 NAME
8 terminaltitle - Set the current terminal's title string
10 =cut
12 EOF
15 title=$*
16 title_esc=${title//\\/\\\\}
18 case "$TERM" in
19 (xterm*|rxvt*|urxvt*)
20 echo -ne "\033]0;$title_esc\007"
22 (screen*)
23 echo -ne "\033k$title_esc\033\\"
25 (*)
26 echo "$0: not supported terminal $TERM" >&2
28 esac