[PATCH] Improvement to switch between windows
"Guillermo E. Martinez" <[email protected]> Fri, 2 Sep 2022 19:01:00 -0500
| Newsgroups | gmane.comp.gnu.screen.user |
|---|---|
| Message-ID | <[email protected]> |
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 <[email protected]> --- src/process.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/process.c b/src/process.c index 004b22a..1104c58 100644 --- a/src/process.c +++ b/src/process.c @@ -5118,6 +5118,9 @@ char *s; for (p = windows; p; p = p->w_next) if (!strncmp(p->w_title, s, strlen(s))) return p; + for (p = windows; p; p = p->w_next) + if (strstr(p->w_title, s)) + return p; return 0; } -- 2.35.1