Re: OT: jobname xterm title in bash?
On Wed, Aug 21, 2002 at 10:16:24AM +1000, Lucas Barbuto wrote:
>
> On Tue, Aug 20, 2002 at 05:20:15PM -0500, Lance Simmons wrote:
> > xtitle() { echo -ne "\\E]2\;$1 $HOSTNAME\\a"; }
> > trap 'xtitle "[$(history 1 | cut -b 8-38)]"' DEBUG
>
> I assume this goes in ~/.bashrc, do I need to include it in a
> PROMPT_COMMAND or PS1 statement?
No.
> I've tried a couple of things and managed to get the current command
> to echo to the terminal but not into the title bar. I'm stuck.
> Anyone?
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.
Remember, it has to be bash 2.05b.
--
.~.
/V\ Lance Simmons
/( )\ lance@lsimmons.net
^^-^^
Reply to: