From 1ceebdf580496724f75c7aa3c8318af997b3782d Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Wed, 25 Jun 2025 13:33:27 +0200 Subject: [PATCH] Fix some CSI commands being sent to old midnight commander Commit 97581ed20ff (Do send bracketed paste inside midnight commander, 2024-10-12) accidentally started sending CSI commands such as "CSI >5;0m", which we intentionally didn't do for some old versions of Midnight Commander, which fail to parse them. Fix that. Fixes #11617 --- src/input_common.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/input_common.rs b/src/input_common.rs index 865c39904..b1766f22f 100644 --- a/src/input_common.rs +++ b/src/input_common.rs @@ -710,7 +710,9 @@ pub(crate) fn terminal_protocols_disable_ifn() { if !TERMINAL_PROTOCOLS.load(Ordering::Acquire) { return; } - let sequences = if !feature_test(FeatureFlag::keyboard_protocols) { + let sequences = if !feature_test(FeatureFlag::keyboard_protocols) + || IN_MIDNIGHT_COMMANDER_PRE_CSI_U.load() + { "\x1b[?2004l" } else if IN_JETBRAINS.load() || IN_ITERM_PRE_CSI_U.load() { concat!("\x1b[?2004l", "\x1b[>4;0m", "\x1b>",)