program title in gnome-terminal

James Butler sweetnavelorange at gmail.com
Sun Jun 21 02:46:13 UTC 2009


On 2009-06-21, Joe Marcus Clarke <marcus at marcuscom.com> wrote:
> On Mon, 2009-06-15 at 16:50 +0200, Marco Beishuizen wrote:
>> Hi,
>>
>> Whenever I run a program in gnome-terminal, it doesn't display the program
>>
>> name in the title bar automatically (it says "Terminal" only). I always
>> have to set the title by hand. Is there a way that this can be done
>> automatically, so that the title says for example "Alpine - Terminal",
>> instead of "Terminal" only.
>
> There are lot of hits on Google about dynamically settign the
> gnome-terminal title, but none that I found were specific to tracking
> the running program.  I think this needs to be built into the program
> being run.  For example, I know vim can do this, and does.

If you're using [t]csh, you can put something like this in your .chsrc:

if ( $TERM =~ xterm* ) then
  alias postcmd 'printf "\033]\;\!#\033\\"'
  alias precmd 'printf "\033]\;$PWD\033\\"'
endif

Unfortunately this is maybe the only good thing about tcsh. If bash
has something similar, I can't find it in the manpage.

-James


More information about the freebsd-gnome mailing list