tenseleyflow/fackr / 32e4ed7

Browse files

feat: add Ctrl+j as alternate terminal toggle

Ctrl+` can conflict with tmux prefix mappings, so Ctrl+j
provides a reliable alternative for toggling the terminal.
Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
32e4ed70563ab5abd38f6fdf8ac7f394f04aee1f
Parents
1f7ab06
Tree
4fcd788

1 changed file

StatusFile+-
M src/editor/state.rs 5 3
src/editor/state.rsmodified
@@ -1401,9 +1401,11 @@ impl Editor {
14011401
     fn process_key(&mut self, key_event: KeyEvent) -> Result<()> {
14021402
         use crossterm::event::{KeyCode, KeyModifiers};
14031403
 
1404
-        // Ctrl+` toggles terminal (works in both editor and terminal mode)
1405
-        // Backtick is ` (grave accent)
1406
-        if key_event.code == KeyCode::Char('`') && key_event.modifiers.contains(KeyModifiers::CONTROL) {
1404
+        // Ctrl+` or Ctrl+j toggles terminal (works in both editor and terminal mode)
1405
+        // Ctrl+j is alternate since Ctrl+` can conflict with tmux
1406
+        if (key_event.code == KeyCode::Char('`') || key_event.code == KeyCode::Char('j'))
1407
+            && key_event.modifiers.contains(KeyModifiers::CONTROL)
1408
+        {
14071409
             let _ = self.terminal.toggle();
14081410
             return Ok(());
14091411
         }