Replies: 1 comment 1 reply
-
Try something like this: local wezterm = require 'wezterm'
local act = wezterm.action
return {
keys = {
{
key='y', mods='CMD', action = wezterm.action_callback(function(window, pane)
local mux_window = window:mux_window()
-- determine the index of the current tab
-- https://wezfurlong.org/wezterm/config/lua/mux-window/tabs_with_info.html
local tabs = mux_window:tabs_with_info()
local current_index = 0
for _, tab_info in ipairs(tabs) do
if tab_info.is_active then
current_index = tab_info.index
break
end
end
-- spawn a new tab; it will be made active
-- https://wezfurlong.org/wezterm/config/lua/mux-window/spawn_tab.html
mux_window:spawn_tab{}
-- Move the new active tab to the right of the previously active tab
window:perform_action(act.MoveTab(current_index+1), pane)
end)
}
},
} |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently creating tab using Ctrl+Shift+T will create tab in the end of the tab list. May I know if possible to create just next to the current tab?
I have tried something like this:
Thank you in advance for any suggestions!
Beta Was this translation helpful? Give feedback.
All reactions