mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 09:26:05 +00:00 
			
		
		
		
	-c needs to be able for fail for display-message.
This commit is contained in:
		
							
								
								
									
										15
									
								
								cmd.c
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								cmd.c
									
									
									
									
									
								
							@@ -585,7 +585,7 @@ cmd_prepare_state(struct cmd *cmd, struct cmd_q *cmdq)
 | 
			
		||||
	struct cmd_state	*state = &cmdq->state;
 | 
			
		||||
	struct args		*args = cmd->args;
 | 
			
		||||
	char			*tmp;
 | 
			
		||||
	int			 error;
 | 
			
		||||
	int			 error, quiet;
 | 
			
		||||
 | 
			
		||||
	tmp = cmd_print(cmd);
 | 
			
		||||
	log_debug("preparing state for: %s (client %p)", tmp, cmdq->client);
 | 
			
		||||
@@ -594,6 +594,11 @@ cmd_prepare_state(struct cmd *cmd, struct cmd_q *cmdq)
 | 
			
		||||
	/* Start with an empty state. */
 | 
			
		||||
	cmd_clear_state(state);
 | 
			
		||||
 | 
			
		||||
	/* No error messages if can fail. */
 | 
			
		||||
	quiet = 0;
 | 
			
		||||
	if (cmd->entry->flags & CMD_CLIENT_CANFAIL)
 | 
			
		||||
		quiet = 1;
 | 
			
		||||
 | 
			
		||||
	/*
 | 
			
		||||
	 * If the command wants a client and provides -c or -t, use it. If not,
 | 
			
		||||
	 * try the base command instead via cmd_get_state_client. No client is
 | 
			
		||||
@@ -604,13 +609,13 @@ cmd_prepare_state(struct cmd *cmd, struct cmd_q *cmdq)
 | 
			
		||||
		state->c = cmd_find_client(cmdq, NULL, 1);
 | 
			
		||||
		break;
 | 
			
		||||
	case CMD_CLIENT_C:
 | 
			
		||||
		state->c = cmd_find_client(cmdq, args_get(args, 'c'), 0);
 | 
			
		||||
		if (state->c == NULL)
 | 
			
		||||
		state->c = cmd_find_client(cmdq, args_get(args, 'c'), quiet);
 | 
			
		||||
		if (!quiet && state->c == NULL)
 | 
			
		||||
			return (-1);
 | 
			
		||||
		break;
 | 
			
		||||
	case CMD_CLIENT_T:
 | 
			
		||||
		state->c = cmd_find_client(cmdq, args_get(args, 't'), 0);
 | 
			
		||||
		if (state->c == NULL)
 | 
			
		||||
		state->c = cmd_find_client(cmdq, args_get(args, 't'), quiet);
 | 
			
		||||
		if (!quiet && state->c == NULL)
 | 
			
		||||
			return (-1);
 | 
			
		||||
		break;
 | 
			
		||||
	default:
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user