I caught this off the "ssh in new screen window (Chris Henderson)" thread and it showed me how to add more formatting to the window list, but I don't understand the syntax completely.
Where is in the docs? windowlist string "(%3n) %{..g}[%{..Y}%t%{..g}]%{..g}%=%f" windowlist title "Num Name" How do the Num and Name in the title relate to the formatting string? Does this define 2 parameters and the "windowlist string" line defines the formatting? Where are Num and Name parameters defined? How would I add a third? Thanks, Bruce On Wed, Feb 25, 2009 at 9:00 AM, <screen-users-requ...@gnu.org> wrote: > Send screen-users mailing list submissions to > screen-users@gnu.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://lists.gnu.org/mailman/listinfo/screen-users > or, via email, send a message with subject or body 'help' to > screen-users-requ...@gnu.org > > You can reach the person managing the list at > screen-users-ow...@gnu.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of screen-users digest..." > > > Today's Topics: > > 1. Re: ssh in new screen window (Chris Henderson) > 2. Re: ssh in new screen window (Ken Nakamura) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 24 Feb 2009 11:51:01 -0800 > From: Chris Henderson <henders...@gmail.com> > Subject: Re: ssh in new screen window > To: Andy Harrison <aharri...@gmail.com> > Cc: Screen Users <screen-users@gnu.org> > Message-ID: > <d4ee74cf0902241151t6bf323b6r1b8f730c077bd...@mail.gmail.com> > Content-Type: text/plain; charset=ISO-8859-1 > > On Tue, Feb 24, 2009 at 5:50 AM, Andy Harrison <aharri...@gmail.com> > wrote: > > On Tue, Feb 24, 2009 at 12:43 AM, Chris Henderson <henders...@gmail.com> > wrote: > >> When I SSH to a server, I would like screen to open that SSH > >> connection in a new window and (re)name that window as that server's > >> name. I have seen this done somewhere before using hardstatus but I > >> don't have that config. > > > > > > Here's how I prefer to do it. I use ^A e to turn on the caption line, > > ^A E to shut it off. > > > > > > windowlist string "(%3n) %{..g}[%{..Y}%t%{..g}]%{..g}%=%f" > > windowlist title "Num Name" > > bind E caption splitonly "%{= Bw} (%2n) %{..g}[%{..Y}%t%{..g}] %{> h}" > > bind e caption always "%{= Bw} (%2n) %{..g}[%{..Y}%t%{..g}] %{> h}" > > > > > > Then I have a menu script that essentially does things like this: > > > > screen -t foo.example.com ssh foo.example.com > > Thanks. > > I have put the following in my .bashrc and it's giving me exactly what I > want. > > ssh() { screen -t "${1...@}" ssh "$@"; } > > BTW, I have ~/.ssh/config file setup with ssh keys and all the options > I need so in > the (bash) prompt all I do is type: ssh <servername> and I get a new screen > window with <servername> as the title. > > Out of curiosity: would anyone know what these "${1...@}" ssh "$@"; means? > > Thanks again. > > > > > ------------------------------ > > Message: 2 > Date: Tue, 24 Feb 2009 12:08:37 -0800 > From: Ken Nakamura <knaka...@tripwire.com> > Subject: Re: ssh in new screen window > To: Screen Users <screen-users@gnu.org> > Message-ID: > <c5c993c5.15d6%knaka...@tripwire.com<c5c993c5.15d6%25knaka...@tripwire.com> > > > Content-Type: text/plain; charset="US-ASCII" > > On 2/24/09 11:51 AM, "Chris Henderson" <henders...@gmail.com> wrote: > > > Out of curiosity: would anyone know what these "${1...@}" ssh "$@"; > means? > > $@ is sh for the entire arg array, and ${1...@} is for "the first arg > string, removing up to and including the first '@' char". see the bash man > page section on parameter expansion. so 'ssh k...@yourhost.com' -> 'screen > -t "yourhost.com" ssh "k...@yourhost.com"'. of course, if you use > different > usernames, maybe you don't want to remove that. > > and also, this is pretty cool. i'm probably going to use it or some > variant, > thanks! > > -k > > > > > > > ------------------------------ > > _______________________________________________ > screen-users mailing list > screen-users@gnu.org > http://lists.gnu.org/mailman/listinfo/screen-users > > End of screen-users Digest, Vol 832, Issue 1 > ******************************************** >
_______________________________________________ screen-users mailing list screen-users@gnu.org http://lists.gnu.org/mailman/listinfo/screen-users