On Thu, Jan 13, 2011 at 12:46:55PM -0500, mbm329 wrote:
> Thanks for the reply.  I see what you mean, but I'm not quite sure
> this carries over to another server.

Indeed. I remember it from my "su -" binding which sets the title to the
hostname.

> When I SSH to another host, without any of the aforementioned PS1
> setting, I just see my window name set to "ssh".  So far as I can
> tell, in order to set the window name to the hostname, I need to send
> an escape sequence to the terminal, from that host in particular, so
> it will recognize what it should rename the window to (\033kVALUE\033,
> as you mentioned).  That is what I'm doing by setting the PS1
> variable.

See below for a possible solution.

> As for setting the window name to the command, I would tell screen
> what a prompt looked like with the "shelltitle" config directive, and
> it would extrapolate the command.  You made a good point that screen
> was too dumb to realize if the command was actually the _command_ and
> not some environment variable being set, terminal trash, or, in HPUX's
> case, just part of a really long commandline.

One of the reasons I switched in the beginning.

> From what I can tell, this may be outside the scope of tmux and
> perhaps needs to be something better suited for the local shell of the
> host I'm SSHing into.  There, the shell, can set that escape sequence
> to be whatever it deemed necessary and have the logic to strip out
> things like environment variables, interpreters, or other garbage.

With tmux_title, the title is static until it is changed again (centerim
does it itself if screen support is turned on; haven't seen any other
apps that do this) which is why I have sub-vim shells not set it to
blank. Because of this, it should be possible to just output the escape
sequence in the default shell's configuration file if an SSH session is
detected to set the user@host and it would stick. Just need to use #T
and #W in the status format string.

--Ben

------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to