[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: OT: jobname xterm title in bash?



Hi Lance,

On Tue, Aug 20, 2002 at 07:30:24PM -0500, Lance Simmons wrote:
> Make sure your PS1 doesn't have any xterm commands in it, and do the
> same for PROMPT_COMMAND. (Sorry, I should have mentioned
> PROMPT_COMMAND.) Then just add those two lines to your .bashrc.  The
> easiest way is to comment out your PS1 and PROMPT_COMMAND entirely, add
> the new lines at the end of .bashrc, and see if it works. Then re-write
> your (non-xterm) PS1 to be whatever you want. You don't any longer need
> an xterm-specific PS1.

I changed my ~/.bashrc to include nothing but

xtitle() { echo -ne "\\E]2\;$1\\a"; }
trap 'xtitle "[$(history 1 | cut -b 8-38)]"' DEBUG

And then opened a new session.  I get the default Debian prompt and just
my hostname in the xterm title bar.  When I type a command, say 'ls', I
get

lbarbuto@juno:~$ ls
;[ls]bashrc.old  bin  debs  doc  etc  mail  src  tmp

But the xterm title bar doesn't change.  Any idea what I'm doing wrong?
It also beeps each time I type a command.

> Remember, it has to be bash 2.05b.

Yep, 'tis.

GNU bash, version 2.05b.0(2)-release (i386-pc-linux-gnu)Copyright (C)
2002 Free Software Foundation, Inc.

Regards,

Lucas



Reply to: