mirror of
https://github.com/tmux/tmux.git
synced 2024-12-12 17:38:48 +00:00
Sync OpenBSD patchset 458:
Support the (mostly new) function key+modifier caps (kIC-kIC7). Most of these will be caught (soon) by the xterm keys code in xterm itself but some other descriptions such as rxvt define them as well.
This commit is contained in:
parent
8ff0d06d34
commit
1c4b7d33b1
62
tmux.h
62
tmux.h
@ -1,4 +1,4 @@
|
||||
/* $Id: tmux.h,v 1.486 2009-10-28 22:53:03 tcunha Exp $ */
|
||||
/* $Id: tmux.h,v 1.487 2009-10-28 23:01:44 tcunha Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||
@ -224,8 +224,26 @@ enum tty_code_code {
|
||||
TTYC_KCUD1, /* key_down, kd */
|
||||
TTYC_KCUF1, /* key_right, kr */
|
||||
TTYC_KCUU1, /* key_up, ku */
|
||||
TTYC_KDC2,
|
||||
TTYC_KDC3,
|
||||
TTYC_KDC4,
|
||||
TTYC_KDC5,
|
||||
TTYC_KDC6,
|
||||
TTYC_KDC7,
|
||||
TTYC_KDCH1, /* key_dc, kD */
|
||||
TTYC_KDN2,
|
||||
TTYC_KDN3,
|
||||
TTYC_KDN4,
|
||||
TTYC_KDN5,
|
||||
TTYC_KDN6,
|
||||
TTYC_KDN7,
|
||||
TTYC_KEND, /* key_end, ke */
|
||||
TTYC_KEND2,
|
||||
TTYC_KEND3,
|
||||
TTYC_KEND4,
|
||||
TTYC_KEND5,
|
||||
TTYC_KEND6,
|
||||
TTYC_KEND7,
|
||||
TTYC_KF1, /* key_f1, k1 */
|
||||
TTYC_KF10, /* key_f10, k; */
|
||||
TTYC_KF11, /* key_f11, F1 */
|
||||
@ -246,11 +264,53 @@ enum tty_code_code {
|
||||
TTYC_KF7, /* key_f7, k7 */
|
||||
TTYC_KF8, /* key_f8, k8 */
|
||||
TTYC_KF9, /* key_f9, k9 */
|
||||
TTYC_KHOM2,
|
||||
TTYC_KHOM3,
|
||||
TTYC_KHOM4,
|
||||
TTYC_KHOM5,
|
||||
TTYC_KHOM6,
|
||||
TTYC_KHOM7,
|
||||
TTYC_KHOME, /* key_home, kh */
|
||||
TTYC_KIC2,
|
||||
TTYC_KIC3,
|
||||
TTYC_KIC4,
|
||||
TTYC_KIC5,
|
||||
TTYC_KIC6,
|
||||
TTYC_KIC7,
|
||||
TTYC_KICH1, /* key_ic, kI */
|
||||
TTYC_KLFT2,
|
||||
TTYC_KLFT3,
|
||||
TTYC_KLFT4,
|
||||
TTYC_KLFT5,
|
||||
TTYC_KLFT6,
|
||||
TTYC_KLFT7,
|
||||
TTYC_KMOUS, /* key_mouse, Km */
|
||||
TTYC_KNP, /* key_npage, kN */
|
||||
TTYC_KNXT2,
|
||||
TTYC_KNXT3,
|
||||
TTYC_KNXT4,
|
||||
TTYC_KNXT5,
|
||||
TTYC_KNXT6,
|
||||
TTYC_KNXT7,
|
||||
TTYC_KPP, /* key_ppage, kP */
|
||||
TTYC_KPRV2,
|
||||
TTYC_KPRV3,
|
||||
TTYC_KPRV4,
|
||||
TTYC_KPRV5,
|
||||
TTYC_KPRV6,
|
||||
TTYC_KPRV7,
|
||||
TTYC_KRIT2,
|
||||
TTYC_KRIT3,
|
||||
TTYC_KRIT4,
|
||||
TTYC_KRIT5,
|
||||
TTYC_KRIT6,
|
||||
TTYC_KRIT7,
|
||||
TTYC_KUP2,
|
||||
TTYC_KUP3,
|
||||
TTYC_KUP4,
|
||||
TTYC_KUP5,
|
||||
TTYC_KUP6,
|
||||
TTYC_KUP7,
|
||||
TTYC_OP, /* orig_pair, op */
|
||||
TTYC_REV, /* enter_reverse_mode, mr */
|
||||
TTYC_RI, /* scroll_reverse, sr */
|
||||
|
64
tty-keys.c
64
tty-keys.c
@ -1,4 +1,4 @@
|
||||
/* $Id: tty-keys.c,v 1.35 2009-10-28 22:57:55 tcunha Exp $ */
|
||||
/* $Id: tty-keys.c,v 1.36 2009-10-28 23:01:44 tcunha Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||
@ -122,6 +122,68 @@ struct tty_key_ent tty_keys[] = {
|
||||
{ 0, "\033OM", KEYC_KP_ENTER, TTYKEY_RAW },
|
||||
{ 0, "\033Op", KEYC_KP_ZERO, TTYKEY_RAW },
|
||||
{ 0, "\033On", KEYC_KP_PERIOD, TTYKEY_RAW },
|
||||
|
||||
/* Key and modifier capabilities. */
|
||||
{ TTYC_KDC2, NULL, KEYC_DC|KEYC_SHIFT, 0 },
|
||||
{ TTYC_KDC3, NULL, KEYC_DC|KEYC_ESCAPE, 0 },
|
||||
{ TTYC_KDC4, NULL, KEYC_DC|KEYC_SHIFT|KEYC_ESCAPE, 0 },
|
||||
{ TTYC_KDC5, NULL, KEYC_DC|KEYC_CTRL, 0 },
|
||||
{ TTYC_KDC6, NULL, KEYC_DC|KEYC_SHIFT|KEYC_CTRL, 0 },
|
||||
{ TTYC_KDC7, NULL, KEYC_DC|KEYC_ESCAPE|KEYC_CTRL, 0 },
|
||||
{ TTYC_KDN2, NULL, KEYC_DOWN|KEYC_SHIFT, 0 },
|
||||
{ TTYC_KDN3, NULL, KEYC_DOWN|KEYC_ESCAPE, 0 },
|
||||
{ TTYC_KDN4, NULL, KEYC_DOWN|KEYC_SHIFT|KEYC_ESCAPE, 0 },
|
||||
{ TTYC_KDN5, NULL, KEYC_DOWN|KEYC_CTRL, 0 },
|
||||
{ TTYC_KDN6, NULL, KEYC_DOWN|KEYC_SHIFT|KEYC_CTRL, 0 },
|
||||
{ TTYC_KDN7, NULL, KEYC_DOWN|KEYC_ESCAPE|KEYC_CTRL, 0 },
|
||||
{ TTYC_KEND2, NULL, KEYC_END|KEYC_SHIFT, 0 },
|
||||
{ TTYC_KEND3, NULL, KEYC_END|KEYC_ESCAPE, 0 },
|
||||
{ TTYC_KEND4, NULL, KEYC_END|KEYC_SHIFT|KEYC_ESCAPE, 0 },
|
||||
{ TTYC_KEND5, NULL, KEYC_END|KEYC_CTRL, 0 },
|
||||
{ TTYC_KEND6, NULL, KEYC_END|KEYC_SHIFT|KEYC_CTRL, 0 },
|
||||
{ TTYC_KEND7, NULL, KEYC_END|KEYC_ESCAPE|KEYC_CTRL, 0 },
|
||||
{ TTYC_KHOM2, NULL, KEYC_HOME|KEYC_SHIFT, 0 },
|
||||
{ TTYC_KHOM3, NULL, KEYC_HOME|KEYC_ESCAPE, 0 },
|
||||
{ TTYC_KHOM4, NULL, KEYC_HOME|KEYC_SHIFT|KEYC_ESCAPE, 0 },
|
||||
{ TTYC_KHOM5, NULL, KEYC_HOME|KEYC_CTRL, 0 },
|
||||
{ TTYC_KHOM6, NULL, KEYC_HOME|KEYC_SHIFT|KEYC_CTRL, 0 },
|
||||
{ TTYC_KHOM7, NULL, KEYC_HOME|KEYC_ESCAPE|KEYC_CTRL, 0 },
|
||||
{ TTYC_KIC2, NULL, KEYC_IC|KEYC_SHIFT, 0 },
|
||||
{ TTYC_KIC3, NULL, KEYC_IC|KEYC_ESCAPE, 0 },
|
||||
{ TTYC_KIC4, NULL, KEYC_IC|KEYC_SHIFT|KEYC_ESCAPE, 0 },
|
||||
{ TTYC_KIC5, NULL, KEYC_IC|KEYC_CTRL, 0 },
|
||||
{ TTYC_KIC6, NULL, KEYC_IC|KEYC_SHIFT|KEYC_CTRL, 0 },
|
||||
{ TTYC_KIC7, NULL, KEYC_IC|KEYC_ESCAPE|KEYC_CTRL, 0 },
|
||||
{ TTYC_KLFT2, NULL, KEYC_LEFT|KEYC_SHIFT, 0 },
|
||||
{ TTYC_KLFT3, NULL, KEYC_LEFT|KEYC_ESCAPE, 0 },
|
||||
{ TTYC_KLFT4, NULL, KEYC_LEFT|KEYC_SHIFT|KEYC_ESCAPE, 0 },
|
||||
{ TTYC_KLFT5, NULL, KEYC_LEFT|KEYC_CTRL, 0 },
|
||||
{ TTYC_KLFT6, NULL, KEYC_LEFT|KEYC_SHIFT|KEYC_CTRL, 0 },
|
||||
{ TTYC_KLFT7, NULL, KEYC_LEFT|KEYC_ESCAPE|KEYC_CTRL, 0 },
|
||||
{ TTYC_KNXT2, NULL, KEYC_NPAGE|KEYC_SHIFT, 0 },
|
||||
{ TTYC_KNXT3, NULL, KEYC_NPAGE|KEYC_ESCAPE, 0 },
|
||||
{ TTYC_KNXT4, NULL, KEYC_NPAGE|KEYC_SHIFT|KEYC_ESCAPE, 0 },
|
||||
{ TTYC_KNXT5, NULL, KEYC_NPAGE|KEYC_CTRL, 0 },
|
||||
{ TTYC_KNXT6, NULL, KEYC_NPAGE|KEYC_SHIFT|KEYC_CTRL, 0 },
|
||||
{ TTYC_KNXT7, NULL, KEYC_NPAGE|KEYC_ESCAPE|KEYC_CTRL, 0 },
|
||||
{ TTYC_KPRV2, NULL, KEYC_PPAGE|KEYC_SHIFT, 0 },
|
||||
{ TTYC_KPRV3, NULL, KEYC_PPAGE|KEYC_ESCAPE, 0 },
|
||||
{ TTYC_KPRV4, NULL, KEYC_PPAGE|KEYC_SHIFT|KEYC_ESCAPE, 0 },
|
||||
{ TTYC_KPRV5, NULL, KEYC_PPAGE|KEYC_CTRL, 0 },
|
||||
{ TTYC_KPRV6, NULL, KEYC_PPAGE|KEYC_SHIFT|KEYC_CTRL, 0 },
|
||||
{ TTYC_KPRV7, NULL, KEYC_PPAGE|KEYC_ESCAPE|KEYC_CTRL, 0 },
|
||||
{ TTYC_KRIT2, NULL, KEYC_RIGHT|KEYC_SHIFT, 0 },
|
||||
{ TTYC_KRIT3, NULL, KEYC_RIGHT|KEYC_ESCAPE, 0 },
|
||||
{ TTYC_KRIT4, NULL, KEYC_RIGHT|KEYC_SHIFT|KEYC_ESCAPE, 0 },
|
||||
{ TTYC_KRIT5, NULL, KEYC_RIGHT|KEYC_CTRL, 0 },
|
||||
{ TTYC_KRIT6, NULL, KEYC_RIGHT|KEYC_SHIFT|KEYC_CTRL, 0 },
|
||||
{ TTYC_KRIT7, NULL, KEYC_RIGHT|KEYC_ESCAPE|KEYC_CTRL, 0 },
|
||||
{ TTYC_KUP2, NULL, KEYC_UP|KEYC_SHIFT, 0 },
|
||||
{ TTYC_KUP3, NULL, KEYC_UP|KEYC_ESCAPE, 0 },
|
||||
{ TTYC_KUP4, NULL, KEYC_UP|KEYC_SHIFT|KEYC_ESCAPE, 0 },
|
||||
{ TTYC_KUP5, NULL, KEYC_UP|KEYC_CTRL, 0 },
|
||||
{ TTYC_KUP6, NULL, KEYC_UP|KEYC_SHIFT|KEYC_CTRL, 0 },
|
||||
{ TTYC_KUP7, NULL, KEYC_UP|KEYC_ESCAPE|KEYC_CTRL, 0 },
|
||||
};
|
||||
|
||||
RB_GENERATE(tty_keys, tty_key, entry, tty_keys_cmp);
|
||||
|
64
tty-term.c
64
tty-term.c
@ -1,4 +1,4 @@
|
||||
/* $Id: tty-term.c,v 1.34 2009-10-28 22:48:35 tcunha Exp $ */
|
||||
/* $Id: tty-term.c,v 1.35 2009-10-28 23:01:44 tcunha Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||
@ -32,8 +32,8 @@ char *tty_term_strip(const char *);
|
||||
struct tty_terms tty_terms = SLIST_HEAD_INITIALIZER(tty_terms);
|
||||
|
||||
struct tty_term_code_entry tty_term_codes[NTTYCODE] = {
|
||||
{ TTYC_AX, TTYCODE_FLAG, "AX" },
|
||||
{ TTYC_ACSC, TTYCODE_STRING, "acsc" },
|
||||
{ TTYC_AX, TTYCODE_FLAG, "AX" },
|
||||
{ TTYC_BEL, TTYCODE_STRING, "bel" },
|
||||
{ TTYC_BLINK, TTYCODE_STRING, "blink" },
|
||||
{ TTYC_BOLD, TTYCODE_STRING, "bold" },
|
||||
@ -74,8 +74,26 @@ struct tty_term_code_entry tty_term_codes[NTTYCODE] = {
|
||||
{ TTYC_KCUD1, TTYCODE_STRING, "kcud1" },
|
||||
{ TTYC_KCUF1, TTYCODE_STRING, "kcuf1" },
|
||||
{ TTYC_KCUU1, TTYCODE_STRING, "kcuu1" },
|
||||
{ TTYC_KDC2, TTYCODE_STRING, "kDC" },
|
||||
{ TTYC_KDC3, TTYCODE_STRING, "kDC3" },
|
||||
{ TTYC_KDC4, TTYCODE_STRING, "kDC4" },
|
||||
{ TTYC_KDC5, TTYCODE_STRING, "kDC5" },
|
||||
{ TTYC_KDC6, TTYCODE_STRING, "kDC6" },
|
||||
{ TTYC_KDC7, TTYCODE_STRING, "kDC7" },
|
||||
{ TTYC_KDCH1, TTYCODE_STRING, "kdch1" },
|
||||
{ TTYC_KDN2, TTYCODE_STRING, "kDN" },
|
||||
{ TTYC_KDN3, TTYCODE_STRING, "kDN3" },
|
||||
{ TTYC_KDN4, TTYCODE_STRING, "kDN4" },
|
||||
{ TTYC_KDN5, TTYCODE_STRING, "kDN5" },
|
||||
{ TTYC_KDN6, TTYCODE_STRING, "kDN6" },
|
||||
{ TTYC_KDN7, TTYCODE_STRING, "kDN7" },
|
||||
{ TTYC_KEND, TTYCODE_STRING, "kend" },
|
||||
{ TTYC_KEND2, TTYCODE_STRING, "kEND" },
|
||||
{ TTYC_KEND3, TTYCODE_STRING, "kEND3" },
|
||||
{ TTYC_KEND4, TTYCODE_STRING, "kEND4" },
|
||||
{ TTYC_KEND5, TTYCODE_STRING, "kEND5" },
|
||||
{ TTYC_KEND6, TTYCODE_STRING, "kEND6" },
|
||||
{ TTYC_KEND7, TTYCODE_STRING, "kEND7" },
|
||||
{ TTYC_KF1, TTYCODE_STRING, "kf1" },
|
||||
{ TTYC_KF10, TTYCODE_STRING, "kf10" },
|
||||
{ TTYC_KF11, TTYCODE_STRING, "kf11" },
|
||||
@ -96,11 +114,53 @@ struct tty_term_code_entry tty_term_codes[NTTYCODE] = {
|
||||
{ TTYC_KF7, TTYCODE_STRING, "kf7" },
|
||||
{ TTYC_KF8, TTYCODE_STRING, "kf8" },
|
||||
{ TTYC_KF9, TTYCODE_STRING, "kf9" },
|
||||
{ TTYC_KHOM2, TTYCODE_STRING, "kHOM" },
|
||||
{ TTYC_KHOM3, TTYCODE_STRING, "kHOM3" },
|
||||
{ TTYC_KHOM4, TTYCODE_STRING, "kHOM4" },
|
||||
{ TTYC_KHOM5, TTYCODE_STRING, "kHOM5" },
|
||||
{ TTYC_KHOM6, TTYCODE_STRING, "kHOM6" },
|
||||
{ TTYC_KHOM7, TTYCODE_STRING, "kHOM7" },
|
||||
{ TTYC_KHOME, TTYCODE_STRING, "khome" },
|
||||
{ TTYC_KIC2, TTYCODE_STRING, "kIC" },
|
||||
{ TTYC_KIC3, TTYCODE_STRING, "kIC3" },
|
||||
{ TTYC_KIC4, TTYCODE_STRING, "kIC4" },
|
||||
{ TTYC_KIC5, TTYCODE_STRING, "kIC5" },
|
||||
{ TTYC_KIC6, TTYCODE_STRING, "kIC6" },
|
||||
{ TTYC_KIC7, TTYCODE_STRING, "kIC7" },
|
||||
{ TTYC_KICH1, TTYCODE_STRING, "kich1" },
|
||||
{ TTYC_KLFT2, TTYCODE_STRING, "kLFT" },
|
||||
{ TTYC_KLFT3, TTYCODE_STRING, "kLFT3" },
|
||||
{ TTYC_KLFT4, TTYCODE_STRING, "kLFT4" },
|
||||
{ TTYC_KLFT5, TTYCODE_STRING, "kLFT5" },
|
||||
{ TTYC_KLFT6, TTYCODE_STRING, "kLFT6" },
|
||||
{ TTYC_KLFT7, TTYCODE_STRING, "kLFT7" },
|
||||
{ TTYC_KMOUS, TTYCODE_STRING, "kmous" },
|
||||
{ TTYC_KNP, TTYCODE_STRING, "knp" },
|
||||
{ TTYC_KNXT2, TTYCODE_STRING, "kNXT" },
|
||||
{ TTYC_KNXT3, TTYCODE_STRING, "kNXT3" },
|
||||
{ TTYC_KNXT4, TTYCODE_STRING, "kNXT4" },
|
||||
{ TTYC_KNXT5, TTYCODE_STRING, "kNXT5" },
|
||||
{ TTYC_KNXT6, TTYCODE_STRING, "kNXT6" },
|
||||
{ TTYC_KNXT7, TTYCODE_STRING, "kNXT7" },
|
||||
{ TTYC_KPP, TTYCODE_STRING, "kpp" },
|
||||
{ TTYC_KPRV2, TTYCODE_STRING, "kPRV" },
|
||||
{ TTYC_KPRV3, TTYCODE_STRING, "kPRV3" },
|
||||
{ TTYC_KPRV4, TTYCODE_STRING, "kPRV4" },
|
||||
{ TTYC_KPRV5, TTYCODE_STRING, "kPRV5" },
|
||||
{ TTYC_KPRV6, TTYCODE_STRING, "kPRV6" },
|
||||
{ TTYC_KPRV7, TTYCODE_STRING, "kPRV7" },
|
||||
{ TTYC_KRIT2, TTYCODE_STRING, "kRIT" },
|
||||
{ TTYC_KRIT3, TTYCODE_STRING, "kRIT3" },
|
||||
{ TTYC_KRIT4, TTYCODE_STRING, "kRIT4" },
|
||||
{ TTYC_KRIT5, TTYCODE_STRING, "kRIT5" },
|
||||
{ TTYC_KRIT6, TTYCODE_STRING, "kRIT6" },
|
||||
{ TTYC_KRIT7, TTYCODE_STRING, "kRIT7" },
|
||||
{ TTYC_KUP2, TTYCODE_STRING, "kUP" },
|
||||
{ TTYC_KUP3, TTYCODE_STRING, "kUP3" },
|
||||
{ TTYC_KUP4, TTYCODE_STRING, "kUP4" },
|
||||
{ TTYC_KUP5, TTYCODE_STRING, "kUP5" },
|
||||
{ TTYC_KUP6, TTYCODE_STRING, "kUP6" },
|
||||
{ TTYC_KUP7, TTYCODE_STRING, "kUP7" },
|
||||
{ TTYC_OP, TTYCODE_STRING, "op" },
|
||||
{ TTYC_REV, TTYCODE_STRING, "rev" },
|
||||
{ TTYC_RI, TTYCODE_STRING, "ri" },
|
||||
|
Loading…
Reference in New Issue
Block a user