wezterm: ActivateTab now accepts negative numbers

This allows setting up shortcuts relative to the final tab in
a window, rather than always being relative to the first.

The default assignment for CTRL+SHIFT+9 is now `ActivateTab=-1`
as a convenient way to always reach the last tab.

refs: https://github.com/wez/wezterm/issues/228
This commit is contained in:
Wez Furlong committed 2020-06-20 12:45:09 -07:00
1 parent d1dd28df46
commit 843ce152ec
4 files changed
+25 -8

No files matched your search

+3 -3
View File
@@ -82,7 +82,7 @@ pub enum KeyAssignment {
IncreaseFontSize,
DecreaseFontSize,
ResetFontSize,
ActivateTab(usize),
ActivateTab(isize),
SendString(String),
Nop,
DisableDefaultAssignment,
@@ -207,7 +207,7 @@ impl InputMap {
[KeyModifiers::SUPER, KeyCode::Char('6'), ActivateTab(5)],
[KeyModifiers::SUPER, KeyCode::Char('7'), ActivateTab(6)],
[KeyModifiers::SUPER, KeyCode::Char('8'), ActivateTab(7)],
[KeyModifiers::SUPER, KeyCode::Char('9'), ActivateTab(8)],
[KeyModifiers::SUPER, KeyCode::Char('9'), ActivateTab(-1)],
[KeyModifiers::SUPER, KeyCode::Char('w'), CloseCurrentTab],
[ctrl_shift, KeyCode::Char('1'), ActivateTab(0)],
[ctrl_shift, KeyCode::Char('2'), ActivateTab(1)],
@@ -217,7 +217,7 @@ impl InputMap {
[ctrl_shift, KeyCode::Char('6'), ActivateTab(5)],
[ctrl_shift, KeyCode::Char('7'), ActivateTab(6)],
[ctrl_shift, KeyCode::Char('8'), ActivateTab(7)],
[ctrl_shift, KeyCode::Char('9'), ActivateTab(8)],
[ctrl_shift, KeyCode::Char('9'), ActivateTab(-1)],
[ctrl_shift, KeyCode::Char('W'), CloseCurrentTab],
[
KeyModifiers::SUPER | KeyModifiers::SHIFT,