Commit 657e61fe2e
Unregistered key
Layout: unified · split
src/main.rs −28
| @@ -916,31 +916,6 @@ async fn login_normal( | ||
| 916 | 916 | Ok(()) |
| 917 | 917 | } |
| 918 | 918 | |
| 919 | struct EnableModifyOtherKeys; | |
| 920 | struct DisableModifyOtherKeys; | |
| 921 | ||
| 922 | impl 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 | ||
| 933 | impl 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 | ||
| 944 | 919 | /// Set up the terminal for drawing the TUI, and getting additional info. |
| 945 | 920 | fn setup_tty(title: &str, enable_enhanced_keys: bool) -> std::io::Result<()> { |
| 946 | 921 | let title = format!("iamb ({})", title); |
| @@ -955,8 +930,6 @@ fn setup_tty(title: &str, enable_enhanced_keys: bool) -> std::io::Result<()> { | ||
| 955 | 930 | stdout(), |
| 956 | 931 | PushKeyboardEnhancementFlags(KeyboardEnhancementFlags::DISAMBIGUATE_ESCAPE_CODES) |
| 957 | 932 | )?; |
| 958 | } else { | |
| 959 | crossterm::queue!(stdout(), EnableModifyOtherKeys)?; | |
| 960 | 933 | } |
| 961 | 934 | |
| 962 | 935 | crossterm::execute!(stdout(), EnableBracketedPaste, EnableFocusChange, SetTitle(title)) |
| @@ -970,7 +943,6 @@ fn restore_tty(enable_enhanced_keys: bool) { | ||
| 970 | 943 | |
| 971 | 944 | let _ = crossterm::execute!( |
| 972 | 945 | stdout(), |
| 973 | DisableModifyOtherKeys, | |
| 974 | 946 | DisableBracketedPaste, |
| 975 | 947 | DisableFocusChange, |
| 976 | 948 | LeaveAlternateScreen, |