mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 01:34:18 +00:00 
			
		
		
		
	Merge branch 'obsd-master'
This commit is contained in:
		@@ -32,8 +32,8 @@ const struct cmd_entry cmd_find_window_entry = {
 | 
				
			|||||||
	.name = "find-window",
 | 
						.name = "find-window",
 | 
				
			||||||
	.alias = "findw",
 | 
						.alias = "findw",
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	.args = { "CNrt:TZ", 1, 1 },
 | 
						.args = { "CiNrt:TZ", 1, 1 },
 | 
				
			||||||
	.usage = "[-CNrTZ] " CMD_TARGET_PANE_USAGE " match-string",
 | 
						.usage = "[-CiNrTZ] " CMD_TARGET_PANE_USAGE " match-string",
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	.target = { 't', CMD_FIND_PANE, 0 },
 | 
						.target = { 't', CMD_FIND_PANE, 0 },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -47,7 +47,7 @@ cmd_find_window_exec(struct cmd *self, struct cmdq_item *item)
 | 
				
			|||||||
	struct args		*args = cmd_get_args(self), *new_args;
 | 
						struct args		*args = cmd_get_args(self), *new_args;
 | 
				
			||||||
	struct cmd_find_state	*target = cmdq_get_target(item);
 | 
						struct cmd_find_state	*target = cmdq_get_target(item);
 | 
				
			||||||
	struct window_pane	*wp = target->wp;
 | 
						struct window_pane	*wp = target->wp;
 | 
				
			||||||
	const char		*s = args->argv[0];
 | 
						const char		*s = args->argv[0], *suffix = "";
 | 
				
			||||||
	char			*filter, *argv = { NULL };
 | 
						char			*filter, *argv = { NULL };
 | 
				
			||||||
	int			 C, N, T;
 | 
						int			 C, N, T;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -55,62 +55,41 @@ cmd_find_window_exec(struct cmd *self, struct cmdq_item *item)
 | 
				
			|||||||
	N = args_has(args, 'N');
 | 
						N = args_has(args, 'N');
 | 
				
			||||||
	T = args_has(args, 'T');
 | 
						T = args_has(args, 'T');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (args_has(args, 'r') && args_has(args, 'i'))
 | 
				
			||||||
 | 
							suffix = "/ri";
 | 
				
			||||||
 | 
						else if (args_has(args, 'r'))
 | 
				
			||||||
 | 
							suffix = "/r";
 | 
				
			||||||
 | 
						else if (args_has(args, 'i'))
 | 
				
			||||||
 | 
							suffix = "/i";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (!C && !N && !T)
 | 
						if (!C && !N && !T)
 | 
				
			||||||
		C = N = T = 1;
 | 
							C = N = T = 1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (!args_has(args, 'r')) {
 | 
					 | 
				
			||||||
	if (C && N && T) {
 | 
						if (C && N && T) {
 | 
				
			||||||
		xasprintf(&filter,
 | 
							xasprintf(&filter,
 | 
				
			||||||
		    "#{||:"
 | 
							    "#{||:"
 | 
				
			||||||
			    "#{C:%s},#{||:#{m:*%s*,#{window_name}},"
 | 
							    "#{C%s:%s},#{||:#{m%s:*%s*,#{window_name}},"
 | 
				
			||||||
			    "#{m:*%s*,#{pane_title}}}}",
 | 
							    "#{m%s:*%s*,#{pane_title}}}}",
 | 
				
			||||||
			    s, s, s);
 | 
							    suffix, s, suffix, s, suffix, s);
 | 
				
			||||||
	} else if (C && N) {
 | 
						} else if (C && N) {
 | 
				
			||||||
		xasprintf(&filter,
 | 
							xasprintf(&filter,
 | 
				
			||||||
			    "#{||:#{C:%s},#{m:*%s*,#{window_name}}}",
 | 
							    "#{||:#{C%s:%s},#{m%s:*%s*,#{window_name}}}",
 | 
				
			||||||
			    s, s);
 | 
							    suffix, s, suffix, s);
 | 
				
			||||||
	} else if (C && T) {
 | 
						} else if (C && T) {
 | 
				
			||||||
		xasprintf(&filter,
 | 
							xasprintf(&filter,
 | 
				
			||||||
			    "#{||:#{C:%s},#{m:*%s*,#{pane_title}}}",
 | 
							    "#{||:#{C%s:%s},#{m%s:*%s*,#{pane_title}}}",
 | 
				
			||||||
			    s, s);
 | 
							    suffix, s, suffix, s);
 | 
				
			||||||
	} else if (N && T) {
 | 
						} else if (N && T) {
 | 
				
			||||||
		xasprintf(&filter,
 | 
							xasprintf(&filter,
 | 
				
			||||||
			    "#{||:#{m:*%s*,#{window_name}},"
 | 
							    "#{||:#{m%s:*%s*,#{window_name}},"
 | 
				
			||||||
			    "#{m:*%s*,#{pane_title}}}",
 | 
							    "#{m%s:*%s*,#{pane_title}}}",
 | 
				
			||||||
			    s, s);
 | 
							    suffix, s, suffix, s);
 | 
				
			||||||
	} else if (C)
 | 
						} else if (C)
 | 
				
			||||||
			xasprintf(&filter, "#{C:%s}", s);
 | 
							xasprintf(&filter, "#{C%s:%s}", suffix, s);
 | 
				
			||||||
	else if (N)
 | 
						else if (N)
 | 
				
			||||||
			xasprintf(&filter, "#{m:*%s*,#{window_name}}", s);
 | 
							xasprintf(&filter, "#{m%s:*%s*,#{window_name}}", suffix, s);
 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
			xasprintf(&filter, "#{m:*%s*,#{pane_title}}", s);
 | 
							xasprintf(&filter, "#{m%s:*%s*,#{pane_title}}", suffix, 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'))
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										4
									
								
								tmux.1
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								tmux.1
									
									
									
									
									
								
							@@ -2079,7 +2079,7 @@ 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 rCNTZ
 | 
					.Op Fl iCNrTZ
 | 
				
			||||||
.Op Fl t Ar target-pane
 | 
					.Op Fl t Ar target-pane
 | 
				
			||||||
.Ar match-string
 | 
					.Ar match-string
 | 
				
			||||||
.Xc
 | 
					.Xc
 | 
				
			||||||
@@ -2098,6 +2098,8 @@ matches only visible window contents,
 | 
				
			|||||||
matches only the window name and
 | 
					matches only the window name and
 | 
				
			||||||
.Fl T
 | 
					.Fl T
 | 
				
			||||||
matches only the window title.
 | 
					matches only the window title.
 | 
				
			||||||
 | 
					.Fl i
 | 
				
			||||||
 | 
					makes the search ignore case.
 | 
				
			||||||
The default is
 | 
					The default is
 | 
				
			||||||
.Fl CNT .
 | 
					.Fl CNT .
 | 
				
			||||||
.Fl Z
 | 
					.Fl Z
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user