Skip to content

Commit

Permalink
Remove modifyOtherKeys enablement (#324)
Browse files Browse the repository at this point in the history
  • Loading branch information
ulyssa committed Aug 17, 2024
1 parent 94999dc commit 657e61f
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -916,31 +916,6 @@ async fn login_normal(
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.
fn setup_tty(title: &str, enable_enhanced_keys: bool) -> std::io::Result<()> {
let title = format!("iamb ({})", title);
Expand All @@ -955,8 +930,6 @@ fn setup_tty(title: &str, enable_enhanced_keys: bool) -> std::io::Result<()> {
stdout(),
PushKeyboardEnhancementFlags(KeyboardEnhancementFlags::DISAMBIGUATE_ESCAPE_CODES)
)?;
} else {
crossterm::queue!(stdout(), EnableModifyOtherKeys)?;
}

crossterm::execute!(stdout(), EnableBracketedPaste, EnableFocusChange, SetTitle(title))
Expand All @@ -970,7 +943,6 @@ fn restore_tty(enable_enhanced_keys: bool) {

let _ = crossterm::execute!(
stdout(),
DisableModifyOtherKeys,
DisableBracketedPaste,
DisableFocusChange,
LeaveAlternateScreen,
Expand Down

0 comments on commit 657e61f

Please sign in to comment.