Closed mochouaaaaa closed 9 months ago
Everything works fine on kitty with this configuration, I'm not sure at the moment which step the problem is, everything seems so normal
Can you explain the is_inside_vim
function in the Wezterm config? My immediate assumption is that this is the issue, the recommended setup in the README.md shows to use the user variable check by the is_vim
function, which I don't see used anywhere in your config.
@mrjones2014 Checking whether the current pane is nvim by querying the process has the same effect as is_vim.
print(tty) -- /dev/ttys002
In the nvim process it works fine, only the move operation doesn't work, but in the wezterm environment the effect is completely opposite, only the move operation works fine, all other operations don't work.
What's the reason for is_inside_vim
vs. just using the suggested is_vim
? Does it work if you revert to using the is_vim
function?
vim.keymap.set("n", "<D-k>", function() smart_splits.move_cursor_up() end)
vim.keymap.set("n", "<D-j>", function() smart_splits.move_cursor_down() end)
vim.keymap.set("n", "<D-h>", function() smart_splits.move_cursor_left() end)
vim.keymap.set("n", "<D-l>", function() smart_splits.move_cursor_right() end)
Also pretty sure <D>
is not a valid key code in nvim, based on your log output it looks like you're trying to use macOS Command key, which should be <M>
.
Where are the Wezterm keymaps?
I also suspected a command key issue, but wezterm I'm using the kitty protocol and have tried both using SUPER and CMD mapping, but the results are the same!
<kDel> keypad delete *keypad-delete*
<kPlus> keypad + *keypad-plus*
<kMinus> keypad - *keypad-minus*
<kMultiply> keypad * *keypad-multiply*
<kDivide> keypad / *keypad-divide*
<kPoint> keypad . *keypad-point*
<kComma> keypad , *keypad-comma*
<kEqual> keypad = *keypad-equal*
<kEnter> keypad Enter *keypad-enter*
<k0> - <k9> keypad 0 to 9 *keypad-0* *keypad-9*
<S-…> shift-key *shift* *<S-*
<C-…> control-key *control* *ctrl* *<C-*
<M-…> alt-key or meta-key *META* *ALT* *<M-*
<A-…> same as <M-…> *<A-*
<T-…> meta-key when it's not alt *<T-*
<D-…> command-key or "super" key *<D-*
Maybe via https://github.com/wez/wezterm/issues/3731#issuecomment-1592198263 solve I'll try that later
It can be determined that the problem is not with the plugin, as using SmartCursorMove
in an nvim environment.
Similar Issues
Neovim Version
NVIM v0.10.0-dev-2086+g965dbd0e0 Build type: RelWithDebInfo LuaJIT 2.1.1703358377 Run "nvim -V1 -v" for more info
Multiplexer Integration
Wezterm
Multiplexer Version
➜ wezterm --version wezterm 20240203-110809-5046fc22
Steps to Reproduce
Expected Behavior
Normal move from nvim to other pane
Actual Behavior
unable to move
Minimal Configuration to Reproduce
neovim config
wezterm config
local M = {}
-- if you are NOT lazy-loading smart-splits.nvim (recommended) local function is_vim(pane) -- this is set by the plugin, and unset on ExitPre in Neovim return pane:get_user_vars().IS_NVIM == "true" end
function M.is_inside_vim(pane) local tty = pane:get_tty_name() if tty == nil then return false end
end
local direction_keys = {
}
function M.wezterm_nvim(operation, key, mods) return { key = key, mods = mods, action = w.action_callback(function(win, pane) if M.is_inside_vim(pane) then print(win) print(pane) print(act.SendKey { key = key, mods = mods }) -- pass the keys through to vim/nvim win:perform_action( -- SendKey = { key = key, mods = mods }, act.SendKey { key = key, mods = mods }, pane ) else if operation == "resize" then win:perform_action({ AdjustPaneSize = { direction_keys[key], 3 } }, pane) elseif operation == "move" then win:perform_action({ ActivatePaneDirection = direction_keys[key] }, pane) end end end), } end