[Top][All Lists]

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

Re: Dynamic Title

From: Michael Grant
Subject: Re: Dynamic Title
Date: Mon, 1 Jun 2009 08:49:55 +0200

On Mon, Jun 1, 2009 at 05:47, Asif Iqbal <address@hidden> wrote:
> On Thu, May 28, 2009 at 5:25 PM, Alan Young <address@hidden> wrote:
>> On Wed, May 27, 2009 at 20:17, Asif Iqbal <address@hidden> wrote:
>>> How do I change the title of a screen window (tab) dynamically, to
>>> match the hostname I ssh to ?

I do this as follows:

in .screenrc: hardstatus lastline

in .bashrc: export PS1='[\$\!] \[ESC_\H \wESC\\\]'
where ESC is an escape character.

This makes my prompt look like [$123] and puts the machine name and
current working dir in the status line.  It also (at least on windows)
puts the machine named into the title bar of the window.

You need the \[ and \] to tell bash not to count those characters as
being displayed on the line, otherwise, it messes up the display when
you start wrapping long input lines.

ESC_ gets you into the status line and ESC\ gets out out.

Is that what you're looking for?

Michael Grant

reply via email to

[Prev in Thread] Current Thread [Next in Thread]