mrjones2014 / smart-splits.nvim

🧠 Smart, seamless, directional navigation and resizing of Neovim + terminal multiplexer splits. Supports tmux, Wezterm, and Kitty. Think about splits in terms of "up/down/left/right".
MIT License
895 stars 37 forks source link

fix(mux): nvim-wezterm panes not seamlessly switching while using wsl2 #160

Closed Mr-Hypocrite closed 6 months ago

Mr-Hypocrite commented 6 months ago

Issue

When using wsl in wezterm ( installed on windows ), the cursor does switch from wezterm to nvim, however it doesn't switch from nvim to wezterm.

Cause

As mentioned, the plugin is using wezterm cli for switching panes, however the command 'wezterm' is not recognized in WSL environment therefore the switching doesn't work.

Solution

Check if the environment is WSL and use the command 'wezterm.exe' instead of 'wezterm' ( note: this works only if the wezterm path on windows is set correctly on WSLENV ).

mrjones2014 commented 6 months ago

note: this works only if the wezterm path on windows is set correctly on WSLENV

I'm not familiar with Windows or WSL, could you explain what this means a bit more?

mrjones2014 commented 6 months ago

I also wonder if maybe we should just also allow the user to provide a custom path to the wezterm binary in case the CLI is not on $PATH

mrjones2014 commented 6 months ago

Oh, and as always, thank you for the PR!

Mr-Hypocrite commented 6 months ago

I also wonder if maybe we should just also allow the user to provide a custom path to the wezterm binary in case the CLI is not on $PATH

Yes, that sounds good. Based on my understand of this conversation and my knowledge ( based off of tinkering with nvim and the plugin ), I've added a way provide a custom path to wezterm binary, if it can be improved please let me know.

Mr-Hypocrite commented 6 months ago

Now the configuration part is completely on the user's end, let me know what you think. For me it looks like this: smart-splits-config