[Top][All Lists]

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

Re: Setting window title in ssh'ed host

From: Robin Lee Powell
Subject: Re: Setting window title in ssh'ed host
Date: Wed, 5 Nov 2008 22:13:43 -0800
User-agent: Mutt/1.5.18 (2008-05-17)

On Wed, Nov 05, 2008 at 02:39:13PM -0800, Micah Cowan wrote:
> Hash: SHA1
> Gokdeniz Karadag wrote:
> > Hi,
> > 
> > This is more like a story, I am trying to  automatically set
> > "GNU screen window title" equal to the hostname that is
> > connected by ssh.
> This has been a recurring need, solved in various ways.

I've solved it by prompt hacking; here's the relevant bits from my
.screenrc at work:

# Magic to make PS1 goodness work
hardstatus off
hardstatus string "%t"
chacl :window: -rwx #?
chacl :window: +x title

# With this setup, you can change the current window's title by
# sending an ANSI escape sequence; this will change the window's
# title and the title will show up in the hardstatus line (i.e. the
# title bar in PuTTY).  This sets the title to the current host
# name.  The actual prompt is the hostname followed by $ for bash or
# %# for zsh, which is magic that shows either # if you're root or %
# if you're not.
# zsh: PS1="$(echo -e '%{\033]83;title '$(uname -n)'\007%}%m%# ')"
# bash: PS1="\[\033]83;title $(uname -n)\a\]$(uname -n)\$ "


They say:  "The first AIs will be built by the military as weapons."
And I'm thinking:  "Does it even occur to you to try for something
other than the default outcome?" -- ***

reply via email to

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