Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Jan 2008 10:53:04 +0200
From:      Nikos Vassiliadis <nvass@teledomenet.gr>
To:        freebsd-questions@freebsd.org
Cc:        Matiss <move@inbox.lv>
Subject:   Re: Which environment variable?
Message-ID:  <200801141053.05543.nvass@teledomenet.gr>
In-Reply-To: <1200296141.478b10cd53c0f@www.inbox.lv>
References:  <1200296141.478b10cd53c0f@www.inbox.lv>

next in thread | previous in thread | raw e-mail | index | archive | help
On Monday 14 January 2008 09:35:41 Matiss wrote:
> Is there such environment variable, which changes window title for
> putty?

No there is no such variable, that I am aware of.
You just have to send some control characters to the terminal to
change its title. How to send these characters really depends on
your shell.

> How do I change that title to let's say server name for my shell?

You could use something like this in your ~/.bash_profile if you
use bash.

echo -en "\033]0;`hostname`\007"

The above sends:
1) ASCII \033
2) ]
3) 0
4) ;
5) the_hostname
6) ASCII \007

The idea is that you should initiliaze the xterm's title at login
time. Check the page below for your favorite shell. There are even
two workaround in Perl and C in case your shell has no easy way to
send the control characters.

http://tldp.org/HOWTO/text/Xterm-Title

HTH, Nikos



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200801141053.05543.nvass>