From c3e38951a46b1c4f890ac4792876ddfbfc310bc9 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Sun, 28 Oct 2018 15:34:28 +0000 Subject: Do not check for a key again without an escape if only \033 is present. --- usr.bin/tmux/tty-keys.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/tmux/tty-keys.c b/usr.bin/tmux/tty-keys.c index 0605b05e7a8..8a72a498cf0 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.104 2018/10/18 08:04:14 nicm Exp $ */ +/* $OpenBSD: tty-keys.c,v 1.105 2018/10/28 15:34:27 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -624,7 +624,7 @@ first_key: * If not a complete key, look for key with an escape prefix (meta * modifier). */ - if (*buf == '\033') { + if (*buf == '\033' && len > 1) { /* Look for a key without the escape. */ n = tty_keys_next1(tty, buf + 1, len - 1, &key, &size, expired); if (n == 0) { /* found */ -- cgit v1.2.3