From 31bb577075bf984fa429c7fa904996bb7957bf2b Mon Sep 17 00:00:00 2001 From: Tiago Cunha Date: Wed, 28 Oct 2009 23:05:01 +0000 Subject: [PATCH] Sync OpenBSD patchset 460: Not all terminals swap CSI and SS3 on ctrl, so remove that. Also mark the rxvt special-cases as such until terminfo is updated to have kLFT5, kRIT5 etc. --- input-keys.c | 7 +++++-- tty-keys.c | 27 ++++++++++++--------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/input-keys.c b/input-keys.c index 7d503d57..0f85f089 100644 --- a/input-keys.c +++ b/input-keys.c @@ -1,4 +1,4 @@ -/* $Id: input-keys.c,v 1.38 2009-10-28 23:03:51 tcunha Exp $ */ +/* $Id: input-keys.c,v 1.39 2009-10-28 23:05:01 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -95,7 +95,10 @@ struct input_key_ent input_keys[] = { { KEYC_PPAGE|KEYC_CTRL, "\033[5^", 0 }, { KEYC_BTAB, "\033[Z", 0 }, - /* Arrow keys. Cursor versions must come first. */ + /* + * Arrow keys. Cursor versions must come first. The codes are toggled + * between CSI and SS3 versions when ctrl is pressed. + */ { KEYC_UP|KEYC_CTRL, "\033[A", INPUTKEY_CURSOR }, { KEYC_DOWN|KEYC_CTRL, "\033[B", INPUTKEY_CURSOR }, { KEYC_RIGHT|KEYC_CTRL, "\033[C", INPUTKEY_CURSOR }, diff --git a/tty-keys.c b/tty-keys.c index 37302598..f95d46a2 100644 --- a/tty-keys.c +++ b/tty-keys.c @@ -1,4 +1,4 @@ -/* $Id: tty-keys.c,v 1.37 2009-10-28 23:03:51 tcunha Exp $ */ +/* $Id: tty-keys.c,v 1.38 2009-10-28 23:05:01 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -71,21 +71,23 @@ struct tty_key_ent tty_keys[] = { { TTYC_KPP, NULL, KEYC_PPAGE, TTYKEY_CTRL }, { TTYC_KCBT, NULL, KEYC_BTAB, TTYKEY_CTRL }, - /* - * Arrow keys. There are several variants of these so just accept them. - * We always put the terminal into application keys mode so ctrl should - * swap between SS3 and CSI. - */ + /* Arrow keys. */ { 0, "\033OA", KEYC_UP, TTYKEY_RAW }, { 0, "\033OB", KEYC_DOWN, TTYKEY_RAW }, { 0, "\033OC", KEYC_RIGHT, TTYKEY_RAW }, { 0, "\033OD", KEYC_LEFT, TTYKEY_RAW }, - { 0, "\033[A", KEYC_UP|KEYC_CTRL, TTYKEY_RAW }, - { 0, "\033[B", KEYC_DOWN|KEYC_CTRL, TTYKEY_RAW }, - { 0, "\033[C", KEYC_RIGHT|KEYC_CTRL, TTYKEY_RAW }, - { 0, "\033[D", KEYC_LEFT|KEYC_CTRL, TTYKEY_RAW }, + { 0, "\033[A", KEYC_UP, TTYKEY_RAW }, + { 0, "\033[B", KEYC_DOWN, TTYKEY_RAW }, + { 0, "\033[C", KEYC_RIGHT, TTYKEY_RAW }, + { 0, "\033[D", KEYC_LEFT, TTYKEY_RAW }, + { TTYC_KCUU1, NULL, KEYC_UP, TTYKEY_CTRL }, + { TTYC_KCUD1, NULL, KEYC_DOWN, TTYKEY_CTRL }, + { TTYC_KCUB1, NULL, KEYC_LEFT, TTYKEY_CTRL }, + { TTYC_KCUF1, NULL, KEYC_RIGHT, TTYKEY_CTRL }, + + /* Special-case arrow keys for rxvt until terminfo has kRIT5 etc. */ { 0, "\033Oa", KEYC_UP|KEYC_CTRL, TTYKEY_RAW }, { 0, "\033Ob", KEYC_DOWN|KEYC_CTRL, TTYKEY_RAW }, { 0, "\033Oc", KEYC_RIGHT|KEYC_CTRL, TTYKEY_RAW }, @@ -96,11 +98,6 @@ struct tty_key_ent tty_keys[] = { { 0, "\033[c", KEYC_RIGHT|KEYC_SHIFT, TTYKEY_RAW }, { 0, "\033[d", KEYC_LEFT|KEYC_SHIFT, TTYKEY_RAW }, - { TTYC_KCUU1, NULL, KEYC_UP, TTYKEY_CTRL }, - { TTYC_KCUD1, NULL, KEYC_DOWN, TTYKEY_CTRL }, - { TTYC_KCUB1, NULL, KEYC_LEFT, TTYKEY_CTRL }, - { TTYC_KCUF1, NULL, KEYC_RIGHT, TTYKEY_CTRL }, - /* * Numeric keypad. Just use the vt100 escape sequences here and always * put the terminal into keypad_xmit mode. Translation of numbers