mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-13 20:42:45 +08:00
Work around mc and dvtm not responding to Primary DA
The two terminals Midnight Commander and dvtm are special in that
they filter requests (or perhaps responses) like
printf "\x1b[0c"
and don't implement the response themselves -- so we never get
one. Let's work around that until we can fix it.
Disable the kitty protocol in mc for now (to keep the code simple),
though we could certainly re-enable it.
Fixes 64859fc242
(Blocking wait for responses to startup queries, 2025-01-25).
This commit is contained in:
parent
90e916e164
commit
fff421ad9c
|
@ -470,11 +470,16 @@ pub fn kitty_progressive_enhancements_query() -> &'static [u8] {
|
|||
}
|
||||
|
||||
static IS_TMUX: RelaxedAtomicBool = RelaxedAtomicBool::new(false);
|
||||
pub static IN_MIDNIGHT_COMMANDER_PRE_CSI_U: RelaxedAtomicBool = RelaxedAtomicBool::new(false);
|
||||
|
||||
pub(crate) static IN_MIDNIGHT_COMMANDER: RelaxedAtomicBool = RelaxedAtomicBool::new(false);
|
||||
pub(crate) static IN_DVTM: RelaxedAtomicBool = RelaxedAtomicBool::new(false);
|
||||
static IN_ITERM_PRE_CSI_U: RelaxedAtomicBool = RelaxedAtomicBool::new(false);
|
||||
|
||||
pub fn terminal_protocol_hacks() {
|
||||
use std::env::var_os;
|
||||
IN_MIDNIGHT_COMMANDER.store(var_os("MC_TMPDIR").is_some());
|
||||
IN_DVTM
|
||||
.store(var_os("TERM").is_some_and(|term| term.as_os_str().as_bytes() == b"dvtm-256color"));
|
||||
IS_TMUX.store(var_os("TMUX").is_some());
|
||||
IN_ITERM_PRE_CSI_U.store(
|
||||
var_os("LC_TERMINAL").is_some_and(|term| term.as_os_str().as_bytes() == b"iTerm2")
|
||||
|
@ -522,9 +527,6 @@ pub fn terminal_protocols_enable_ifn() {
|
|||
}
|
||||
did_write.store(true);
|
||||
}
|
||||
if IN_MIDNIGHT_COMMANDER_PRE_CSI_U.load() {
|
||||
return;
|
||||
}
|
||||
let kitty_keyboard_supported = KITTY_KEYBOARD_SUPPORTED.load(Ordering::Relaxed);
|
||||
if kitty_keyboard_supported == Capability::Unknown as _ {
|
||||
return;
|
||||
|
|
|
@ -88,7 +88,8 @@ use crate::input_common::CursorPositionWait;
|
|||
use crate::input_common::ImplicitEvent;
|
||||
use crate::input_common::InputEventQueuer;
|
||||
use crate::input_common::Queried;
|
||||
use crate::input_common::IN_MIDNIGHT_COMMANDER_PRE_CSI_U;
|
||||
use crate::input_common::IN_DVTM;
|
||||
use crate::input_common::IN_MIDNIGHT_COMMANDER;
|
||||
use crate::input_common::KITTY_KEYBOARD_SUPPORTED;
|
||||
use crate::input_common::SYNCHRONIZED_OUTPUT_SUPPORTED;
|
||||
use crate::input_common::{
|
||||
|
@ -2166,7 +2167,7 @@ impl<'a> Reader<'a> {
|
|||
}
|
||||
|
||||
if zelf.blocking_wait == Some(BlockingWait::Startup(Queried::NotYet)) {
|
||||
if is_dumb() {
|
||||
if is_dumb() || IN_MIDNIGHT_COMMANDER.load() || IN_DVTM.load() {
|
||||
zelf.blocking_wait = None;
|
||||
} else {
|
||||
zelf.blocking_wait = Some(BlockingWait::Startup(Queried::Once));
|
||||
|
@ -4415,10 +4416,6 @@ fn reader_interactive_init(parser: &Parser) {
|
|||
.set_one(L!("_"), EnvMode::GLOBAL, L!("fish").to_owned());
|
||||
|
||||
terminal_protocol_hacks();
|
||||
IN_MIDNIGHT_COMMANDER_PRE_CSI_U.store(
|
||||
parser.vars().get_unless_empty(L!("MC_TMPDIR")).is_some()
|
||||
&& parser.vars().get_unless_empty(L!("__mc_csi_u")).is_none(),
|
||||
);
|
||||
}
|
||||
|
||||
struct DisplayAsHex<'a>(&'a str);
|
||||
|
|
Loading…
Reference in New Issue
Block a user