Add explicit keys for the bracketed paste sequences, both to avoid mix

ups with other keys and to make logs clearer.
This commit is contained in:
nicm 2017-06-12 07:04:24 +00:00
parent adcd5aff6f
commit 8037159f93
4 changed files with 16 additions and 0 deletions

View File

@ -46,6 +46,10 @@ static const struct input_key_ent input_keys[] = {
/* Backspace key. */
{ KEYC_BSPACE, "\177", 0 },
/* Paste keys. */
{ KEYC_PASTE_START, "\033[200~", 0 },
{ KEYC_PASTE_END, "\033[201~", 0 },
/* Function keys. */
{ KEYC_F1, "\033OP", 0 },
{ KEYC_F2, "\033OQ", 0 },

View File

@ -251,6 +251,10 @@ key_string_lookup_key(key_code key)
return ("FocusIn");
if (key == KEYC_FOCUS_OUT)
return ("FocusOut");
if (key == KEYC_PASTE_START)
return ("PasteStart");
if (key == KEYC_PASTE_END)
return ("PasteEnd");
if (key == KEYC_MOUSE)
return ("Mouse");
if (key == KEYC_DRAGGING)

4
tmux.h
View File

@ -127,6 +127,10 @@ enum {
KEYC_FOCUS_IN = KEYC_BASE,
KEYC_FOCUS_OUT,
/* Paste brackets. */
KEYC_PASTE_START,
KEYC_PASTE_END,
/* Mouse keys. */
KEYC_MOUSE, /* unclassified mouse event */
KEYC_DRAGGING, /* dragging in progress */

View File

@ -165,6 +165,10 @@ static const struct tty_default_key_raw tty_default_raw_keys[] = {
/* Focus tracking. */
{ "\033[I", KEYC_FOCUS_IN },
{ "\033[O", KEYC_FOCUS_OUT },
/* Paste keys. */
{ "\033[200~", KEYC_PASTE_START },
{ "\033[201~", KEYC_PASTE_END },
};
/* Default terminfo(5) keys. */