-
Notifications
You must be signed in to change notification settings - Fork 318
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
Cannot copy text *into* Kate editor, copying text *from* Kate works fine. #15
Comments
@mucki-at , I'm not able to repro this. Does this repro consistently for you or only sometime ? Copy/paste in both direction works fine for me. |
It seemed pretty consistent before, but it turns out it is actually random.
I tried to see a pattern, but have not been able to find one so far.
…On Wed, Nov 25, 2020 at 8:51 AM Hideyuki Nagase ***@***.***> wrote:
@mucki-at <https://github.com/mucki-at> , I'm not able to repro this.
Does this repro consistently for you or only sometime ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#119 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFR6C7MXEWU6IFDTVDERLVLSRUY2DANCNFSM4TVARXBQ>
.
|
@mucki-at , I looked at attached weston.log from you, while I can't be 100% sure, but below can be clue, Below means when apps (notepad in your case) pasted text into Windows's clipboard, mstsc.exe informs Linux side about what formats (say text, html, bitmap...) in Windows' clipboard, so Linux side can pull those if supported, but below shows it has 0 formats in there, thus nothing can be copy from Windows side... I will see if I can have more extensive logging around this. [12:26:14.475] Client: clipboard format list: numFormats:0 |
I tried to reproduce this and couldn't either. We've done a lot of changes to the clipboard support and fixes many issues since that was originally open. Resolving for now, please let us know if you are still seeing issue on more recent build. |
Experiencing the same behavior as OP. It is random. Sometimes works, sometimes doesn't. Seems I can get it working if I copy and paste several times in other locations in windows before finally copying and pasting to the gui app I'm using. |
@devcircus , would you please provide weston.log from \mnt\wslg ? it would be helpful if you can capture weston.log right after the issue occurs. thanks! |
I have the same issue as OP when try to work with my IDE in Linux, anything I copy from my windows does not get pasted into Linux GUI.
Copying from terminal output works, but from browsers and other rich text sources - does not. |
@IvanChepurnyi , yes, currently "text/plain;charset=utf-8.0.0" is not recognized. it has to be exactly "text/plain;charset=utf-8". would you please let me know what is your IDE software? and also it would be helpful if you can confirmed pasting from Windows works with other Linux app, such as Firefox and gedit? thanks! |
I use PHPStorm (IntelliJ IDEA variant) started from Linux and copy from various apps like Notepad, Notepad++, Edge, etc. The only app from which copy-pasting works the Terminal app. Anything that resembles utf-8 contents seems not working. I've also installed Firefox on Linux and tried to paste data from Windows, and all works flawlessly; only JetBrains IDE seems to fail. |
I still have the same problem, from Windows to any WSL/Ubuntu software or Windows terminal(WSL, CMD and PowerShell) it works perfectly. But if I copy it from any .log, .txt or software from WSL/Ubuntu it doesn't work in the following situations:
|
I also add that I have PHPStorm installed inside WSL and it does not work to paste from the Windows to any PHPStorm file. Is there no solution for this? |
I also have this issue. Here is a dump of the logs produced while trying to do the following: In Windows -> select text -> Ctrl + C -> in WSLg running app (PHPStorm) -> Ctrl + V I also found that for Gitkraken it's not working too. Same problem as with PHPStorm. In Gedit I can paste the content. weston.log
|
@mmachatschek , thanks for reportng. I installed PhpStrom (2021.1.2) from JetBrains Toolbox and copied text from Windows notepad and pasted with "Ctrl+v" into PhpStrom, it seems working for me, see "copy test from Windows". Does this happen to you all the time? Also, if you haven't move up to the latest release of WSLg, version 1.0.19, please update and try again, thanks! |
@hideyukn88, Try copying several lines of text, for example the 3 lines you just typed, and see if it will paste into the editor. |
@chiqui3d , thanks for tips, but I still can't repro. If we can see below error in your weston log. can you locate which has bold number with "not supported by client" error. [19:49:55.040] RDP clipboard_data_source_send (0x7f9690000c90) specified format (text/plain;charset=utf-8.0.0) is not supported by client And find matching number entry with "clipboard_client_format_list (0xXXXXXX) allocated", and just above lines shows the supported format. For example, in my case (below), which is working, I would like to see what you have from "clipboard_client_format_list". thanks! [09:49:44.819] Client: clipboard_client_format_list clipboard format list: numFormats:4 |
Ok, I just found weston log, and I got the same errors. But this can't be fixed? 90% of what I copy is in that format. With GWSL this didn't happen to me.
|
@chiqui3d , thanks for checking, can you share entire weston.log ? or at least until where "clipboard_client_format_list" ? |
Thank you very much, below is what I need. What's happening here is, Windows side propagates both plain text and HTML format as available data format, and Linux side queried HTML format first, then plain text next against same data source, and this second query is failing. I will look into corresponding code path for this scenario, thanks! [00:08:38.767] Client: clipboard_client_format_list clipboard format list: numFormats:5 |
I experience the same issue, both with PhpStorm and Google Chrome running in WSL. I also experience issues with norwegian characters ("æ ø å Æ Ø Å") being pasted as "æ ø Ã¥ Æ Ø Ã…" into Windows. Let me know if you'd prefer I post a separate issue on that. My weston.log is here: https://pastebin.com/VX7R2wtB |
@chiqui3d , would you please let me know what Windows application did you use to "copy" ? In your case, actually the problem is, despite Windows side reports it supports both HTML and plain text, but when Linux side queried the HTML data, the response from Windows side is FAIL (= flags: 2 in below log message), thus following request of plain text is failed too (since we marked this data source invalid) [00:08:38.796] Client: clipboard_client_format_data_response (0x7fbdd8000bf0) flags:2, dataLen:0 I tried same with Windows version of Firefox, copying simple text from web page, then it reports HTML and plain text as available formats and Linux quires HTML first, and succeeded, then query plain text, and it can successfully paste the text into PhpStrom, thus I would like to know what application did you use to copy at Windows side. Thanks! [18:01:14.654] Client: clipboard_client_format_list clipboard format list: numFormats:9 |
Hello, I'm doing it with Chrome |
@chiqui3d , thanks, I still can't reproduce the issue locally. On google chrome (Windows version), highlight the text (below), then Ctrl+c, now switch to PhpStrom, Ctrl+v, it's working fine for me. |
I'm experiencing this issue as well when yanking from Neovim and then trying to paste inside Alacritty terminal. Same error as for others:
Complete log from time of yank to paste:
I can paste yanked text in Windows without issues, but not inside Alacritty (which is running using wslg). Also as others mentioned, sometimes it works right away, but it could be due to some other inputs. I am using Neovim nightly with win32yank to directly integrate with windows clipboard: https://github.com/neovim/neovim/wiki/FAQ#how-to-use-the-windows-clipboard-from-wsl I was able to reproduce it everytime by doing following:
This was done inside Debian 10.9
Also for comparison, executing same sequence of events (except Alacritty) purely inside Windows Terminal works perfectly fine. |
Sorry for the delay, it's true that sometimes it works, but other times it doesn't work for me, it does some strange things that I don't quite understand the behaviour, it would be ideal if it could support copy and paste in any format. |
As someone who uses and develops on all three desktop platforms, I find the WSL2 implementation exceptionally useful. WSLG has made and is still making enough progress so that my daily workflow, which involves a whole lot of Emacs pgtk running on WSL talking to the WSLG wayland compositor, is the smoothest it's ever been. Granted, I too am waiting for example for the window management to catch up (specifically Windows snapping for WSLG apps), but this requires changes to RDP which are being worked on as we speak, see #727 (comment) for in-progress screenshots. The performance and robustness of the WSLG connection justifies its use over my old X11 setups (I used to use X410, and sometimes also mobaXterm for this). My clipboard issues have been fully resolved, thanks to @hideyukn88 (MS) working with @masm11 (an Emacs developer) to figure out and work around an unexpected inconsistency in clipboard handling between wayland, Emacs, and gtk (see #649). To conclude: Thank you to everyone who has contributed to WSL and WSLG, your software adds value (and fun) to my workflow! |
Hi @cpbotha, I am in the same boat as you, running 29.0.50 emacs with pgtk and can't copy from Emacs to Windows. I have downloaded the patch but I am a little confused on how to add the hunks. When I try to in
But I assume I need to patch each line in each diff hunk? Sorry for noobness, I've never patched a diff before. So maybe I am missing something obvious. Maybe if @masm11 has time to comment. To add, my line 347 of |
@saltsucker You will need to use the Are you able to build Emacs from source successfully? |
@saltsucker, @cpbotha, please use #649 for the issue for primary selection with Wayland native Emacs. We are discussing weston upstream engineer to support this in our xwayland clipboard bridge, but not finalized yet. And, to all participants on this issue, thank you very much for reporting the issue, trying out the fixes, and sharing your experience. At this point, the original issues with copy/paste between X11 applications and Windows, I believe, are addressed. Please make sure to update WSL/WSLg from aka.ms/wslstorepage manually for moving up from WSLg 1.0.2x to 1.0.3x. (currently we are waiting a wsl.exe patch to distributed from Windows OS itself, then Thus, I'm going to close this issue, and if there is any issue arise, please open as new issue with specific details, thank you! |
I am confused... I am on WSLg 1.0.39 and still have this issue?
I downloaded the WSLg Preview from the Store. (Because I also needed to fix keys getting stuck and it was reported the Preview had the fix for this) |
@saltsucker, no it does not fix the clipboard issue with Emacs with pgdk, it need the fix for #649. Thanks! |
@cpbotha calling that command from
I tried it on a freshly cloned emacs as well. Yes I can build emacs from source successfully. |
Oh sorry, you're just saying for us to use that thread, heh... >.< |
The patch needs to be redone as commit be35c92c90d455739a6ff9d4beefa2b35d044852 rewrote pgtkselect.c |
I gave it a shot this weekend, but I was not able to port the In the meantime, I'm using this bit of code in my init to work around the issue:
It calls out to the |
Hello @hideyukn88 and @cpbotha I am glad to see this is closed. Please let me know if you want me to give this a test in my environment. I've been using the workaround |
This does NOT work on WSL2 using Ubuntu-22.04 on Windows 10 for compiling Emacs from source with your patch to supposedly fix the lack of the ability to copy and paste 'pgtk' apps. Here are my steps (Though I do find it very annoying that no one included this because most people using WSL2 just want to try out Linux apps, and probably have no idea how to use default Linux tools by default... so you should have included every step in terms of how to actually use the patch you gave in the first place) I used 'wget' to grab the file on Ubuntu 22.04 via WSL2: I then unzipped the gunzip file '.gz' file you linked using the following command: I then moved this patch file into the 'emacs' folder where I had git cloned the latest Git repo of Emacs:
I then tried the following patch command with the following failure output:
Hence, I am re-opening this issue as this is not resolved. |
UPDATE:
|
My windows 11 laptop has become useless due to this bug. I can't paste into Emacs from another application. It happened after the last windows 11 update. Tried with (setq select-enable-clipboard nil) and using the wl-copy utility. It didn't work. By now I'm resorting to writing content to a file with notepad, opening it in Emacs and then copying to the buffer that I need. Any help? |
I was surprised to learn some months back that Po Lu, who contributed massively to pgtk support in Emacs, recommends quite strongly against using it if you have the option of using plain old X. See this email (and its surrounding discussion) on the mailing list: https://lists.gnu.org/archive/html/emacs-devel/2022-04/msg01005.html Mostly because of that, but also a little bit due to this bug and its work-around, I moved back to X11 Emacs on WSLg and have been enjoying a much smoother ride because of it. |
I had this issue pop up. It seemed to happen after I tried to copy and paste a large amount of data into a pycharm shell runnin g in wslg, afterwards I could copy and paste within pycharm but I couldn't copy from windows to wslg |
@Safrone, would you please share your version info from |
Sure:
|
Hello, I have successfully reproduced this issue. When I copy a large amount of text from Windows 10 to Google Chrome in wslg, it triggers a copy failure and after that, I cannot copy anything from Windows 10 to wslg's application (I have only tried Google Chrome and IDEA for now).
|
Having the same issue with #15 (comment) Any help? |
After so many years, this bug has not been fixed. Currently, wslg needs improvement. |
Hello, why don't you try copying thousands of characters at once? |
@gf9276, copy between Windows and Linux Wayland native application should work regardless of size, but there is issue from upstream branch which causes the problem between Wayland and X11 application, thus this impacts the copy between Windows and X11 since this goes through Windows to Wayland to X11, which is tracked by #743, thanks! |
Workaround that sometimes work: Quickly doing New notebook, so above maybe due to some accessibility feature I'm not aware off. |
Problem(setq interprogram-cut-function
(lambda (text)
(start-process "wl-copy" nil "wl-copy" "--trim-newline" "--type" "text/plain;charset=utf-8" text)))) This workaround, gracefully provided by @cpbotha, works for the most part, but I discovered a bug. Specifically, with this in my One possible cause might be the following known "bug" of
The question, then, is if the wlroots data-control protocol is properly implemented. If it isn't, WorkaroundAs a workaround for the previous workaround, I came up with the following. This solution uses the win32yank utility, a program which is written in rust, and is popular among those who use neovim on WSL. It handles unicode characters, a feature absent from the Windows-native
choco install win32yank
;; WSL clipboard fix
(setq interprogram-cut-function
(lambda (text)
(with-temp-buffer
(insert text)
(call-process-region (point-min) (point-max) "win32yank.exe" nil 0 nil "-i" "--crlf")))) Note that binaries installed through |
Hey, I'm running this version of wslg: I have installed Warp on my ubuntu 22.04.5 LTS Pasting in Warp isn't always working, as discussed above I think it sometimes crashes and after that it stops working. After restarting the app it's working again. |
Environment
Steps to reproduce
WSL logs:
/mnt/wslg
You can access the wslg logs using explorer at:
\\wsl\<Distro-Name>\mnt\wslg
(eg:\\wsl\Ubuntu-20.04\mnt\wslg
)puseaudio.log
weston.log
versions.txt
versions.txt is not copyable (missing permissions):
WSLG ( x86_64 ): 0.2.9+Branch.master.Sha.d49cb28cbf4be209347e3b48315081c1b38e4465
wayland: 8cd7c836eaceccc0e4ada7bdac43d86bfe3e0a0a
FreeRDP: 297cb96a30ed00e1d7cba1ae9035cfeff82dbfd6
weston: a17db71354ad1c453e10a15805d907c52425499c
pulseaudio: 2f0f0b8c3872780f15e275fc12899f4564f01bd5
sharedguestalloc: e2895c6a49105caaa651c05d4b96a46e5a621538
pulseaudio.log
weston.log
Expected behavior
copy/past of text works both directions
Actual behavior
can only copy text from linux to windows, but not other way round
The text was updated successfully, but these errors were encountered: