1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-29 00:21:57 +03:00

add basic tab related key bindings

This commit is contained in:
Wez Furlong 2018-03-04 13:31:16 -08:00
parent eb7153eb50
commit 816925424a
2 changed files with 14 additions and 0 deletions

View File

@ -26,6 +26,12 @@ pub trait TerminalHost {
/// Create a new tab in the current window
fn new_tab(&mut self) {}
/// Switch to a specific tab
fn activate_tab(&mut self, _tab: usize) {}
/// Activate a relative tab number
fn activate_tab_relative(&mut self, _delta: isize) {}
/// Toggle full-screen mode
fn toggle_full_screen(&mut self) {}
}

View File

@ -620,6 +620,14 @@ impl TerminalState {
host.new_tab();
return Ok(());
}
if mods == (KeyModifiers::SUPER | KeyModifiers::SHIFT) && key == KeyCode::Char('[') {
host.activate_tab_relative(-1);
return Ok(());
}
if mods == (KeyModifiers::SUPER | KeyModifiers::SHIFT) && key == KeyCode::Char(']') {
host.activate_tab_relative(1);
return Ok(());
}
let to_send = match (key, ctrl, alt, shift, self.application_cursor_keys) {
(Char('\n'), _, ALT, ..) => {