[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mutt-dev
Subject:    Re: xterm title (What should go into 1.5.7?)
From:       David Champion <dgc () uchicago ! edu>
Date:       2005-01-28 16:59:14
Message-ID: 20050128165914.GB9233 () monkey ! uchicago ! edu
[Download RAW message or body]

* On 2005.01.28, in <20050128125026.GJ13946@raktajino.does-not-exist.org>,
*	"Thomas Roessler" <roessler@does-not-exist.org> wrote:
> 
> 2. Write a simple shell script that echos the necessary sequences,
> so I could say something like
> 
>         something -title ...
> 	something -icon ...
> 
> and get the appropriate sequences echoed (or nothing if this is on

I've had this function in my shell rc for ages. Feel free to take.
The ESC and BEL codes are just to keep it in printable ASCII, because
someone will always cut and paste.

This should be bourne-clean. I don't know whether the TERM list is
complete, but I assume it isn't since nobody makes terminal emulators
anymore, just new terminal types.

# Xterm-compatible terminals can name the title bar.
ESC=`echo @ | tr @ '\033'`
BEL=`echo @ | tr @ '\007'`
name_window_viscera () {
	case "$TERM" in
		dtterm|screen*|xterm*|vt??|vt???) echo "${ESC}]0;$@${BEL}" ;;
	esac
}

name_window () {
	if [ "$1" = - ] ; then
		read wintitle
	else
		wintitle="$@"
	fi
	name_window_viscera "$wintitle"
}

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic