[Top][All Lists]

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

Re: How to set screenname automatically to hostname.

From: halonothing
Subject: Re: How to set screenname automatically to hostname.
Date: Sat, 23 Jan 2010 12:39:43 -0800 (PST)

Jostein Berntsen wrote:
> This blog post discusses how to achieve that:
> - Jostein

Almost have it working... The only thing i'm noticing is that when I (Ctrl+a
c) to make a new screen, it seems to be parsing the hostname of the box
screen is running on, rather than parsing the hostname of the server I ssh
to shortly after making the screen. Does that make sense?  In other words,
all of the screen title names are the name of the local hostname.  I want to
be able to ssh to another server and have it change my screen title to the
host I've connected to. Any input? 


p.s. here's the relevant parts of my screenrc, and my PS1 in .bashrc

export PS1='address@hidden \w \$ '


# The vt100 description does not mention "dl". *sigh*
termcapinfo vt100 dl=5\E[M

# turn sending of screen messages to hardstatus off
hardstatus off
# Set the hardstatus prop on gui terms to set the titlebar/icon title
termcapinfo xterm*|rxvt*|kterm*|Eterm* hs:ts=\E]0;:fs=\007:ds=\E]0;\007
# use this for the hard status string
#hardstatus string "%h%? users: %u%?"
shelltitle '@|'
hardstatus alwayslastline
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f
%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %d/%m %{W}%c %{g}]'

# set these terminals up to be 'optimal' instead of vt100
termcapinfo xterm*|linux*|rxvt*|Eterm* OP

# Change the xterm initialization string from is2=\E[!p\E[?3;4l\E[4l\E>
# (This fixes the "Aborted because of window size change" konsole symptoms
#  in bug #134198)
termcapinfo xterm 'is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l'

# To get screen to add lines to xterm's scrollback buffer, uncomment the
# following termcapinfo line which tells xterm to use the normal screen
# (which has scrollback), not the alternate screen buffer.
#termcapinfo xterm|xterms|xs|rxvt ti@:te@


# Example of automatically running some programs in windows on screen
#   The following will open top in the first window, an ssh session to
#   in the next window, and then open mutt and tail in windows 8 and 9
#   respectively.
# caption always "%?%F%{-b bc}%:%{-b bb}%?%C|%D|%M %d|%H%?%F%{+u wb}%?
%L=%-Lw%45>%{+b by}%n%f*%t%{-}%+Lw%-0<"
# caption always "%?%F%{-b kr}%:%{-b rr}%?%C|%D|%M %d|%H%?%F%{+u wk}%?
%L=%-Lw%45>%{+b wr}%n%f*%t%{-}%+Lw%-0<"

View this message in context:
Sent from the Gnu - Screen mailing list archive at

reply via email to

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