From affa37036a3b92a843ef073899db0888ffcb139c Mon Sep 17 00:00:00 2001 From: nicm Date: Mon, 9 Jan 2023 14:12:41 +0000 Subject: [PATCH] Fix behaviour with \007 (used the wrong tree for last change). --- usr.bin/tmux/tty-keys.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/usr.bin/tmux/tty-keys.c b/usr.bin/tmux/tty-keys.c index bce7632d77e..f5417b7e9d1 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.164 2023/01/09 07:57:14 nicm Exp $ */ +/* $OpenBSD: tty-keys.c,v 1.165 2023/01/09 14:12:41 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -1528,13 +1528,11 @@ tty_keys_colours(struct tty *tty, const char *buf, size_t len, size_t *size) } if (i == (sizeof tmp) - 1) return (-1); - if (tmp[i] == '\007') { - *size = 5 + i; - tmp[i] = '\0'; - } else { - *size = 6 + i; + if (tmp[i - 1] == '\033') tmp[i - 1] = '\0'; - } + else + tmp[i] = '\0'; + *size = 6 + i; n = colour_parseX11(tmp); if (n != -1 && buf[3] == '0') { -- 2.20.1