summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/cmd-kill-session.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2015-11-24 21:50:07 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2015-11-24 21:50:07 +0000
commit2bbf3c0f8977c85ab1e26d8fc89c6065836e8e5a (patch)
treec419d0c9f1e5b7eee53d6c0cda27467d330e4812 /usr.bin/tmux/cmd-kill-session.c
parent6b76dc414792c9dccf3e928fcdfdab6b22bdf383 (diff)
All kill-session -C to clear alerts in all windows, suggested by Aaron
U'Ren.
Diffstat (limited to 'usr.bin/tmux/cmd-kill-session.c')
-rw-r--r--usr.bin/tmux/cmd-kill-session.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/usr.bin/tmux/cmd-kill-session.c b/usr.bin/tmux/cmd-kill-session.c
index aa2890db9ea..dce0c609d7d 100644
--- a/usr.bin/tmux/cmd-kill-session.c
+++ b/usr.bin/tmux/cmd-kill-session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-kill-session.c,v 1.15 2015/09/16 22:40:27 nicm Exp $ */
+/* $OpenBSD: cmd-kill-session.c,v 1.16 2015/11/24 21:50:06 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -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);