tiel xterm in ssh sessions

James Butler sweetnavelorange at gmail.com
Tue May 4 22:18:22 UTC 2010


On 05/05/10 02:00, Alex Huth wrote:
> Hello!
>
> I´d like to set the titel of a gnome-terminal dynamic, even when it is a
> ssh session. For the "normal" local session i use the following:
>
> ---------------
> if echo $TERM | egrep -iq 'xterm|vt100'; then
>          PS1='\[\033]0;\h:\w\$\007\]'$PS1
> fi
> --------------
>
> But how can i do that for ssh sessions, with the name of the remote
> host?

I can think of two ways:
a) make sure you have something similar to the above in the shell rc 
file on each remote host, or
b) use something like this on the local host:

ssh() {
	_ssh="/usr/bin/ssh"
	printf "\033]0;$*\007"
	$_ssh $*
}

-James

>
> Thanks in advance
>
> Alex
>
>
> _______________________________________________
> freebsd-gnome at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-gnome
> To unsubscribe, send any mail to "freebsd-gnome-unsubscribe at freebsd.org"



More information about the freebsd-gnome mailing list