vim-oscyank icon indicating copy to clipboard operation
vim-oscyank copied to clipboard

not working with kitty terminal

Open rsmath opened this issue 1 year ago • 2 comments

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 avatar Dec 24 '23 20:12 rsmath

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 avatar Dec 24 '23 20:12 rsmath

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

rsmath avatar Dec 24 '23 20:12 rsmath

@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.

ethagnawl avatar Jan 22 '24 17:01 ethagnawl

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 avatar Jan 22 '24 17:01 rsmath

It works now! Thank you so much!

rsmath avatar Jan 22 '24 17:01 rsmath

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 avatar Jan 22 '24 17:01 ethagnawl

It works now! Thank you so much!

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

ethagnawl avatar Jan 22 '24 17:01 ethagnawl

Haha, I hope it becomes clear soon :)

rsmath avatar Jan 22 '24 17:01 rsmath

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.

ethagnawl avatar Jan 22 '24 17:01 ethagnawl

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.

rsmath avatar Jan 22 '24 18:01 rsmath

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 avatar Jan 22 '24 18:01 ethagnawl

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

ethagnawl avatar Jan 22 '24 18:01 ethagnawl

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

rsmath avatar Jan 22 '24 20:01 rsmath