mirror of
https://github.com/tmux/tmux.git
synced 2024-11-16 09:28:51 +00:00
Make monitor-activity w/o arguments toggle.
This commit is contained in:
parent
b25ac6fd75
commit
f34b619049
@ -1,4 +1,4 @@
|
|||||||
/* $Id: cmd-set-window-option.c,v 1.1 2008-06-04 17:54:26 nicm Exp $ */
|
/* $Id: cmd-set-window-option.c,v 1.2 2008-06-04 18:32:20 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -151,7 +151,7 @@ cmd_set_window_option_exec(void *ptr, unused struct cmd_ctx *ctx)
|
|||||||
strcasecmp(data->value, "no") == 0)
|
strcasecmp(data->value, "no") == 0)
|
||||||
bool = 0;
|
bool = 0;
|
||||||
} else
|
} else
|
||||||
bool = 1;
|
bool = -2;
|
||||||
|
|
||||||
if (strcmp(data->option, "monitor-activity") == 0) {
|
if (strcmp(data->option, "monitor-activity") == 0) {
|
||||||
if (bool == -1) {
|
if (bool == -1) {
|
||||||
@ -159,10 +159,14 @@ cmd_set_window_option_exec(void *ptr, unused struct cmd_ctx *ctx)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bool)
|
if (bool == -2)
|
||||||
wl->window->flags |= WINDOW_MONITOR;
|
wl->window->flags ^= WINDOW_MONITOR;
|
||||||
else
|
else {
|
||||||
wl->window->flags &= ~WINDOW_MONITOR;
|
if (bool)
|
||||||
|
wl->window->flags |= WINDOW_MONITOR;
|
||||||
|
else
|
||||||
|
wl->window->flags &= ~WINDOW_MONITOR;
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_LENGTH(&sessions); i++) {
|
for (i = 0; i < ARRAY_LENGTH(&sessions); i++) {
|
||||||
s = ARRAY_ITEM(&sessions, i);
|
s = ARRAY_ITEM(&sessions, i);
|
||||||
|
Loading…
Reference in New Issue
Block a user