Skip to content
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

Can not copy some text #35

Open
Zesko opened this issue Apr 8, 2023 · 4 comments
Open

Can not copy some text #35

Zesko opened this issue Apr 8, 2023 · 4 comments

Comments

@Zesko
Copy link

Zesko commented Apr 8, 2023

  1. Use KDE Plasma 5.27.4 Wayland on any Arch based distros
  2. Install micro or gvim
  3. Create a new bash script
#!/usr/bin/env bash

SERVICE_NAME="test.service"
  1. Open vim or micro this script.
  2. Select all text.
  3. Try copying it and pasting it into another text editor e.g. Kate, but it does not work.

This is wl-clipboard-rs 0.7.0 which has issue copying this text, but no issue copying other text on KDE Wayland

wl-clipboard has no issue. (However, it has another problem: it hangs micro when Klipper (KDE clipboard) is empty.)

@YaLTeR
Copy link
Owner

YaLTeR commented Apr 9, 2023

Hey, does it work if you call wl-clipboard-rs manually rather than through vim/micro? If so, could you please attach WAYLAND_DEBUG=1 logs when the problem happens, and of the same wl-clipboard invocation which works?

@Zesko
Copy link
Author

Zesko commented Apr 9, 2023

does it work if you call wl-clipboard-rs manually rather than through vim/micro?

It still does not work.

If so, could you please attach WAYLAND_DEBUG=1 logs when the problem happens

The log is here:

Copy this text has this issue:

#!/usr/bin/env bash

SERVICE_NAME="test.service"

Please can you copy this text if you reproduce the same issue?

$ WAYLAND_DEBUG=1 wl-copy < test.txt

[1681028295.225027] -> [email protected]_registry(2)
[1681028295.225038] -> [email protected](3)
[1681028295.227198] <- [email protected]_id(3)
[1681028295.227204] <- [email protected](1, "wl_compositor", 5)
[1681028295.227224] <- [email protected](3, "zwp_tablet_manager_v2", 1)
[1681028295.227246] <- [email protected](4, "zwp_keyboard_shortcuts_inhibit_manager_v1", 1)
[1681028295.227279] <- [email protected](6, "xdg_wm_base", 4)
[1681028295.227296] <- [email protected](7, "zwlr_layer_shell_v1", 3)
[1681028295.227335] <- [email protected](8, "zxdg_decoration_manager_v1", 1)
[1681028295.227360] <- [email protected](9, "wp_viewporter", 1)
[1681028295.227377] <- [email protected](10, "wp_fractional_scale_manager_v1", 1)
[1681028295.227404] <- [email protected](11, "wl_shm", 1)
[1681028295.227420] <- [email protected](12, "wl_seat", 8)
[1681028295.227438] -> [email protected](12, "wl_seat", 8, 4)
[1681028295.227459] <- [email protected](13, "zwp_pointer_gestures_v1", 3)
[1681028295.227481] <- [email protected](14, "zwp_pointer_constraints_v1", 1)
[1681028295.227506] <- [email protected](15, "zwp_relative_pointer_manager_v1", 1)
[1681028295.227534] <- [email protected](16, "wl_data_device_manager", 3)
[1681028295.227554] <- [email protected](17, "zwlr_data_control_manager_v1", 2)
[1681028295.227579] <- [email protected](18, "zwp_primary_selection_device_manager_v1", 1)
[1681028295.227611] <- [email protected](19, "org_kde_kwin_idle", 1)
[1681028295.227633] <- [email protected](20, "zwp_idle_inhibit_manager_v1", 1)
[1681028295.227662] <- [email protected](21, "ext_idle_notifier_v1", 1)
[1681028295.227682] <- [email protected](22, "org_kde_plasma_shell", 8)
[1681028295.227701] <- [email protected](23, "org_kde_kwin_appmenu_manager", 1)
[1681028295.227727] <- [email protected](24, "org_kde_kwin_server_decoration_palette_manager", 1)
[1681028295.227759] <- [email protected](26, "org_kde_plasma_virtual_desktop_management", 2)
[1681028295.227791] <- [email protected](28, "org_kde_kwin_shadow_manager", 2)
[1681028295.227813] <- [email protected](29, "org_kde_kwin_dpms_manager", 1)
[1681028295.227834] <- [email protected](30, "org_kde_kwin_server_decoration_manager", 1)
[1681028295.227866] <- [email protected](31, "kde_output_management_v2", 3)
[1681028295.227899] <- [email protected](32, "zxdg_output_manager_v1", 3)
[1681028295.227924] <- [email protected](33, "wl_subcompositor", 1)
[1681028295.227942] <- [email protected](34, "zxdg_exporter_v2", 1)
[1681028295.227963] <- [email protected](35, "zxdg_importer_v2", 1)
[1681028295.227982] <- [email protected](38, "xdg_activation_v1", 1)
[1681028295.228003] <- [email protected](40, "wp_content_type_manager_v1", 1)
[1681028295.228027] <- [email protected](41, "wp_tearing_control_manager_v1", 1)
[1681028295.228055] <- [email protected](43, "wl_drm", 2)
[1681028295.228070] <- [email protected](44, "zwp_linux_dmabuf_v1", 4)
[1681028295.228090] <- [email protected](46, "kde_output_device_v2", 2)
[1681028295.228110] <- [email protected](47, "kde_output_device_v2", 2)
[1681028295.228132] <- [email protected](48, "wl_output", 4)
[1681028295.228148] <- [email protected](49, "wl_output", 4)
[1681028295.228168] <- [email protected](50, "wp_drm_lease_device_v1", 1)
[1681028295.228193] <- [email protected](51, "kde_output_order_v1", 1)
[1681028295.228213] <- [email protected](52, "zwp_text_input_manager_v1", 1)
[1681028295.228237] <- [email protected](53, "zwp_text_input_manager_v2", 1)
[1681028295.228264] <- [email protected](54, "zwp_text_input_manager_v3", 1)
[1681028295.228285] <- [email protected](56, "org_kde_kwin_slide_manager", 1)
[1681028295.228307] <- [email protected](1295)
[1681028295.228317] -> [email protected](17, "zwlr_data_control_manager_v1", 1, 3)
[1681028295.228344] -> [email protected]_data_device(5, 4)
[1681028295.228355] -> [email protected](6)
[1681028295.228478] <- [email protected]_id(6)
[1681028295.228500] <- [email protected](7)
[1681028295.228515] <- [email protected]("")
[1681028295.228537] <- [email protected]_offer(4278190080)
[1681028295.228556] <- [email protected]("text/html")
[1681028295.228588] <- [email protected]("STRING")
[1681028295.228608] <- [email protected]("text/plain;charset=utf-8")
[1681028295.228648] <- [email protected]("TEXT")
[1681028295.228671] <- [email protected]("UTF8_STRING")
[1681028295.228698] <- [email protected]("text/plain")
[1681028295.228723] <- [email protected]("text/plain;charset=utf-8")
[1681028295.228753] <- [email protected](4278190080)
[1681028295.228762] <- [email protected](1295)
[1681028295.230260] -> [email protected]_data_source(6)
[1681028295.230269] -> [email protected]("application/x-shellscript")
[1681028295.230282] -> [email protected]_selection(6)
[1681028295.230422] <- [email protected]_offer(4278190081)
[1681028295.230441] <- [email protected]("application/x-shellscript")
[1681028295.230468] <- [email protected](4278190081)

VS.

Copying other text has no issue:

SERVICE_NAME="test.service"
$ WAYLAND_DEBUG=1 wl-copy < test.txt

[1681028580.224614] -> [email protected]_registry(2)
[1681028580.224625] -> [email protected](3)
[1681028580.226635] <- [email protected]_id(3)
[1681028580.226641] <- [email protected](1, "wl_compositor", 5)
[1681028580.226655] <- [email protected](3, "zwp_tablet_manager_v2", 1)
[1681028580.226673] <- [email protected](4, "zwp_keyboard_shortcuts_inhibit_manager_v1", 1)
[1681028580.226694] <- [email protected](6, "xdg_wm_base", 4)
[1681028580.226707] <- [email protected](7, "zwlr_layer_shell_v1", 3)
[1681028580.226723] <- [email protected](8, "zxdg_decoration_manager_v1", 1)
[1681028580.226744] <- [email protected](9, "wp_viewporter", 1)
[1681028580.226757] <- [email protected](10, "wp_fractional_scale_manager_v1", 1)
[1681028580.226779] <- [email protected](11, "wl_shm", 1)
[1681028580.226789] <- [email protected](12, "wl_seat", 8)
[1681028580.226801] -> [email protected](12, "wl_seat", 8, 4)
[1681028580.226817] <- [email protected](13, "zwp_pointer_gestures_v1", 3)
[1681028580.226836] <- [email protected](14, "zwp_pointer_constraints_v1", 1)
[1681028580.226854] <- [email protected](15, "zwp_relative_pointer_manager_v1", 1)
[1681028580.226876] <- [email protected](16, "wl_data_device_manager", 3)
[1681028580.226896] <- [email protected](17, "zwlr_data_control_manager_v1", 2)
[1681028580.226921] <- [email protected](18, "zwp_primary_selection_device_manager_v1", 1)
[1681028580.226946] <- [email protected](19, "org_kde_kwin_idle", 1)
[1681028580.226962] <- [email protected](20, "zwp_idle_inhibit_manager_v1", 1)
[1681028580.226982] <- [email protected](21, "ext_idle_notifier_v1", 1)
[1681028580.226998] <- [email protected](22, "org_kde_plasma_shell", 8)
[1681028580.227017] <- [email protected](23, "org_kde_kwin_appmenu_manager", 1)
[1681028580.227038] <- [email protected](24, "org_kde_kwin_server_decoration_palette_manager", 1)
[1681028580.227065] <- [email protected](26, "org_kde_plasma_virtual_desktop_management", 2)
[1681028580.227091] <- [email protected](28, "org_kde_kwin_shadow_manager", 2)
[1681028580.227113] <- [email protected](29, "org_kde_kwin_dpms_manager", 1)
[1681028580.227131] <- [email protected](30, "org_kde_kwin_server_decoration_manager", 1)
[1681028580.227156] <- [email protected](31, "kde_output_management_v2", 3)
[1681028580.227177] <- [email protected](32, "zxdg_output_manager_v1", 3)
[1681028580.227195] <- [email protected](33, "wl_subcompositor", 1)
[1681028580.227211] <- [email protected](34, "zxdg_exporter_v2", 1)
[1681028580.227227] <- [email protected](35, "zxdg_importer_v2", 1)
[1681028580.227242] <- [email protected](38, "xdg_activation_v1", 1)
[1681028580.227257] <- [email protected](40, "wp_content_type_manager_v1", 1)
[1681028580.227278] <- [email protected](41, "wp_tearing_control_manager_v1", 1)
[1681028580.227298] <- [email protected](43, "wl_drm", 2)
[1681028580.227311] <- [email protected](44, "zwp_linux_dmabuf_v1", 4)
[1681028580.227325] <- [email protected](46, "kde_output_device_v2", 2)
[1681028580.227342] <- [email protected](47, "kde_output_device_v2", 2)
[1681028580.227358] <- [email protected](48, "wl_output", 4)
[1681028580.227374] <- [email protected](49, "wl_output", 4)
[1681028580.227389] <- [email protected](50, "wp_drm_lease_device_v1", 1)
[1681028580.227409] <- [email protected](51, "kde_output_order_v1", 1)
[1681028580.227433] <- [email protected](52, "zwp_text_input_manager_v1", 1)
[1681028580.227458] <- [email protected](53, "zwp_text_input_manager_v2", 1)
[1681028580.227480] <- [email protected](54, "zwp_text_input_manager_v3", 1)
[1681028580.227499] <- [email protected](56, "org_kde_kwin_slide_manager", 1)
[1681028580.227517] <- [email protected](2109)
[1681028580.227526] -> [email protected](17, "zwlr_data_control_manager_v1", 1, 3)
[1681028580.227550] -> [email protected]_data_device(5, 4)
[1681028580.227557] -> [email protected](6)
[1681028580.227589] <- [email protected]_id(6)
[1681028580.227596] <- [email protected](7)
[1681028580.227604] <- [email protected]("")
[1681028580.227612] <- [email protected](2109)
[1681028580.229034] -> [email protected]_data_source(6)
[1681028580.229045] -> [email protected]("UTF8_STRING")
[1681028580.229058] -> [email protected]("text/plain")
[1681028580.229073] -> [email protected]("text/plain;charset=utf-8")
[1681028580.229089] -> [email protected]("TEXT")
[1681028580.229099] -> [email protected]("STRING")
[1681028580.229109] -> [email protected]_selection(6)
[1681028580.229354] <- zwlr_data_control_device_v1⏎                                                                                                                                                                                @5.data_offer(4278190080)
[1681028580.229379] <- [email protected]("UTF8_STRING")
[1681028580.229404] <- [email protected]("text/plain")
[1681028580.229431] <- [email protected]("text/plain;charset=utf-8")
[1681028580.229464] <- [email protected]("TEXT")
[1681028580.229482] <- [email protected]("STRING")
[1681028580.229497] <- [email protected](4278190080)
[1681028580.229607] <- [email protected]("text/plain;charset=utf-8", 4)
[1681028580.230435] <- [email protected]("text/plain;charset=utf-8", 4)

@bugaevc
Copy link
Collaborator

bugaevc commented Apr 9, 2023

application/x-shellscript

wl-clipboard treats all types ending with script as textual, so that explains it.

We hope to eventually switch to using file(1) to determine the textuality (is that a word?) in a more reliable way, see bugaevc/wl-clipboard#97.

@YaLTeR
Copy link
Owner

YaLTeR commented Apr 9, 2023

Thanks, yeah, that would be the reason.

We hope to eventually switch to using file(1) to determine the textuality (is that a word?) in a more reliable way, see bugaevc/wl-clipboard#97.

How does file determine the charset though? If it's just reading a few first bytes then for wl-clipboard-rs it makes sense to just do that manually without relying on file I think.

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