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
906 stars 38 forks source link

[BUG]: Breaking change for tmux after wezterm integration #48

Closed trevarj closed 1 year ago

trevarj commented 1 year ago

Describe the bug Switching from neovim to tmux pane no longer works.

Commit 3d4239b is working still

To Reproduce Steps to reproduce the behavior:

  1. Be in neovim
  2. Try to switch to tmux pane
  3. Nothing happens

Expected behavior Should switch from neovim to tmux pane

Version Info (please complete the following information):

NVIM v0.8.2 Build type: Release LuaJIT 2.1.0-beta3

Additional context in tmux.conf :

set -g @plugin 'christoomey/vim-tmux-navigator'   
mrjones2014 commented 1 year ago

Hmm, it works for me. What is the output if you run the command :lua=require('smart-splits.config').multiplexer_integration?

Does it work if you explicitly set it in config?

require('smart-splits').setup({ multiplexer_integration = 'tmux' })

What version of tmux and what OS+version are you using?

trevarj commented 1 year ago

Ubuntu 22.04 tmux 3.2a

:lua=require('smart-splits.config').multiplexer_integration outputs nil

Adding:

require('smart-splits').setup({ multiplexer_integration = 'tmux' })

Yep, that did it, thanks!

mrjones2014 commented 1 year ago

Okay, so there is just something not quite right about how smart-splits.nvim is attempting to automatically determine what multiplexer you're using on Linux or your Neovim or tmux version or something.

What's the output of :lua=vim.env.TMUX for you?

trevarj commented 1 year ago

With and without the fix: :lua=vim.env.TMUX -> "/tmp/tmux-1000/default,3585,1"

Note, I haven't yet restarted tmux or left my session after updating smart-splits

mrjones2014 commented 1 year ago

Note, I haven't yet restarted tmux or left my session after updating smart-splits

Yeah, that shouldn't matter.

One thing that might cause it, were you not calling setup() at all in your config? I know how I can fix that, but that's the only thing I can think of that would've caused this.

mrjones2014 commented 1 year ago

I just pushed a new commit, I'm curious if it will work for you now without the config change I recommended in this issue.

trevarj commented 1 year ago

One thing that might cause it, were you not calling setup() at all in your config?

Yes, this seems to be the issue. I am using lazy.vim and didn't set config = true. When I do that it works again.

I just pushed a new commit

Just pulled the latest and it works without any extra config or calling setup(), thanks a lot!

mrjones2014 commented 1 year ago

Awesome, thanks for working with me on this! Great to get this feedback.

I've made it so that it detects the default automatically from plugin/smart-splits.nvim before setup() is called, so you shouldn't need to call setup() now unless you want to customize stuff.