diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2009-08-31 20:46:20 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2009-08-31 20:46:20 +0000 |
commit | b3d19f3bfd39a96bc976abf38ce158e212394563 (patch) | |
tree | 8f5dfd575b04d6eb71ec090fb8389cfb2c53f77c /usr.bin/tmux/server-fn.c | |
parent | 6d6be4848445d3989ec1d654b09cd35891f1e71e (diff) |
Add a new display-panes command, with two options (display-panes-colour and
display-panes-time), which displays a visual indication of the number of each
pane.
Diffstat (limited to 'usr.bin/tmux/server-fn.c')
-rw-r--r-- | usr.bin/tmux/server-fn.c | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/usr.bin/tmux/server-fn.c b/usr.bin/tmux/server-fn.c index 88ba0da7e33..e407c83f8f6 100644 --- a/usr.bin/tmux/server-fn.c +++ b/usr.bin/tmux/server-fn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server-fn.c,v 1.14 2009/08/11 17:18:35 nicm Exp $ */ +/* $OpenBSD: server-fn.c,v 1.15 2009/08/31 20:46:19 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -263,3 +263,32 @@ server_kill_window(struct window *w) } recalculate_sizes(); } + +void +server_set_identify(struct client *c) +{ + struct timeval tv; + int delay; + + delay = options_get_number(&c->session->options, "display-panes-time"); + tv.tv_sec = delay / 1000; + tv.tv_usec = (delay % 1000) * 1000L; + + if (gettimeofday(&c->identify_timer, NULL) != 0) + fatal("gettimeofday"); + timeradd(&c->identify_timer, &tv, &c->identify_timer); + + c->flags |= CLIENT_IDENTIFY; + c->tty.flags |= (TTY_FREEZE|TTY_NOCURSOR); + server_redraw_client(c); +} + +void +server_clear_identify(struct client *c) +{ + if (c->flags & CLIENT_IDENTIFY) { + c->flags &= ~CLIENT_IDENTIFY; + c->tty.flags &= ~(TTY_FREEZE|TTY_NOCURSOR); + server_redraw_client(c); + } +} |