-
-
Notifications
You must be signed in to change notification settings - Fork 988
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
Unable to get clipboard sharing working with tmux #782
Comments
You need to tell tmux to turn it on in the tmux settings. |
Hmm, I didn't have to do this with iTerm - do you know which tmux setting it is? EDIT: I ran |
I have no idea, I'm not a tmux user (IMO tmux is a horrible pile of hacks). All I can tell you is that OSC 52 works with kitty, which you can test by doing
and your clipboard will contain the string blaba |
I see - thanks, I'll dig in a bit.
I find it quite nice, but have no strong preference - what alternative would you recommend? |
I personally dont use a multiplexer at all. kitty itself has pretty much all the functionality of a multiplexer builtin, with the exception of remote persistence see #391 Oh and by the way, you can also use the clipboard kitten to more easily copy stuff to the keyboard, which uses OSC 52 under the hood kitty +kitten clipboard --help |
tmux resends OSC 52 to the outer terminal without the printf "\033]52;;$(printf "%s" "blabla" | base64)\a" in kitty directly. kitty does not accept an empty clipboard parameter (which is allowed in the XTerm specs). Would it be possible to add support for empty clipboard paramters? It would make tmux users happy 😄 . |
…parameter This is apparently used by tmux. See #782
sure, done |
Great, thanks! 👍 |
So, should this work now? I tried it but to no avail. I've set in my
And tried to execute this inside tmux:
But it doesn't end up in my system clipboard. It does outside tmux. I'm using kitty 0.13.3. |
No idea. All I did was get kitty to accept without the c parameter, as described by @IngoHeimbach |
I found an alternative solution though, in case anyone is interested: |
I have set
in my kitty +kitten clipboard works internally. I think this command is not needed within tmux. |
The clipboard kitten probably does not work because while tmux generates OSC 52 itself when copying, it does not pass it through when the program running inside it generates it. |
Programs generating OSC52 should also work. I use a script that generates OSC52 for yanking text from vim to the system clipboard. |
Well the clipboard kitten is just an easy to use API for generating OSC |
Ok, I tried echo "test" | kitty +kitten clipboard within tmux which runs in kitty. For me, it works. |
Not working for remote Tmux session.
Also need git version that supports no-append as clipboard-option, otherwise it will only append to previous content. I think Tmux's default osc52 may not be the compatible with kitty if it is running over SSH. |
@hillyu You are right, by default tmux does not pass OSC52 if nested in another tmux session. The reason is the set
to your |
Thanks @IngoHeimbach , for pointing me to the right direction. I think the culprit for my setup is another override setting: |
@IngoHeimbach i've got the issue that the copy content of tmux is always appended to the clipboard. The "no-append" option of the kitty "clipboard_control" config seems to be ignored. Any idea? Thx |
@bastikempken I have tested the |
I am having the same issue as @bastikempken Does not occur in iTerm nor Alacritty. MacOS. |
Which version of kitty are you using? |
@Luflosi The latest release from ~ kitty -v
kitty 0.14.2 created by Kovid Goyal |
I also cannot replicate, with set-clipboard on in tmux conf and running kitty as:
running
multiple times does not append to clipboard. |
I'm sorry, it was my mistake. I didn't actually test the |
@gitaarik can you clarify your solution. I have |
@jessebett it's an alternative solution, nothing to do with this thread. Better refer to the documentation or issues of |
This worked for me on macOS... # ~/.tmux.conf
- bind-key -T copy-mode-vi 'y' send -X copy-pipe "reattach-to-user-namespace pbcopy"
+ bind-key -T copy-mode-vi 'y' send -X copy-pipe "kitty +kitten clipboard" To fix the problem of kitty defaulting to appending to the clipboard (which seemed a strange default to set) I made the following modification...
|
Maybe something like this would be better? So the behaviour is consistent whether you use Kitty or another terminal
|
Worked for me |
I'm unable to get clipboard sharing with
tmux
working properly. I have this setting in mykitty.conf
:When I select text in tmux's copy mode, it does not seem to get written to the system clipboard - when I paste using
Cmd+V
, the text copied in tmux does not get pasted.I also tried it with
clipboard_control read-clipboard write-clipboard read-primary write-primary
but that did not help.This works in iTerm when the "Applications in terminal may access clipboard" setting is turned on - is it something that is supported in kitty too?
I'm using macOS with kitty version 0.11.3.
The text was updated successfully, but these errors were encountered: