mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
fix: do not passthrough DECRQM query to tmux
This commit is contained in:
parent
c0c0877d42
commit
9a804bac9c
1 changed files with 5 additions and 5 deletions
|
|
@ -18,7 +18,6 @@ pub(super) struct Term {
|
||||||
|
|
||||||
impl Term {
|
impl Term {
|
||||||
pub(super) fn start() -> Result<Self> {
|
pub(super) fn start() -> Result<Self> {
|
||||||
static SKIP: SyncCell<bool> = SyncCell::new(false);
|
|
||||||
let mut term = Self {
|
let mut term = Self {
|
||||||
inner: Terminal::new(CrosstermBackend::new(TTY.writer()))?,
|
inner: Terminal::new(CrosstermBackend::new(TTY.writer()))?,
|
||||||
last_area: Default::default(),
|
last_area: Default::default(),
|
||||||
|
|
@ -26,7 +25,8 @@ impl Term {
|
||||||
};
|
};
|
||||||
|
|
||||||
enable_raw_mode()?;
|
enable_raw_mode()?;
|
||||||
if SKIP.replace(true) && yazi_adapter::TMUX.get() {
|
static FIRST: SyncCell<bool> = SyncCell::new(false);
|
||||||
|
if FIRST.replace(true) && yazi_adapter::TMUX.get() {
|
||||||
yazi_adapter::Mux::tmux_passthrough();
|
yazi_adapter::Mux::tmux_passthrough();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -34,16 +34,15 @@ impl Term {
|
||||||
TTY.writer(),
|
TTY.writer(),
|
||||||
yazi_term::If(!TMUX.get(), EnterAlternateScreen),
|
yazi_term::If(!TMUX.get(), EnterAlternateScreen),
|
||||||
Print("\x1bP$q q\x1b\\"), // Request cursor shape (DECRQSS query for DECSCUSR)
|
Print("\x1bP$q q\x1b\\"), // Request cursor shape (DECRQSS query for DECSCUSR)
|
||||||
Print(Mux::csi("\x1b[?12$p")), // Request cursor blink status (DECRQM query for DECSET 12)
|
Print("\x1b[?12$p"), // Request cursor blink status (DECRQM query for DECSET 12)
|
||||||
Print("\x1b[?u"), // Request keyboard enhancement flags (CSI u)
|
Print("\x1b[?u"), // Request keyboard enhancement flags (CSI u)
|
||||||
Print(Mux::csi("\x1b[0c")), // Request device attributes
|
Print("\x1b[0c"), // Request device attributes
|
||||||
yazi_term::If(TMUX.get(), EnterAlternateScreen),
|
yazi_term::If(TMUX.get(), EnterAlternateScreen),
|
||||||
EnableBracketedPaste,
|
EnableBracketedPaste,
|
||||||
yazi_term::If(!YAZI.mgr.mouse_events.get().is_empty(), EnableMouseCapture),
|
yazi_term::If(!YAZI.mgr.mouse_events.get().is_empty(), EnableMouseCapture),
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
let resp = Emulator::read_until_da1();
|
let resp = Emulator::read_until_da1();
|
||||||
Mux::tmux_drain()?;
|
|
||||||
yazi_term::RestoreCursor::store(&resp);
|
yazi_term::RestoreCursor::store(&resp);
|
||||||
|
|
||||||
CSI_U.store(resp.contains("\x1b[?0u"), Ordering::Relaxed);
|
CSI_U.store(resp.contains("\x1b[?0u"), Ordering::Relaxed);
|
||||||
|
|
@ -62,6 +61,7 @@ impl Term {
|
||||||
term.hide_cursor()?;
|
term.hide_cursor()?;
|
||||||
term.clear()?;
|
term.clear()?;
|
||||||
term.flush()?;
|
term.flush()?;
|
||||||
|
Mux::tmux_drain()?;
|
||||||
Ok(term)
|
Ok(term)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue