Wezterm + TMUX Integration Question #263
-
I wanted to ask if there is compatibility between Wezterm and TMUX using this plugin. When I have the plugin enabled in my Wezterm configuration switching between TMUX panes using ctrl+h,j,k,l. doesn't seem to work anymore. If I disable the plugin in Wezterm then I can switch panes as normal. Here is my Wezterm config: local wezterm = require("wezterm")
local smart_splits = wezterm.plugin.require("https://github.com/mrjones2014/smart-splits.nvim")
local config = wezterm.config_builder()
local is_windows = wezterm.target_triple:find("windows") ~= nil
config.color_scheme = "Gruvbox Dark (Gogh)"
config.font = wezterm.font("FiraCode Nerd Font")
config.font_size = 14
config.window_decorations = "TITLE|RESIZE"
config.tab_bar_at_bottom = true
config.use_fancy_tab_bar = false
config.window_close_confirmation = "AlwaysPrompt"
config.term = "wezterm"
if is_windows then
config.default_prog = { "powershell.exe" }
else
config.default_prog = { "zsh" }
end
config.hide_tab_bar_if_only_one_tab = true
config.adjust_window_size_when_changing_font_size = false
config.leader = { key = "a", mods = "CTRL", timeout_milliseconds = 1000 }
config.keys = {
{ key = "v", mods = "LEADER", action = wezterm.action({ SplitVertical = { domain = "CurrentPaneDomain" } }) },
{ key = "h", mods = "LEADER", action = wezterm.action({ SplitHorizontal = { domain = "CurrentPaneDomain" } }) },
{ key = "z", mods = "LEADER", action = "TogglePaneZoomState" },
{ key = "c", mods = "LEADER", action = wezterm.action({ SpawnTab = "CurrentPaneDomain" }) },
{ key = "1", mods = "LEADER", action = wezterm.action({ ActivateTab = 0 }) },
{ key = "2", mods = "LEADER", action = wezterm.action({ ActivateTab = 1 }) },
{ key = "3", mods = "LEADER", action = wezterm.action({ ActivateTab = 2 }) },
{ key = "4", mods = "LEADER", action = wezterm.action({ ActivateTab = 3 }) },
{ key = "5", mods = "LEADER", action = wezterm.action({ ActivateTab = 4 }) },
{ key = "6", mods = "LEADER", action = wezterm.action({ ActivateTab = 5 }) },
{ key = "7", mods = "LEADER", action = wezterm.action({ ActivateTab = 6 }) },
{ key = "8", mods = "LEADER", action = wezterm.action({ ActivateTab = 7 }) },
{ key = "9", mods = "LEADER", action = wezterm.action({ ActivateTab = 8 }) },
{ key = "&", mods = "LEADER|SHIFT", action = wezterm.action({ CloseCurrentTab = { confirm = true } }) },
{ key = "d", mods = "LEADER", action = wezterm.action({ CloseCurrentPane = { confirm = true } }) },
{ key = "x", mods = "LEADER", action = wezterm.action({ CloseCurrentPane = { confirm = true } }) },
{
key = "i",
mods = "ALT",
action = wezterm.action.ActivateTabRelative(-1),
},
-- Navigate to the right tab
{
key = "o",
mods = "ALT",
action = wezterm.action.ActivateTabRelative(1),
},
{
key = "i",
mods = "ALT|SHIFT",
action = wezterm.action.MoveTabRelative(-1),
},
-- Navigate to the right tab
{
key = "o",
mods = "ALT|SHIFT",
action = wezterm.action.MoveTabRelative(1),
},
}
smart_splits.apply_to_config(config, {
direction_keys = { 'h', 'j', 'k', 'l' },
modifiers = {
move = 'CTRL', -- modifier to use for pane movement, e.g. CTRL+h to move left
resize = 'ALT', -- modifier to use for pane resize, e.g. ALT+h to resize to the left
},
})
return config And my TMUX config:
I didn't open an issue because I'm not entirely sure if the plugin is intended to integrate these two tools together or if it's just a mistake in my configuration. Any help is appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
It sounds like you're a bit confused about the function of the Wezterm plugin. Wezterm has built-in terminal multiplexing support. Tmux is also a terminal multiplexer. You should choose one or the other, as they do the same job (mostly, with some slightly differing features).
Right, because then it's falling back to the So what's happening for you is, Personally, I switched from tl;dr: the solution is to pick one or the other from |
Beta Was this translation helpful? Give feedback.
It sounds like you're a bit confused about the function of the Wezterm plugin.
Wezterm has built-in terminal multiplexing support.
smart-splits.nvim
supports Wezterm's multiplexer as a backend.Tmux is also a terminal multiplexer. You should choose one or the other, as they do the same job (mostly, with some slightly differing features).
Right, because then it's falling back to the
tmux
integration, and Wezterm is not swallowing the key presses. By default,smart-splits.nvim
checks fortmux
first, because some people usetmux
in Wezterm and just disable Wezterm's multiplexer; iftmux
is not found, then it tries to set…