-
Notifications
You must be signed in to change notification settings - Fork 15
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
Copy/paste not working #27
Comments
Hm. Does clipboard generally work for you in kitty? For example, if you select text with the mouse and press When you press If you run |
Hi Yurikhan, Yes, |
Okay, next step. In the def handle_result(args: List[str], result: 'ResultDict',
target_window_id: WindowId, boss: Boss) -> None:
print(result) # ← add this
if 'copy' in result:
set_clipboard_string(result['copy']) Now repeat the copying (in kitty started from another terminal). When you press
Do you? |
I did an ls -ltr
|
So basically the correct data gets almost to the end of kitty_grab and up to the kitty’s API function to set clipboard contents, but that last step does not work for some reason. Last ditch attempt, does it work for you if you change it this way? def handle_result(args: List[str], result: 'ResultDict',
target_window_id: WindowId, boss: Boss) -> None:
if 'copy' in result:
boss.clipboard.set_text(result['copy']) |
Sadly, no. |
Does it work for you in past versions of Kitty? What is the last version that works? (It works for me on v0.26.5, and building v0.27.1 requires(?) Go 1.20 which is not packaged for Ubuntu 22.04, and I’m reluctant to install bleeding edge, so I can’t check easily.) |
Sorry, I used to use urxvt, but I was recommended to try kitty, and this is something I use a lot on urxvt. Let me check if I find how to install the 0.26.5 version and I will let you know. |
I already installed 0.26.5 but still not working Running kitty from another terminal I get this
Edit: Using "Debian GNU/Linux 11 (bullseye)" |
I’m stumped, calling @kovidgoyal. TL;DR: I’m calling What could we do to debug this further? |
I dont see how that's possible. Either copying in general is not working Most likely there are multiple calls to copy that are ending with setting the clipboard to the empty string or the OP is not doing what he thinks he is doing. |
Although I have to ask why is copy_string_to_clipbaord being used at all? Shouldn't this kitten just be passing the text to kitty to copy via OSC 52? |
@kovidgoyal What are the advantages and disadvantages of the two approaches? As far as I can see: OSC 52:
calling a method:
|
That's more or less correct, the main reason I asked is that I assume |
I have not considered the use case to copy multiple things. In my head, the user wants to invoke the kitten, select some text, copy it and go on working, maybe pasting it into the same session it was copied from. To copy something else, the user re-invokes the kitten. Although I can see how one might want to keep the kitten active, copy something out of it and paste into another application, repeat this multiple times without losing one’s position in the scrollback. |
Hi all, Thanks for your help and sorry for the late response since when the comments arrive it was 2am here were I live. |
I also had a failure to copy. It worked fine so long as I never went past the top of the screen into the scrollback buffer. OSC52 branch is working as far as copy and paste goes, although it does something weird with the highlighted text.: This is what it pasted after that: I'm using kitty especially because of its OSC52 support which is needed for copyQ on wayland. |
I think weird behavior in presence of tab characters is a separate bug (#28). |
🤦 I didn't even notice, of course it is the tabs. Sorry, I should have opened a separate case. My bad, and thank you for helping :) |
I just installed kitty_grab but is not working
-Press mapped key
-Kitty flashes
-Change title to "grab"
-Select text
-Press enter
-But when trying to paste, it paste what is already on de clipboard no the selection I just made.
$ kitty -v kitty 0.27.1 created by Kovid Goyal
Windows system X11
The text was updated successfully, but these errors were encountered: