diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2012-01-21 06:13:17 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2012-01-21 06:13:17 +0000 |
commit | 5c81cd094f9ea00dd2f34fab981bad3010df1427 (patch) | |
tree | b90f4f47a81a027e0ce602de4c58b5c6a5d72ed8 | |
parent | bb465aa6054e9f643314ec347f07c2cf50e734df (diff) |
Only hide flags on the current window when the session is attached, from
Roland Walker.
-rw-r--r-- | usr.bin/tmux/cmd-attach-session.c | 4 | ||||
-rw-r--r-- | usr.bin/tmux/cmd-switch-client.c | 3 | ||||
-rw-r--r-- | usr.bin/tmux/server-window.c | 14 |
3 files changed, 13 insertions, 8 deletions
diff --git a/usr.bin/tmux/cmd-attach-session.c b/usr.bin/tmux/cmd-attach-session.c index d81805bbc68..00715f7fa30 100644 --- a/usr.bin/tmux/cmd-attach-session.c +++ b/usr.bin/tmux/cmd-attach-session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-attach-session.c,v 1.16 2011/04/05 19:37:01 nicm Exp $ */ +/* $OpenBSD: cmd-attach-session.c,v 1.17 2012/01/21 06:13:16 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -76,6 +76,7 @@ cmd_attach_session_exec(struct cmd *self, struct cmd_ctx *ctx) ctx->curclient->session = s; session_update_activity(s); server_redraw_client(ctx->curclient); + s->curw->flags &= ~WINLINK_ALERTFLAGS; } else { if (!(ctx->cmdclient->flags & CLIENT_TERMINAL)) { ctx->error(ctx, "not a terminal"); @@ -104,6 +105,7 @@ cmd_attach_session_exec(struct cmd *self, struct cmd_ctx *ctx) environ_update(update, &ctx->cmdclient->environ, &s->environ); server_redraw_client(ctx->cmdclient); + s->curw->flags &= ~WINLINK_ALERTFLAGS; } recalculate_sizes(); server_update_socket(); diff --git a/usr.bin/tmux/cmd-switch-client.c b/usr.bin/tmux/cmd-switch-client.c index 1ff9e643fb1..450c39abf80 100644 --- a/usr.bin/tmux/cmd-switch-client.c +++ b/usr.bin/tmux/cmd-switch-client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-switch-client.c,v 1.13 2011/08/16 10:00:52 nicm Exp $ */ +/* $OpenBSD: cmd-switch-client.c,v 1.14 2012/01/21 06:13:16 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -108,6 +108,7 @@ cmd_switch_client_exec(struct cmd *self, struct cmd_ctx *ctx) recalculate_sizes(); server_check_unattached(); server_redraw_client(c); + s->curw->flags &= ~WINLINK_ALERTFLAGS; return (0); } diff --git a/usr.bin/tmux/server-window.c b/usr.bin/tmux/server-window.c index 4ae2685301b..0fff4375598 100644 --- a/usr.bin/tmux/server-window.c +++ b/usr.bin/tmux/server-window.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server-window.c,v 1.22 2011/08/24 09:58:44 nicm Exp $ */ +/* $OpenBSD: server-window.c,v 1.23 2012/01/21 06:13:16 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net> @@ -56,8 +56,10 @@ server_window_loop(void) server_status_session(s); TAILQ_FOREACH(wp, &w->panes, entry) server_window_check_content(s, wl, wp); + + if (!(s->flags & SESSION_UNATTACHED)) + w->flags &= ~(WINDOW_BELL|WINDOW_ACTIVITY); } - w->flags &= ~(WINDOW_BELL|WINDOW_ACTIVITY); } } @@ -72,7 +74,7 @@ server_window_check_bell(struct session *s, struct winlink *wl) if (!(w->flags & WINDOW_BELL) || wl->flags & WINLINK_BELL) return (0); - if (s->curw != wl) + if (s->curw != wl || s->flags & SESSION_UNATTACHED) wl->flags |= WINLINK_BELL; action = options_get_number(&s->options, "bell-action"); @@ -129,7 +131,7 @@ server_window_check_activity(struct session *s, struct winlink *wl) if (!(w->flags & WINDOW_ACTIVITY) || wl->flags & WINLINK_ACTIVITY) return (0); - if (s->curw == wl) + if (s->curw == wl && !(s->flags & SESSION_UNATTACHED)) return (0); if (!options_get_number(&w->options, "monitor-activity")) @@ -165,7 +167,7 @@ server_window_check_silence(struct session *s, struct winlink *wl) if (!(w->flags & WINDOW_SILENCE) || wl->flags & WINLINK_SILENCE) return (0); - if (s->curw == wl) { + if (s->curw == wl && !(s->flags & SESSION_UNATTACHED)) { /* * Reset the timer for this window if we've focused it. We * don't want the timer tripping as soon as we've switched away @@ -217,7 +219,7 @@ server_window_check_content( /* Activity flag must be set for new content. */ if (!(w->flags & WINDOW_ACTIVITY) || wl->flags & WINLINK_CONTENT) return (0); - if (s->curw == wl) + if (s->curw == wl && !(s->flags & SESSION_UNATTACHED)) return (0); ptr = options_get_string(&w->options, "monitor-content"); |