Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't seem to work when using tmux inside of the nested terminal #97

Closed
brandonpollack23 opened this issue Apr 11, 2024 · 10 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@brandonpollack23
Copy link

Describe the bug
I like to use tmux to save sessions for workspaces in neovim so it functions a bit more like vscode in that way with toggleterm.

When I do this the nesting doesnt work, even though vim.env.NVIM is set...not certain why. When I exit tmux it works just fine.

To Reproduce
Steps to reproduce the behavior:

  1. open a toggle term
  2. start tmux
  3. try to open a file with the nvim command
  4. observer that vim.env.NVIM is set, but it didn't open in the 'alternate' window instead it just opened inside the terminal.

Expected behavior
Works just like without tmux

@brandonpollack23 brandonpollack23 added the bug Something isn't working label Apr 11, 2024
@willothy
Copy link
Owner

Hmm I'm not a big tmux user so haven't run into this, but i'll look into it! It would definitely be good to have tmux integration equivalent to the kitty and wezterm integrations.

@brandonpollack23
Copy link
Author

Appreciated! Let me know if there is anything I can do to help

@willothy
Copy link
Owner

This actually seems to work just fine for me... mind sharing your config?

@brandonpollack23
Copy link
Author

Narrowwed it down some, I am getting a failed pcall to vim.fn.sockconnect in guest.lua it seems.

My config is here: github.com/brandonpollack23/rcfiles under ".config/nvim"

It is a total mess so sorry in advance.

@brandonpollack23
Copy link
Author

I have a theory, I think it is because I automatically generate the session name in a way that causes conflicts if I have multiple sessions created by neovim, so I need a more unique name (I'm trying to open the file in the wrong socket)

@brandonpollack23
Copy link
Author

Ok so it had something to do with that...at least something that fixed it for me was explicitly setting NVIM to vim.v.servername

I think my session was getting revived with old env vars or something? some Tmux thing I dont understand

@willothy
Copy link
Owner

Hmm interesting, $NVIM should always be set to vim.v.servername, but if that works then it works lol. I'll take a look at your config.

@willothy
Copy link
Owner

Can't really see anything wrong with your config and this works fine for me in tmux sessions... not quite sure what's going on. What exactly isn't working / what is the behavior you would expect?

@brandonpollack23
Copy link
Author

brandonpollack23 commented Apr 17, 2024 via email

@willothy
Copy link
Owner

Closing this since it's resolved, but I'll pin it for anyone else who runs into the same issue :)

@willothy willothy pinned this issue Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants