aboutsummaryrefslogtreecommitdiff
path: root/tty-write.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2009-01-27 21:39:15 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2009-01-27 21:39:15 +0000
commitc1726281c925cbc0b6828a4cf41f7a300afc5901 (patch)
tree2025cffae566f7a883a38cc9b4eccbe13f65a8ee /tty-write.c
parenteafc1693aeb41c22fa7980711f3a89ff2d098cdb (diff)
downloadrtmux-c1726281c925cbc0b6828a4cf41f7a300afc5901.tar.gz
rtmux-c1726281c925cbc0b6828a4cf41f7a300afc5901.tar.bz2
rtmux-c1726281c925cbc0b6828a4cf41f7a300afc5901.zip
Handle cursor on/off better.
Diffstat (limited to 'tty-write.c')
-rw-r--r--tty-write.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/tty-write.c b/tty-write.c
index 62adb8b2..409ed08c 100644
--- a/tty-write.c
+++ b/tty-write.c
@@ -1,4 +1,4 @@
-/* $Id: tty-write.c,v 1.7 2009-01-18 12:09:42 nicm Exp $ */
+/* $Id: tty-write.c,v 1.8 2009-01-27 21:39:15 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -55,3 +55,24 @@ tty_vwrite_window(void *ptr, enum tty_cmd cmd, va_list ap)
}
}
}
+
+void
+tty_write_cursor_off(void *ptr)
+{
+ struct window_pane *wp = ptr;
+ struct client *c;
+ u_int i;
+
+ if (wp->window->flags & WINDOW_HIDDEN || wp->flags & PANE_HIDDEN)
+ return;
+
+ for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
+ c = ARRAY_ITEM(&clients, i);
+ if (c == NULL || c->session == NULL)
+ continue;
+ if (c->flags & CLIENT_SUSPENDED)
+ continue;
+
+ tty_cursor_off(&c->tty);
+ }
+}