mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	All kill-session -C to clear alerts in all windows, suggested by Aaron
U'Ren.
This commit is contained in:
		@@ -31,8 +31,8 @@ enum cmd_retval	 cmd_kill_session_exec(struct cmd *, struct cmd_q *);
 | 
			
		||||
 | 
			
		||||
const struct cmd_entry cmd_kill_session_entry = {
 | 
			
		||||
	"kill-session", NULL,
 | 
			
		||||
	"at:", 0, 0,
 | 
			
		||||
	"[-a] " CMD_TARGET_SESSION_USAGE,
 | 
			
		||||
	"aCt:", 0, 0,
 | 
			
		||||
	"[-aC] " CMD_TARGET_SESSION_USAGE,
 | 
			
		||||
	0,
 | 
			
		||||
	cmd_kill_session_exec
 | 
			
		||||
};
 | 
			
		||||
@@ -42,11 +42,18 @@ cmd_kill_session_exec(struct cmd *self, struct cmd_q *cmdq)
 | 
			
		||||
{
 | 
			
		||||
	struct args	*args = self->args;
 | 
			
		||||
	struct session	*s, *sloop, *stmp;
 | 
			
		||||
	struct winlink	*wl;
 | 
			
		||||
 | 
			
		||||
	if ((s = cmd_find_session(cmdq, args_get(args, 't'), 0)) == NULL)
 | 
			
		||||
		return (CMD_RETURN_ERROR);
 | 
			
		||||
 | 
			
		||||
	if (args_has(args, 'a')) {
 | 
			
		||||
	if (args_has(args, 'C')) {
 | 
			
		||||
		RB_FOREACH(wl, winlinks, &s->windows) {
 | 
			
		||||
			wl->window->flags &= ~WINDOW_ALERTFLAGS;
 | 
			
		||||
			wl->flags &= ~WINLINK_ALERTFLAGS;
 | 
			
		||||
		}
 | 
			
		||||
		server_redraw_session(s);
 | 
			
		||||
	} else if (args_has(args, 'a')) {
 | 
			
		||||
		RB_FOREACH_SAFE(sloop, sessions, &sessions, stmp) {
 | 
			
		||||
			if (sloop != s) {
 | 
			
		||||
				server_destroy_session(sloop);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user