From ddb5bb80fa9b24f47a1e5af9d808427d316bcf4a Mon Sep 17 00:00:00 2001 From: Tiago Cunha Date: Fri, 4 Dec 2009 22:05:52 +0000 Subject: [PATCH] Sync OpenBSD patchset 579: Reflect the keypad mode of the application so that numlock works. --- tty.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tty.c b/tty.c index 2a1d4b1f..ba0071be 100644 --- a/tty.c +++ b/tty.c @@ -1,4 +1,4 @@ -/* $Id: tty.c,v 1.179 2009-11-28 14:59:26 tcunha Exp $ */ +/* $Id: tty.c,v 1.180 2009-12-04 22:05:52 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -185,7 +185,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); @@ -415,6 +415,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; }