From b99601f2dced7d10b8de3e0b83ee41806582ae89 Mon Sep 17 00:00:00 2001 From: nicm Date: Mon, 12 Jun 2017 07:04:24 +0000 Subject: [PATCH] Add explicit keys for the bracketed paste sequences, both to avoid mix ups with other keys and to make logs clearer. --- usr.bin/tmux/input-keys.c | 6 +++++- usr.bin/tmux/key-string.c | 6 +++++- usr.bin/tmux/tmux.h | 6 +++++- usr.bin/tmux/tty-keys.c | 6 +++++- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/usr.bin/tmux/input-keys.c b/usr.bin/tmux/input-keys.c index 284fddbeb25..6bd06689e98 100644 --- a/usr.bin/tmux/input-keys.c +++ b/usr.bin/tmux/input-keys.c @@ -1,4 +1,4 @@ -/* $OpenBSD: input-keys.c,v 1.60 2017/05/07 21:25:59 nicm Exp $ */ +/* $OpenBSD: input-keys.c,v 1.61 2017/06/12 07:04:24 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -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 }, diff --git a/usr.bin/tmux/key-string.c b/usr.bin/tmux/key-string.c index cbeb81c59e4..6f961a03d86 100644 --- a/usr.bin/tmux/key-string.c +++ b/usr.bin/tmux/key-string.c @@ -1,4 +1,4 @@ -/* $OpenBSD: key-string.c,v 1.45 2017/02/22 09:01:32 nicm Exp $ */ +/* $OpenBSD: key-string.c,v 1.46 2017/06/12 07:04:24 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -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) diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h index dacca80a120..77a961a82be 100644 --- a/usr.bin/tmux/tmux.h +++ b/usr.bin/tmux/tmux.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tmux.h,v 1.785 2017/06/09 16:01:39 nicm Exp $ */ +/* $OpenBSD: tmux.h,v 1.786 2017/06/12 07:04:24 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -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 */ diff --git a/usr.bin/tmux/tty-keys.c b/usr.bin/tmux/tty-keys.c index cd5a196b1ff..f9be3fee4c2 100644 --- a/usr.bin/tmux/tty-keys.c +++ b/usr.bin/tmux/tty-keys.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty-keys.c,v 1.97 2017/05/07 21:25:59 nicm Exp $ */ +/* $OpenBSD: tty-keys.c,v 1.98 2017/06/12 07:04:24 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -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. */ -- 2.20.1