Skip to content

Copy/Paste on Wayland (Sway) #855

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

Closed
concatime opened this issue Sep 3, 2018 · 17 comments
Closed

Copy/Paste on Wayland (Sway) #855

concatime opened this issue Sep 3, 2018 · 17 comments

Comments

@concatime
Copy link

concatime commented Sep 3, 2018

Hi. It may seem a dumb question, but how do you copy/paste on Wayland?
I cant't right-click copy, nor Ctrl-Shit-c.
Do I need an external tool? From X11?
I use Sway 1.0 Alpha-5.
Thank you.

@kovidgoyal
Copy link
Owner

Ctrl+shift+c works fine for me under weston. Steps I tried:

  1. Select text
  2. Press Ctrl+shift+c
  3. Right click in a weston terminal and choose paste
  4. Selected text is pasted

You can also use a setting in kitty.conf to avoid needing to press
ctrl+shift+c with it kitty will copy to clipboard automatically when you
select any text.

@kovidgoyal
Copy link
Owner

Oh and I should mention that this is with the X11 backend in kitty, under XWayland. The Wayland backend in glfw (the toolkit kitty uses) does not implement clipboard setting.

kitty by default uses XWayland, unless you set the KITTY_ENABLE_WAYLAND env var

@concatime
Copy link
Author

Yes, I was forcing Wayland. glfw error 65544]: Wayland: Clipboard setting not implemented yet. Do you know when it will be implemented?
Also, if I do not force wayland (default XWayland), I'm not able to type with my keyboard on kitty terminal. Is this a known bug?

@kovidgoyal
Copy link
Owner

See https://github.com/glfw/glfw/projects/2

The keyboard works fine under Xwayland (tested with weston)

@kovidgoyal kovidgoyal reopened this Sep 5, 2018
@concatime
Copy link
Author

(KITTY_ENABLE_WAYLAND=1)
Copying works fine, thank you.
But, copying from kitty, and pasting into itself does not work:

[248 09:31:15.922963] [glfw error 65544]: Wayland: Failed to read clipboard data from pipe (timed out)
[248 09:31:15.923122] [glfw error 65544]: Wayland: Could not copy writing to destination fd failed with error: Broken pipe

and playing with copy/paste crashes kitty:

listener function for opcode 2 of wl_data_source is NULL
fish: “kitty” terminated by signal SIGABRT (Abort)

@kovidgoyal
Copy link
Owner

The copy to self issue is easy to fix, but what does playing with copy/paste eman? Can you provide some set of steps to reproduce?

@concatime
Copy link
Author

Try to copy from kitty to another app, and then from the other app, copy something back to kitty, one or multiple times.

@concatime
Copy link
Author

Ohh. Copy from kitty to another app, and then from the other app, cut something. Kitty will crash immediatly.

@kovidgoyal
Copy link
Owner

What app are you using to cut from?

@concatime
Copy link
Author

Chromium. Under Sway 1.0 Alpha.

@concatime
Copy link
Author

concatime commented Sep 5, 2018

Even under weston. Open weston terminal, type kitty and enter. Open another terminal. Copy from kitty to this new terminal, and then select something on this terminal and Ctrl-Shift-C to copy your selection will crash kitty.

@kovidgoyal
Copy link
Owner

Should be fine now.

@concatime
Copy link
Author

It works fine now, thank you for your amazing job!

@Moelf
Copy link

Moelf commented Nov 16, 2018

I'm using Sway + Kitty + Skype (which is XWayland I guess), I have KITTY_ENABLE_WAYLAND=1, if I select or select C-Shift-c something in Kitty, I have trouble pasting it into Skype.

My current work around is open another Kitty, open Vim, paste into vim (through C-Shift-v), and use vim to copy to "+y which would access 'system clipboard'. Then I can paste into Skype

@kovidgoyal
Copy link
Owner

Does it work with other XWayland clients? Or is it only skype?

@Moelf
Copy link

Moelf commented Nov 16, 2018

It's in general broken/inconsistent. Also even pasting to another Kitty window is 'unstable', if I just C-Shift-v, the cursor would freeze, I have to switch to another workspace and back and find it finished pasting.

@kovidgoyal
Copy link
Owner

I cannot reproduce that after my fix.

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

No branches or pull requests

3 participants