Re: OT: jobname xterm title in bash?
On Tue, Aug 20, 2002 at 04:45:27PM -0600, Bob Proulx wrote:
> Lance Simmons <lance@lsimmons.net> [2002-08-20 17:20:15 -0500]:
> >
> > As it turns out, it _is_ possible to do this. In an email, Paul Jarc
> > explained how to do it. I've modified his suggestion. Use at least
> > bash 2.05b, and make sure PS1 doesn't have any xterm commands in it:
> >
> > xtitle() { echo -ne "\\E]2\;$1 $HOSTNAME\\a"; } trap 'xtitle
> > "[$(history 1 | cut -b 8-38)]"' DEBUG
> >
> > This puts
> >
> > "[first 30 characters of current command] $HOSTNAME"
> >
> > in your xterm title! _Very_ cool!
>
> Doesn't the DEBUG trap only operate after the command?
I'm running mutt _right now_, and my xterm says
"[mutt]<my-machine-name>"
So it seems it doesn't need to command to have been completed. This only
works on bash 2.05b.
--
.~.
/V\ Lance Simmons
/( )\ lance@lsimmons.net
^^-^^
Reply to: