[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Setting window title in ssh'ed host
From: |
Micah Cowan |
Subject: |
Re: Setting window title in ssh'ed host |
Date: |
Wed, 05 Nov 2008 22:50:31 -0800 |
User-agent: |
Thunderbird 2.0.0.17 (X11/20080925) |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Robin Lee Powell wrote:
> On Wed, Nov 05, 2008 at 02:39:13PM -0800, Micah Cowan wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> 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)\$ "
> #
> #####
I don't really see how that does what the thread's talking about;
namely, set the window title to the hostname that's connected by ssh.
Kinda cool about the :window:/OSC 83 command execution hack, though. I
was incredulous that those chacls actually did anything related to the
window title.
As previously mentioned in these threads (IIRC?), the problem with
prompt hacks is you don't always have control over the prompts in remote
shells (and even when you do, it's a bit of a pain to set up in every
host you ever visit).
- --
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer.
GNU Maintainer: wget, screen, teseq
http://micah.cowan.name/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkkSk7cACgkQ7M8hyUobTrHNwQCfT6xqxwNzPEwf7DeXfZu8paT+
LSIAn0Ft/obLm4TDFhBi2mzhHwg+SF5e
=omIc
-----END PGP SIGNATURE-----