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

[WIP] Add tmux support #151

Closed
wants to merge 1 commit into from
Closed

[WIP] Add tmux support #151

wants to merge 1 commit into from

Conversation

milch
Copy link

@milch milch commented Jan 6, 2024

Hey,

I saw your plugin after watching the talk you gave at Neovim Conf on YouTube. I thought it was a great idea, but unfortunately I don't use Kitty - but I do use tmux. I figured it might be possible to get your plugin running for tmux and saw there was even a recent issue that was opened asking for that feature (#115), so I gave it a shot. This is still very much a WIP, but the "front end" seems to work, i.e. getting data into the plugin and getting it to display everything correctly. The "backend" is completely missing still, so things like sending commands to be executed will just error at the moment. tbh I was testing this in WezTerm, but if you use tmux from within Kitty many more things might actually be working just fine.

Similar to the kitty support, which seems to be mediated through the kitty_scrollback_nvim.py script, I've added a launch_tmux_scrollback.py script. This is intended to be the entrypoint from which the user sets up a keybinding within their tmux.conf, e.g.:

bind e run-shell "$HOME/path/to/plugin/kitty-scrollback.nvim/python/launch_tmux_scrollback.py"

Remaining tasks/issues as I see them before this is ready:

  • When the history contents are large (e.g. > few thousand lines) then the screen flashes when neovim starts
  • Visual mode highlighting seems to be broken
  • Add "additional nvim options" functionality to tmux launch script (e.g. load minimal plugin env instead of clean env)
  • Add/update tests
  • Healthchecks / tmux version checks (launcher script requires >3.2 for the popup)
  • Update README

@milch milch mentioned this pull request Jan 6, 2024
17 tasks
@mikesmithgh
Copy link
Owner

Hey @milch, thanks for the PR. Interesting that you are using Wezterm with this. If I understand correctly, bind e run-shell is a tmux binding that runs launch_tmux_scrollback.py and it loads the scrollback buffer in Neovim without any issues? The only problem is Kitty specific commands at that point.

Did you see any issues viewing the scrollback? Would you mind posting a screenshot?

@milch
Copy link
Author

milch commented Jan 7, 2024

If I understand correctly, bind e run-shell is a tmux binding that runs launch_tmux_scrollback.py and it loads the scrollback buffer in Neovim without any issues? The only problem is Kitty specific commands at that point.

Correct! It basically creates a new tmux pane that overlays over the existing pane and closes automatically when the underlying command (the nvim session) exits.

Did you see any issues viewing the scrollback? Would you mind posting a screenshot?

I created a screen recording here:

tmux.scrollback_enc.mov

I think there's two visual issues I can see:

  1. Visual mode highlighting is not working, i.e. towards the end of the recording I select and yank some text, but you couldn't see any selection
  2. The highlights in the popup are off

If I had to guess, both probably have something to do with the hsb_hl module I bypassed ... I wanted to get a PoC working first to see if it was going to be possible at all before focusing on details like the colors.

@hanspinckaers
Copy link

Hi @milch, awesome work! Just commenting, because maybe this is related: I also had some issues before where I didn't see the Visual highlight, turns out it my case they were set to the same color as my white theme's background. I think you have to check KittyScrollbackNvimVisual.

@mikesmithgh
Copy link
Owner

hey @milch thanks for the PR, I am going to close this out in favor of #191. This was really helpful for coming up with the approach, thanks again!

@milch
Copy link
Author

milch commented Feb 11, 2024

Glad to see it! I wasn't going to have time to work on this in the near future anyway 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants