From 6df50790cdbe5103dd9ec26e2d4e19406cb94737 Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@telfort.nl>
Date: Tue, 21 Jan 2020 17:55:04 +0100
Subject: [PATCH] input: prevent unintentional marking of text for shifted Meta
 keystrokes

The Shift detection on a Linux console was meant to affect only the
dedicated cursor-movement keys, not <Shift+Meta+character>.

This fixes https://savannah.gnu.org/bugs/?57598.
Indirectly-reported-by: Brand Huntsman <alpha@qzx.com>
---
 src/winio.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/winio.c b/src/winio.c
index a0cbbb08..248d563a 100644
--- a/src/winio.c
+++ b/src/winio.c
@@ -599,7 +599,8 @@ int parse_kbinput(WINDOW *win)
 		if (modifiers & 0x01) {
 			if (retval == TAB_CODE)
 				return SHIFT_TAB;
-			shift_held = TRUE;
+			if (!meta_key)
+				shift_held = TRUE;
 		}
 		/* Is Alt being held? */
 		if (modifiers == 0x08) {