2020-10-10 18:40:14 +03:00
|
|
|
# ActivateTab
|
|
|
|
|
|
|
|
Activate the tab specified by the argument value. eg: `0` activates the
|
|
|
|
leftmost tab, while `1` activates the second tab from the left, and so on.
|
|
|
|
|
|
|
|
*since: 20200620-160318-e00b076c*
|
|
|
|
|
|
|
|
`ActivateTab` now accepts negative numbers; these wrap around from the start
|
|
|
|
of the tabs to the end, so `-1` references the right-most tab, `-2` the tab
|
|
|
|
to its left and so on.
|
|
|
|
|
|
|
|
|
|
|
|
```lua
|
2022-06-25 16:58:10 +03:00
|
|
|
local wezterm = require 'wezterm'
|
|
|
|
local act = wezterm.action
|
2020-10-10 18:40:14 +03:00
|
|
|
|
|
|
|
local mykeys = {}
|
|
|
|
for i = 1, 8 do
|
|
|
|
-- CTRL+ALT + number to activate that tab
|
|
|
|
table.insert(mykeys, {
|
|
|
|
key=tostring(i),
|
|
|
|
mods="CTRL|ALT",
|
2022-06-25 16:58:10 +03:00
|
|
|
action=act.ActivateTab(i-1),
|
2020-10-10 18:40:14 +03:00
|
|
|
})
|
|
|
|
-- F1 through F8 to activate that tab
|
|
|
|
table.insert(mykeys, {
|
|
|
|
key="F" .. tostring(i),
|
2022-06-25 16:58:10 +03:00
|
|
|
action=act.ActivateTab(i-1),
|
2020-10-10 18:40:14 +03:00
|
|
|
})
|
|
|
|
end
|
|
|
|
|
|
|
|
return {
|
|
|
|
keys = mykeys,
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
|