screen-users
[Top][All Lists]
Advanced

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

Re: Is there a screen command to identify the current visible window num


From: 张小潘
Subject: Re: Is there a screen command to identify the current visible window number?
Date: Wed, 12 Sep 2018 11:14:06 -0700

Hi Neal and FLJ,

I noticed that the command "screen -S <target-session> -Q number" will not only print the current focused window number on the terminal running this command, but also pops up a message on the target screen session, and that popup message will block the target screen session to take any input for a few seconds. Is there a way that we can suppress that popup message?

Regards. 

On Wed, Sep 12, 2018 at 8:27 AM 张小潘 <address@hidden> wrote:
Great, "screen -S session -Q number" is exactly what I want.

Thanks to FLJ for the tip and yes, Neal's clarification about "focus" vs "visible" is correct, the thing I actually is the number of the window who has the focus now.

On Wed, Sep 12, 2018 at 7:48 AM Neal Fultz <address@hidden> wrote:
Also IIRC the number command gives the number of the process which has focus - if you use splits more than one may be visible, but only one has focus at a time.  

On Wed, Sep 12, 2018 at 5:52 AM FLJ <address@hidden> wrote:
Hello  Xiaopan,

perhaps I misunderstood, but at least on recent version of Ubuntu, Raspbian and OpenWrt you have:

 -Q   Some  commands now can be queried from a remote session using this
            flag, e.g.  "screen  -Q  windows".  The  commands  will  send  the
            response  to  the  stdout of the querying process. If there was an
            error in the command, then the querying process will exit  with  a
            non-zero status.

            The commands that can be queried now are:
             echo
             info
             lastmsg
             number
             select
             time
             title
             windows

$ screen -S pts -Q number
$ screen -S pts -Q windows


On Wed, Sep 12, 2018 at 5:34 AM 张小潘 <address@hidden> wrote:
Hi there,

In short:
If a screen session has multiple windows, does any one know how to tell the number of the current visible window?

In long:
As I explained in this thread, I have two monitors running two screen sessions, and a vim window in one and bash in the other, and I am using screen '-X stuff' command to send shell commands from the vim window to the bash window to execute them. Because the screen session in which the bash lives might have multiple windows, I want to make sure the bash window receiving commands is visible and if it is not, explicitly switch to that by selecting them. However, if a window is already selected, selecting it again causing an annoying message box and a pause in the screen display, so I want to avoid selecting already selected window. I know the window number where the bash runs, but how can I get the current visible window number?

Regards.

--
Xiaopan Zhang - (张小潘)
_______________________________________________
screen-users mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/screen-users
_______________________________________________
screen-users mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/screen-users


--
Xiaopan Zhang - (张小潘)


--
Xiaopan Zhang - (张小潘)

reply via email to

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