Merge branch 'obsd-master'

This commit is contained in:
Thomas Adam 2019-06-20 23:02:28 +01:00
commit 70775b3c28
3 changed files with 63 additions and 31 deletions

View File

@ -32,8 +32,8 @@ const struct cmd_entry cmd_find_window_entry = {
.name = "find-window", .name = "find-window",
.alias = "findw", .alias = "findw",
.args = { "CNt:TZ", 1, 1 }, .args = { "CNrt:TZ", 1, 1 },
.usage = "[-CNTZ] " CMD_TARGET_PANE_USAGE " match-string", .usage = "[-CNrTZ] " CMD_TARGET_PANE_USAGE " match-string",
.target = { 't', CMD_FIND_PANE, 0 }, .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) if (!C && !N && !T)
C = N = T = 1; C = N = T = 1;
if (C && N && T) { if (!args_has(args, 'r')) {
xasprintf(&filter, if (C && N && T) {
"#{||:" xasprintf(&filter,
"#{C:%s},#{||:#{m:*%s*,#{window_name}}," "#{||:"
"#{m:*%s*,#{pane_title}}}}", "#{C:%s},#{||:#{m:*%s*,#{window_name}},"
s, s, s); "#{m:*%s*,#{pane_title}}}}",
} else if (C && N) { s, s, s);
xasprintf(&filter, } else if (C && N) {
"#{||:#{C:%s},#{m:*%s*,#{window_name}}}", xasprintf(&filter,
s, s); "#{||:#{C:%s},#{m:*%s*,#{window_name}}}",
} else if (C && T) { s, s);
xasprintf(&filter, } else if (C && T) {
"#{||:#{C:%s},#{m:*%s*,#{pane_title}}}", xasprintf(&filter,
s, s); "#{||:#{C:%s},#{m:*%s*,#{pane_title}}}",
} else if (N && T) { s, s);
xasprintf(&filter, } else if (N && T) {
"#{||:#{m:*%s*,#{window_name}},#{m:*%s*,#{pane_title}}}", xasprintf(&filter,
s, s); "#{||:#{m:*%s*,#{window_name}},"
} else if (C) "#{m:*%s*,#{pane_title}}}",
xasprintf(&filter, "#{C:%s}", s); s, s);
else if (N) } else if (C)
xasprintf(&filter, "#{m:*%s*,#{window_name}}", s); xasprintf(&filter, "#{C:%s}", s);
else else if (N)
xasprintf(&filter, "#{m:*%s*,#{pane_title}}", s); 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); new_args = args_parse("", 1, &argv);
if (args_has(args, 'Z')) if (args_has(args, 'Z'))

View File

@ -1263,10 +1263,11 @@ server_client_loop(void)
break; break;
} }
TAILQ_FOREACH(wp, &w->panes, entry) { TAILQ_FOREACH(wp, &w->panes, entry) {
if (wl != NULL && wp->fd != -1) { if (wp->fd != -1) {
if (focus) if (focus)
server_client_check_focus(wp); server_client_check_focus(wp);
server_client_check_resize(wp); if (wl != NULL)
server_client_check_resize(wp);
} }
wp->flags &= ~PANE_REDRAW; wp->flags &= ~PANE_REDRAW;
} }

8
tmux.1
View File

@ -1833,14 +1833,16 @@ With
.Fl b , .Fl b ,
other commands are not blocked from running until the indicator is closed. other commands are not blocked from running until the indicator is closed.
.It Xo Ic find-window .It Xo Ic find-window
.Op Fl CNTZ .Op Fl rCNTZ
.Op Fl t Ar target-pane .Op Fl t Ar target-pane
.Ar match-string .Ar match-string
.Xc .Xc
.D1 (alias: Ic findw ) .D1 (alias: Ic findw )
Search for the Search for a
.Xr fnmatch 3 .Xr fnmatch 3
pattern pattern or, with
.Fl r ,
regular expression
.Ar match-string .Ar match-string
in window names, titles, and visible content (but not history). in window names, titles, and visible content (but not history).
The flags control matching behavior: The flags control matching behavior: