mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	Add -b to display-panes like run-shell, GitHub issue 1559.
This commit is contained in:
		@@ -37,8 +37,8 @@ const struct cmd_entry cmd_display_panes_entry = {
 | 
				
			|||||||
	.name = "display-panes",
 | 
						.name = "display-panes",
 | 
				
			||||||
	.alias = "displayp",
 | 
						.alias = "displayp",
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	.args = { "d:t:", 0, 1 },
 | 
						.args = { "bd:t:", 0, 1 },
 | 
				
			||||||
	.usage = "[-d duration] " CMD_TARGET_CLIENT_USAGE " [template]",
 | 
						.usage = "[-b] [-d duration] " CMD_TARGET_CLIENT_USAGE " [template]",
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	.flags = CMD_AFTERHOOK,
 | 
						.flags = CMD_AFTERHOOK,
 | 
				
			||||||
	.exec = cmd_display_panes_exec
 | 
						.exec = cmd_display_panes_exec
 | 
				
			||||||
@@ -65,6 +65,9 @@ cmd_display_panes_exec(struct cmd *self, struct cmdq_item *item)
 | 
				
			|||||||
		c->identify_callback_data = xstrdup(args->argv[0]);
 | 
							c->identify_callback_data = xstrdup(args->argv[0]);
 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
		c->identify_callback_data = xstrdup("select-pane -t '%%'");
 | 
							c->identify_callback_data = xstrdup("select-pane -t '%%'");
 | 
				
			||||||
 | 
						if (args_has(args, 'b'))
 | 
				
			||||||
 | 
							c->identify_callback_item = NULL;
 | 
				
			||||||
 | 
						else
 | 
				
			||||||
		c->identify_callback_item = item;
 | 
							c->identify_callback_item = item;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (args_has(args, 'd')) {
 | 
						if (args_has(args, 'd')) {
 | 
				
			||||||
@@ -78,6 +81,8 @@ cmd_display_panes_exec(struct cmd *self, struct cmdq_item *item)
 | 
				
			|||||||
		delay = options_get_number(s->options, "display-panes-time");
 | 
							delay = options_get_number(s->options, "display-panes-time");
 | 
				
			||||||
	server_client_set_identify(c, delay);
 | 
						server_client_set_identify(c, delay);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (args_has(args, 'b'))
 | 
				
			||||||
 | 
							return (CMD_RETURN_NORMAL);
 | 
				
			||||||
	return (CMD_RETURN_WAIT);
 | 
						return (CMD_RETURN_WAIT);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -115,15 +120,21 @@ cmd_display_panes_callback(struct client *c, struct window_pane *wp)
 | 
				
			|||||||
		cmd_list_free(cmdlist);
 | 
							cmd_list_free(cmdlist);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (new_item != NULL)
 | 
						if (new_item != NULL) {
 | 
				
			||||||
 | 
							if (c->identify_callback_item != NULL)
 | 
				
			||||||
			cmdq_insert_after(c->identify_callback_item, new_item);
 | 
								cmdq_insert_after(c->identify_callback_item, new_item);
 | 
				
			||||||
 | 
							else
 | 
				
			||||||
 | 
								cmdq_append(c, new_item);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	free(cmd);
 | 
						free(cmd);
 | 
				
			||||||
	free(expanded);
 | 
						free(expanded);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
out:
 | 
					out:
 | 
				
			||||||
 | 
						if (c->identify_callback_item != NULL) {
 | 
				
			||||||
		c->identify_callback_item->flags &= ~CMDQ_WAITING;
 | 
							c->identify_callback_item->flags &= ~CMDQ_WAITING;
 | 
				
			||||||
		c->identify_callback_item = NULL;
 | 
							c->identify_callback_item = NULL;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	free(c->identify_callback_data);
 | 
						free(c->identify_callback_data);
 | 
				
			||||||
	c->identify_callback_data = NULL;
 | 
						c->identify_callback_data = NULL;
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										4
									
								
								tmux.1
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								tmux.1
									
									
									
									
									
								
							@@ -1526,6 +1526,7 @@ first.
 | 
				
			|||||||
This command works only if at least one client is attached.
 | 
					This command works only if at least one client is attached.
 | 
				
			||||||
.It Xo
 | 
					.It Xo
 | 
				
			||||||
.Ic display-panes
 | 
					.Ic display-panes
 | 
				
			||||||
 | 
					.Op Fl b
 | 
				
			||||||
.Op Fl d Ar duration
 | 
					.Op Fl d Ar duration
 | 
				
			||||||
.Op Fl t Ar target-client
 | 
					.Op Fl t Ar target-client
 | 
				
			||||||
.Op Ar template
 | 
					.Op Ar template
 | 
				
			||||||
@@ -1559,6 +1560,9 @@ substituted by the pane ID.
 | 
				
			|||||||
The default
 | 
					The default
 | 
				
			||||||
.Ar template
 | 
					.Ar template
 | 
				
			||||||
is "select-pane -t '%%'".
 | 
					is "select-pane -t '%%'".
 | 
				
			||||||
 | 
					With
 | 
				
			||||||
 | 
					.Fl b ,
 | 
				
			||||||
 | 
					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 CNTZ
 | 
				
			||||||
.Op Fl t Ar target-pane
 | 
					.Op Fl t Ar target-pane
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user