From aa01530488e0b693172b513836fa6881d387ea8a Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Thu, 10 Feb 2022 18:51:19 +0000 Subject: [PATCH] Fix handling of shifted SCO function keys. A user points out that this has regressed since 0.76, probably when I reorganised the keyboard control-sequence formatting into centralised helper functions in terminal.c. The SCO function keys should behave differently when you press Shift or Ctrl or both. For example, F1 should generate ESC[M bare, ESC[Y with Shift, Esc[k with Ctrl, Esc[w with Shift+Ctrl. But in fact, Shift was having no effect, so those tests would give ESC[M twice and ESC[k twice. That was because I was setting 'shift = false' for all function key types except FUNKY_XTERM_216, after modifying the derived 'index' value. But the SCO branch of the code doesn't use 'index' (it wouldn't have the right value in any case), so the sole effect was to forget about Shift. Easily fixed by disabling that branch for FUNKY_SCO too. --- terminal/terminal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terminal/terminal.c b/terminal/terminal.c index 3398cd59..923ed03e 100644 --- a/terminal/terminal.c +++ b/terminal/terminal.c @@ -7373,7 +7373,7 @@ int format_function_key(char *buf, Terminal *term, int key_number, assert(key_number < lenof(key_number_to_tilde_code)); int index = key_number; - if (term->funky_type != FUNKY_XTERM_216) { + if (term->funky_type != FUNKY_XTERM_216 && term->funky_type != FUNKY_SCO) { if (shift && index <= 10) { shift = false; index += 10;