mirror of
https://github.com/youwen5/iamb.git
synced 2025-06-19 21:29:52 -07:00
Remove modifyOtherKeys enablement (#324)
This commit is contained in:
parent
94999dc4c0
commit
657e61fe2e
1 changed files with 0 additions and 28 deletions
28
src/main.rs
28
src/main.rs
|
@ -916,31 +916,6 @@ async fn login_normal(
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
struct EnableModifyOtherKeys;
|
|
||||||
struct DisableModifyOtherKeys;
|
|
||||||
|
|
||||||
impl crossterm::Command for EnableModifyOtherKeys {
|
|
||||||
fn write_ansi(&self, f: &mut impl std::fmt::Write) -> std::fmt::Result {
|
|
||||||
write!(f, "\x1B[>4;2m")
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(windows)]
|
|
||||||
fn execute_winapi(&self) -> std::io::Result<()> {
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl crossterm::Command for DisableModifyOtherKeys {
|
|
||||||
fn write_ansi(&self, f: &mut impl std::fmt::Write) -> std::fmt::Result {
|
|
||||||
write!(f, "\x1B[>4;0m")
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(windows)]
|
|
||||||
fn execute_winapi(&self) -> std::io::Result<()> {
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Set up the terminal for drawing the TUI, and getting additional info.
|
/// Set up the terminal for drawing the TUI, and getting additional info.
|
||||||
fn setup_tty(title: &str, enable_enhanced_keys: bool) -> std::io::Result<()> {
|
fn setup_tty(title: &str, enable_enhanced_keys: bool) -> std::io::Result<()> {
|
||||||
let title = format!("iamb ({})", title);
|
let title = format!("iamb ({})", title);
|
||||||
|
@ -955,8 +930,6 @@ fn setup_tty(title: &str, enable_enhanced_keys: bool) -> std::io::Result<()> {
|
||||||
stdout(),
|
stdout(),
|
||||||
PushKeyboardEnhancementFlags(KeyboardEnhancementFlags::DISAMBIGUATE_ESCAPE_CODES)
|
PushKeyboardEnhancementFlags(KeyboardEnhancementFlags::DISAMBIGUATE_ESCAPE_CODES)
|
||||||
)?;
|
)?;
|
||||||
} else {
|
|
||||||
crossterm::queue!(stdout(), EnableModifyOtherKeys)?;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
crossterm::execute!(stdout(), EnableBracketedPaste, EnableFocusChange, SetTitle(title))
|
crossterm::execute!(stdout(), EnableBracketedPaste, EnableFocusChange, SetTitle(title))
|
||||||
|
@ -970,7 +943,6 @@ fn restore_tty(enable_enhanced_keys: bool) {
|
||||||
|
|
||||||
let _ = crossterm::execute!(
|
let _ = crossterm::execute!(
|
||||||
stdout(),
|
stdout(),
|
||||||
DisableModifyOtherKeys,
|
|
||||||
DisableBracketedPaste,
|
DisableBracketedPaste,
|
||||||
DisableFocusChange,
|
DisableFocusChange,
|
||||||
LeaveAlternateScreen,
|
LeaveAlternateScreen,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue