Fix some CSI commands being sent to old midnight commander

Commit 97581ed20f (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
This commit is contained in:
Johannes Altmanninger
2025-06-25 13:33:27 +02:00
parent 335f91babd
commit 1ceebdf580

View File

@@ -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>",)