In the WSL(Windows Subsystem Linux), Select something and press Ctrl+C
the result show:

but actually copy failed.

WSL can use the windows' clip.exe to copy content.
You can use micro -version to get the commit hash.
Commit hash: 3a8898d
OS: Arch WSL2(Linux version 4.19.55-microsoft-standard (oe-user@oe-host) (gcc version 7.3.0 (GCC)) #1 SMP Fri Jun 28 20:53:12 UTC 2019)
Terminal: Cmder
Can confirm.
Can also confirm.
OS: Elementary OS 5.1, default Terminal.
not complaining. came here for this exact same issue only to realize it was open 1 year ago and nothing done...
Either it was solved some where else or will not be solve.
I'm not sure how micro can detect that it is running in WSL rather than Linux, and therefore should use clip.exe instead of xclip/xsel. In addition clip.exe appears to only support copying and not pasting. Also, it appears support for OSC52 was recently merged into the WSL terminal (https://github.com/microsoft/terminal/pull/5823), and new versions of micro (nightly builds) support this if you set the clipboard option to terminal. It seems the WSL terminal only supports copying with OSC52 and not pasting (for security reasons).
Unfortunately I don't use WSL (maybe I should install it though) so it is difficult for me to test.
Perhaps it is possible to make a script on your system called xclip which performs Windows commands to copy/paste. For example, I found this Github repository which seems to do this: https://github.com/Konfekt/xclip-xsel-WSL.
Thanks for the reply. I've look at different options with no avail.
copy send command: xclip -in -selection clipboard, but don't know how to read the clipboard. The Github repo you pointed, didn't work for same reason, no access to the clipboard.
If you want me to try a few thinks, let me know. More than open to help.
I was intrigued with a different behavior in nano vs micro.
In nano, selection through mouse shows a "pale white" while selection in micro shows a "solid white".
In nano, the "solid white" doesn't copy and thought copy-paste was more related to text selection rather than the proper commands.
I did set mouse to false in settings and copy-paste works as expected in WSL2.
For anyone with similar issue:
settings.json:
{
"autosu": true,
"mouse": false,
"tabsize": 2,
"tabstospace": true
}
No need to install xclip or xsel and ctr-c ctrl-v works perfect.
Note: all mouse functionality is gone inside the editor (same as in nano).
Not an ideal solution, but somewhat acceptable.
Yes it's always possible to disable the mouse in micro and fall back to your terminal emulator's selection and copy/paste. The drawback is that the terminal emulator has no concept of multiple splits holding different text, and line numbers not being part of the text.
I got Copy (and Paste) working by uninstalling xclip, and providing this as "xclip" in my path (~/.local/bin):
#!/bin/bash
clip.exe <&0
Most helpful comment
I got Copy (and Paste) working by uninstalling xclip, and providing this as "xclip" in my path (~/.local/bin):