summaryrefslogtreecommitdiffstats
path: root/tty.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2009-12-02 22:13:15 +0000
committerNicholas Marriott <nicm@openbsd.org>2009-12-02 22:13:15 +0000
commit6bbc92a6f5799f0c3d9ce4fc8c10c161598757be (patch)
tree080e429efaccab4b36a0eed8b857597d78e927b6 /tty.c
parent459e9de81a5168a9474cbd9e55583da7e8b19788 (diff)
Reflect the keypad mode of the application so that numlock works.
Diffstat (limited to 'tty.c')
-rw-r--r--tty.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/tty.c b/tty.c
index 07b744cb..ac6a2cf7 100644
--- a/tty.c
+++ b/tty.c
@@ -180,7 +180,7 @@ tty_start_tty(struct tty *tty)
tty_putcode(tty, TTYC_SGR0);
memcpy(&tty->cell, &grid_default_cell, sizeof tty->cell);
- tty_putcode(tty, TTYC_SMKX);
+ tty_putcode(tty, TTYC_RMKX);
tty_putcode(tty, TTYC_ENACS);
tty_putcode(tty, TTYC_CLEAR);
@@ -410,6 +410,12 @@ tty_update_mode(struct tty *tty, int mode)
else
tty_puts(tty, "\033[?1000l");
}
+ if (changed & MODE_KKEYPAD) {
+ if (mode & MODE_KKEYPAD)
+ tty_putcode(tty, TTYC_SMKX);
+ else
+ tty_putcode(tty, TTYC_RMKX);
+ }
tty->mode = mode;
}