diff options
author | Thomas Adam <thomas@xteddy.org> | 2019-06-20 23:02:28 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2019-06-20 23:02:28 +0100 |
commit | 70775b3c28ab75ec295e08fd9c8c50ab0f7d1233 (patch) | |
tree | d1ba9e9575f809bd2cad35644d8d9fd6044eb36d | |
parent | c4a92e57993f3c45944428a6b7cf0a1be421d023 (diff) | |
parent | 1d8e545bc1cf9de10b718dc81b422edf81dabe07 (diff) | |
download | rtmux-70775b3c28ab75ec295e08fd9c8c50ab0f7d1233.tar.gz rtmux-70775b3c28ab75ec295e08fd9c8c50ab0f7d1233.tar.bz2 rtmux-70775b3c28ab75ec295e08fd9c8c50ab0f7d1233.zip |
Merge branch 'obsd-master'
-rw-r--r-- | cmd-find-window.c | 81 | ||||
-rw-r--r-- | server-client.c | 5 | ||||
-rw-r--r-- | tmux.1 | 8 |
3 files changed, 63 insertions, 31 deletions
diff --git a/cmd-find-window.c b/cmd-find-window.c index c2d230a5..c29878b5 100644 --- a/cmd-find-window.c +++ b/cmd-find-window.c @@ -32,8 +32,8 @@ const struct cmd_entry cmd_find_window_entry = { .name = "find-window", .alias = "findw", - .args = { "CNt:TZ", 1, 1 }, - .usage = "[-CNTZ] " CMD_TARGET_PANE_USAGE " match-string", + .args = { "CNrt:TZ", 1, 1 }, + .usage = "[-CNrTZ] " CMD_TARGET_PANE_USAGE " match-string", .target = { 't', CMD_FIND_PANE, 0 }, @@ -57,30 +57,59 @@ cmd_find_window_exec(struct cmd *self, struct cmdq_item *item) if (!C && !N && !T) C = N = T = 1; - if (C && N && T) { - xasprintf(&filter, - "#{||:" - "#{C:%s},#{||:#{m:*%s*,#{window_name}}," - "#{m:*%s*,#{pane_title}}}}", - s, s, s); - } else if (C && N) { - xasprintf(&filter, - "#{||:#{C:%s},#{m:*%s*,#{window_name}}}", - s, s); - } else if (C && T) { - xasprintf(&filter, - "#{||:#{C:%s},#{m:*%s*,#{pane_title}}}", - s, s); - } else if (N && T) { - xasprintf(&filter, - "#{||:#{m:*%s*,#{window_name}},#{m:*%s*,#{pane_title}}}", - s, s); - } else if (C) - xasprintf(&filter, "#{C:%s}", s); - else if (N) - xasprintf(&filter, "#{m:*%s*,#{window_name}}", s); - else - xasprintf(&filter, "#{m:*%s*,#{pane_title}}", s); + if (!args_has(args, 'r')) { + if (C && N && T) { + xasprintf(&filter, + "#{||:" + "#{C:%s},#{||:#{m:*%s*,#{window_name}}," + "#{m:*%s*,#{pane_title}}}}", + s, s, s); + } else if (C && N) { + xasprintf(&filter, + "#{||:#{C:%s},#{m:*%s*,#{window_name}}}", + s, s); + } else if (C && T) { + xasprintf(&filter, + "#{||:#{C:%s},#{m:*%s*,#{pane_title}}}", + s, s); + } else if (N && T) { + xasprintf(&filter, + "#{||:#{m:*%s*,#{window_name}}," + "#{m:*%s*,#{pane_title}}}", + s, s); + } else if (C) + xasprintf(&filter, "#{C:%s}", s); + else if (N) + xasprintf(&filter, "#{m:*%s*,#{window_name}}", s); + else + xasprintf(&filter, "#{m:*%s*,#{pane_title}}", s); + } else { + if (C && N && T) { + xasprintf(&filter, + "#{||:" + "#{C/r:%s},#{||:#{m/r:%s,#{window_name}}," + "#{m/r:%s,#{pane_title}}}}", + s, s, s); + } else if (C && N) { + xasprintf(&filter, + "#{||:#{C/r:%s},#{m/r:%s,#{window_name}}}", + s, s); + } else if (C && T) { + xasprintf(&filter, + "#{||:#{C/r:%s},#{m/r:%s,#{pane_title}}}", + s, s); + } else if (N && T) { + xasprintf(&filter, + "#{||:#{m/r:%s,#{window_name}}," + "#{m/r:%s,#{pane_title}}}", + s, s); + } else if (C) + xasprintf(&filter, "#{C/r:%s}", s); + else if (N) + xasprintf(&filter, "#{m/r:%s,#{window_name}}", s); + else + xasprintf(&filter, "#{m/r:%s,#{pane_title}}", s); + } new_args = args_parse("", 1, &argv); if (args_has(args, 'Z')) diff --git a/server-client.c b/server-client.c index 0382b58f..da30ed83 100644 --- a/server-client.c +++ b/server-client.c @@ -1263,10 +1263,11 @@ server_client_loop(void) break; } TAILQ_FOREACH(wp, &w->panes, entry) { - if (wl != NULL && wp->fd != -1) { + if (wp->fd != -1) { if (focus) server_client_check_focus(wp); - server_client_check_resize(wp); + if (wl != NULL) + server_client_check_resize(wp); } wp->flags &= ~PANE_REDRAW; } @@ -1833,14 +1833,16 @@ With .Fl b , other commands are not blocked from running until the indicator is closed. .It Xo Ic find-window -.Op Fl CNTZ +.Op Fl rCNTZ .Op Fl t Ar target-pane .Ar match-string .Xc .D1 (alias: Ic findw ) -Search for the +Search for a .Xr fnmatch 3 -pattern +pattern or, with +.Fl r , +regular expression .Ar match-string in window names, titles, and visible content (but not history). The flags control matching behavior: |