mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-21 23:01:05 +00:00
fix: avoid tmux interfering with kitty graphical sequences (#2734)
This commit is contained in:
parent
db60951783
commit
4e2a8bdf51
4 changed files with 7 additions and 11 deletions
|
|
@ -379,14 +379,14 @@ impl Kgp {
|
|||
|
||||
fn place(area: &Rect) -> Result<Vec<u8>> {
|
||||
let mut buf = Vec::with_capacity(area.width as usize * area.height as usize * 3 + 50);
|
||||
write!(buf, "\x1b[38;2;0;0;1m")?;
|
||||
for y in 0..area.height {
|
||||
write!(buf, "\x1b[{};{}H\x1b[38;5;1m", area.y + y + 1, area.x + 1)?;
|
||||
write!(buf, "\x1b[{};{}H", area.y + y + 1, area.x + 1)?;
|
||||
for x in 0..area.width {
|
||||
write!(buf, "\u{10EEEE}")?;
|
||||
write!(buf, "{}", *DIACRITICS.get(y as usize).unwrap_or(&DIACRITICS[0]))?;
|
||||
write!(buf, "{}", *DIACRITICS.get(x as usize).unwrap_or(&DIACRITICS[0]))?;
|
||||
}
|
||||
write!(buf, "\x1b[0m")?;
|
||||
}
|
||||
Ok(buf)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ impl Emulator {
|
|||
{
|
||||
use std::{io::Write, thread, time::Duration};
|
||||
|
||||
use crossterm::{cursor::{Hide, MoveTo, RestorePosition, SavePosition, Show}, queue};
|
||||
use crossterm::{cursor::{Hide, MoveTo, Show}, queue};
|
||||
|
||||
let mut w = TTY.lockout();
|
||||
|
||||
|
|
|
|||
|
|
@ -28,12 +28,8 @@ impl Tab {
|
|||
|
||||
// Visual selection
|
||||
if let Some((start, items)) = self.mode.visual_mut() {
|
||||
let after = self.current.cursor;
|
||||
|
||||
items.clear();
|
||||
for i in start.min(after)..=after.max(start) {
|
||||
items.insert(i);
|
||||
}
|
||||
let end = self.current.cursor;
|
||||
*items = (start.min(end)..=end.max(start)).collect();
|
||||
}
|
||||
|
||||
self.hover(None);
|
||||
|
|
|
|||
|
|
@ -32,12 +32,12 @@ impl Term {
|
|||
|
||||
execute!(
|
||||
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(Mux::csi("\x1b[?12$p")), // Request cursor blink status (DECSET)
|
||||
Print("\x1b[?u"), // Request keyboard enhancement flags (CSI u)
|
||||
Print(Mux::csi("\x1b[0c")), // Request device attributes
|
||||
yazi_term::If(!TMUX.get(), EnterAlternateScreen),
|
||||
yazi_term::If(TMUX.get(), EnterAlternateScreen),
|
||||
EnableBracketedPaste,
|
||||
yazi_term::If(!YAZI.mgr.mouse_events.is_empty(), EnableMouseCapture),
|
||||
)?;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue