mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
fix: Windows cmd.exe not responding to correct CSI sequences due to ConPTY (#845)
This commit is contained in:
parent
e903320d95
commit
06e9fb8e67
1 changed files with 8 additions and 4 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
use std::{env, io::{Read, Write}};
|
use std::{env, io::Read};
|
||||||
|
|
||||||
use anyhow::{anyhow, Result};
|
use anyhow::{anyhow, Result};
|
||||||
use crossterm::terminal::{disable_raw_mode, enable_raw_mode};
|
use crossterm::{cursor::{RestorePosition, SavePosition}, execute, style::Print, terminal::{disable_raw_mode, enable_raw_mode}};
|
||||||
use tracing::warn;
|
use tracing::warn;
|
||||||
use yazi_shared::env_exists;
|
use yazi_shared::env_exists;
|
||||||
|
|
||||||
|
|
@ -113,8 +113,12 @@ impl Emulator {
|
||||||
|
|
||||||
pub fn via_csi() -> Result<Self> {
|
pub fn via_csi() -> Result<Self> {
|
||||||
enable_raw_mode()?;
|
enable_raw_mode()?;
|
||||||
std::io::stderr().write_all(b"\x1b[>q\x1b_Gi=31,s=1,v=1,a=q,t=d,f=24;AAAA\x1b\\\x1b[c")?;
|
execute!(
|
||||||
std::io::stderr().flush()?;
|
std::io::stderr(),
|
||||||
|
SavePosition,
|
||||||
|
Print("\x1b[>q\x1b_Gi=31,s=1,v=1,a=q,t=d,f=24;AAAA\x1b\\\x1b[c"),
|
||||||
|
RestorePosition
|
||||||
|
)?;
|
||||||
|
|
||||||
let mut stdin = std::io::stdin().lock();
|
let mut stdin = std::io::stdin().lock();
|
||||||
let mut buf = String::with_capacity(200);
|
let mut buf = String::with_capacity(200);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue