screen-users
[Top][All Lists]
Advanced

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

Re: [PATCH] Improvement to switch between windows


From: Guillermo E. Martinez
Subject: Re: [PATCH] Improvement to switch between windows
Date: Fri, 2 Sep 2022 17:39:38 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.1.2


Hello David,

Thanks so much for your comments, and sorry for late reply.

On 6/30/22 20:52, david kerns wrote:
I would recommend you check for an exact match first, then if that fails, try 
the partial.

hmmm, I think that is already done in the lines above:

           if (!strcmp(p->w_title, s))
             return p;

On Thu, Jun 30, 2022 at 5:51 PM Guillermo E. Martinez <guillermo.e.martinez@oracle.com 
<mailto:guillermo.e.martinez@oracle.com>> wrote:

    Hello GNU screen developers!

    This patch could help to move beetween screen windows. WDYT?

    Thanks in advance!,
    guillermo
    ---

    This patch is meant to use a partial string to refer a screen windows
    name to switch between windows, doing so is useful if you just remember
    a word or letters of the windows name for that you want to switch using
    the standard input methods/short cuts

             * src/process.c (WindowByName): Use of `strstr' to looks for
             a string in `w_title' field.

    Signed-off-by: Guillermo E. Martinez <guillermo.e.martinez@oracle.com 
<mailto:guillermo.e.martinez@oracle.com>>
    ---
      src/process.c | 2 +-
      1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/src/process.c b/src/process.c
    index 004b22a..6bd1f0d 100644
    --- a/src/process.c
    +++ b/src/process.c
    @@ -5116,7 +5116,7 @@ char *s;
          if (!strcmp(p->w_title, s))
            return p;
        for (p = windows; p; p = p->w_next)
    -    if (!strncmp(p->w_title, s, strlen(s)))
    +    if (strstr(p->w_title, s))
            return p;
        return 0;
      }
-- 2.35.1


Kind Regards,
guillermo


reply via email to

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