Commit 657e61fe2e

657e61fe2ef6e27caa30828cb54c23e81792eae2

parent: 94999dc4c0

Unregistered key

Ulyssa <git@ulyssa.dev> · 2024-08-17 03:06 UTC
committer: <noreply@github.com>

Remove modifyOtherKeys enablement (#324)

Layout: unified · split

src/main.rs −28
@@ -916,31 +916,6 @@ async fn login_normal(
916916 Ok(())
917917}
918918
919struct EnableModifyOtherKeys;
920struct DisableModifyOtherKeys;
921
922impl crossterm::Command for EnableModifyOtherKeys {
923 fn write_ansi(&self, f: &mut impl std::fmt::Write) -> std::fmt::Result {
924 write!(f, "\x1B[>4;2m")
925 }
926
927 #[cfg(windows)]
928 fn execute_winapi(&self) -> std::io::Result<()> {
929 Ok(())
930 }
931}
932
933impl crossterm::Command for DisableModifyOtherKeys {
934 fn write_ansi(&self, f: &mut impl std::fmt::Write) -> std::fmt::Result {
935 write!(f, "\x1B[>4;0m")
936 }
937
938 #[cfg(windows)]
939 fn execute_winapi(&self) -> std::io::Result<()> {
940 Ok(())
941 }
942}
943
944919/// Set up the terminal for drawing the TUI, and getting additional info.
945920fn setup_tty(title: &str, enable_enhanced_keys: bool) -> std::io::Result<()> {
946921 let title = format!("iamb ({})", title);
@@ -955,8 +930,6 @@ fn setup_tty(title: &str, enable_enhanced_keys: bool) -> std::io::Result<()> {
955930 stdout(),
956931 PushKeyboardEnhancementFlags(KeyboardEnhancementFlags::DISAMBIGUATE_ESCAPE_CODES)
957932 )?;
958 } else {
959 crossterm::queue!(stdout(), EnableModifyOtherKeys)?;
960933 }
961934
962935 crossterm::execute!(stdout(), EnableBracketedPaste, EnableFocusChange, SetTitle(title))
@@ -970,7 +943,6 @@ fn restore_tty(enable_enhanced_keys: bool) {
970943
971944 let _ = crossterm::execute!(
972945 stdout(),
973 DisableModifyOtherKeys,
974946 DisableBracketedPaste,
975947 DisableFocusChange,
976948 LeaveAlternateScreen,