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