In a message dated: Fri, 28 Jan 2000 13:09:33 EST
Benjamin Scott said:
>Hello list,
>
> Does anyone here know how to get the currently running program name to show
>up in the title of your xterm windows? I don't mean using the "-T" or "-n"
>switches; I mean something that occurs for every command you run. So if, for
>example, I run a lengthy foreground job "foo", "foo" would appear in the xterm
>title bar. MS-Windoze does this.
>
> I swear I've seen this done on Unix. IIRC, it has something to do with a
>prompt or alias or something in the shell that echos a control code to the tty
>which xterm intercepts, or some similar magic. But before I go nuts trying to
>find it, I figured I'd ask here.
Yeah, I do it all the time, it's done via the shell, using escape commands:
For example, this is a ksh function I have that changes the title bar line:
#!/bin/ksh
xtitle () {
echo "^[]2;$*^G"
}
Then you can do something like:
$ xtitle "plussier@`hostname`"
Here's some ksh aliases I have:
alias resetX='echo "\\033]0;$U@$HN - ${PWD#\/home\/plussier/}\\007"'
alias iconX='echo "\\033]1;$U@$HN - ${PWD#\/home\/plussier/}\\007"'
alias titleX='echo "\\033]2;$U@$HN - ${PWD#\/home\/plussier/}\\007"'
HTH,
--
Seeya,
Paul
----
Doing something stupid always costs less (up front) than doing
something intelligent.
A conclusion is simply the place where you got tired of thinking.
If you're not having fun, you're not doing it right!
**********************************************************
To unsubscribe from this list, send mail to
[EMAIL PROTECTED] with the following text in the
*body* (*not* the subject line) of the letter:
unsubscribe gnhlug
**********************************************************