screen-users
[Top][All Lists]
Advanced

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

windowlist string "(%3n) %{..g}[%{..Y}%t%{..g}]%{..g}%=%f"


From: Bruce Edge
Subject: windowlist string "(%3n) %{..g}[%{..Y}%t%{..g}]%{..g}%=%f"
Date: Wed, 25 Feb 2009 10:06:44 -0800

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, <address@hidden> wrote:
Send screen-users mailing list submissions to
       address@hidden

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
       address@hidden

You can reach the person managing the list at
       address@hidden

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 <address@hidden>
Subject: Re: ssh in new screen window
To: Andy Harrison <address@hidden>
Cc: Screen Users <address@hidden>
Message-ID:
       <address@hidden>
Content-Type: text/plain; charset=ISO-8859-1

On Tue, Feb 24, 2009 at 5:50 AM, Andy Harrison <address@hidden> wrote:
> On Tue, Feb 24, 2009 at 12:43 AM, Chris Henderson <address@hidden> 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 "address@hidden" 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 "address@hidden" ssh "$@"; means?

Thanks again.




------------------------------

Message: 2
Date: Tue, 24 Feb 2009 12:08:37 -0800
From: Ken Nakamura <address@hidden>
Subject: Re: ssh in new screen window
To: Screen Users <address@hidden>
Message-ID: <address@hidden>
Content-Type: text/plain; charset="US-ASCII"

On 2/24/09 11:51 AM, "Chris Henderson" <address@hidden> wrote:

> Out of curiosity: would anyone know what these "address@hidden" ssh "$@"; means?

$@ is sh for the entire arg array, and address@hidden 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 address@hidden' -> 'screen
-t "yourhost.com" ssh "address@hidden"'.  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
address@hidden
http://lists.gnu.org/mailman/listinfo/screen-users

End of screen-users Digest, Vol 832, Issue 1
********************************************


reply via email to

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