ojroques / vim-oscyank

A Vim plugin to copy text through SSH with OSC52
BSD 2-Clause "Simplified" License
615 stars 38 forks source link

not working with kitty terminal #50

Closed rsmath closed 8 months ago

rsmath commented 9 months ago

Hi,

I am trying to make the extension work with kitty terminal. My .tmux.conf has set -s set-clipboard on set but the extension does not work.

The terminal is xterm-kitty when I print echo $TERM.

Can someone please help me? Thank you.

rsmath commented 9 months ago

My .tmux.conf is as follows

set -g @plugin 'nhdaly/tmux-better-mouse-mode'
set -g @plugin 'tmux-plugins/tmux-yank'

set -g prefix C-a
set -g default-terminal "xterm-kitty"
set -g mouse on
unbind C-b
bind-key C-a send-prefix
bind-key x kill-window
bind -n C-b clear-history

set -s set-clipboard on

set -as terminal-features ',xterm-kitty:clipboard'

set -g mode-keys vi

bind -T copy-mode    C-c send -X copy-pipe-no-clear "xsel -i --clipboard"
bind -T copy-mode-vi C-c send -X copy-pipe-no-clear "xsel -i --clipboard"

run '~/.tmux/plugins/tpm/tpm'
rsmath commented 9 months ago

I have also tried manually building tmux with the latest version, next-3.4, but it did not help. My vim version is 8.2

ethagnawl commented 8 months ago

@rsmath I know this is bizarre but try starting tmux using its absolute path (e.g. /usr/bin/tmux). This is the only way I can get the tmux integration working. I'm currently working on setting up a new development environment and just verified that this is still the case on Debian 12.4 using tmux 3.3a.

This thread from a few months ago contains a bit more context.

rsmath commented 8 months ago

Thank you @ethagnawl. Quick question, is my .bashrc where I would set tmux to be launched from its absolute path. So basically,

alias tmux="/usr/bin/tmux"

Thank you for your help.

rsmath commented 8 months ago

It works now! Thank you so much!

ethagnawl commented 8 months ago

Yeah. On the machine I'd setup when I ran into the linked issue I wound up doing that but using alias tmuxx=/usr/bin/tmux, so it was obvious that I was doing something non-standard.

ethagnawl commented 8 months ago

It works now! Thank you so much!

I'm glad to hear it but I'd love to understand why ...

rsmath commented 8 months ago

Haha, I hope it becomes clear soon :)

ethagnawl commented 8 months ago

Following up, @rsmath. My issue seems to be because I had an old/forgotten tmux alias that was setting TERM: alias tmux="TERM=screen-256color-bce tmux". Removing that alias and opening a new terminal results in me being able to use vim-oscyank and tmux without needing to specify the absolute path to the tmux binary.

rsmath commented 8 months ago

Ahh, I see. I had that too, and then I removed it when I tried your suggestion. I'm quite glad vim-oscyank works with Kitty now. It'd be helpful to put this somewhere for other future Kitty users who try to use the plugin.

ethagnawl commented 8 months ago

I believe it's more of an environmental/user issue than it is a kitty issue.

The tmux subsection of this project's README would be the obvious place to expand and add mention of this class of issues. I think it'd be something like,

If you're seeing unexpected behavior when trying to use tmux, ensure that your tmux command is not being aliased (e.g. in .bashrc) and inadvertently introducing environment variables (e.g. TERM=...) which may override or clash with those configured in your tmux configuration file.

Thoughts, @ojroques? This addition could probably prevent issues like #41 and this one from being opened in the future.

ethagnawl commented 8 months ago

Either way, this issue can probably be closed. Right, @rsmath?

rsmath commented 8 months ago

Yes, I think so. Thank you again for your help.