Description
Launching micro in WSL takes ~1 second for me before the main UI appears.
I checked out master and manually added timing points. All the time is spent here: https://github.com/micro-editor/micro/blob/393cf24858e63ba75af1480b618d2e3add5b9e3e/cmd/micro/micro.go#L386
When I add timing points to break down each clipboard option, I get
2026/09/05 00:24:27 Type init: *clipper.Custom
2026/09/05 00:24:28 Time to init fail: 126.397986ms
2026/09/05 00:24:28 Type init: *clipper.Wayland
2026/09/05 00:24:28 Time to init fail: 126.933187ms
2026/09/05 00:24:28 Type init: *clipper.Xclip
2026/09/05 00:24:28 Time to init fail: 126.090087ms
2026/09/05 00:24:28 Type init: *clipper.Xsel
2026/09/05 00:24:28 Time to init fail: 124.130887ms
2026/09/05 00:24:28 Type init: *clipper.Wsl
2026/09/05 00:24:28 Time to init succeed: 381.408161msMy understanding is that resolving non-existent commands is slow in WSL because it needs to check all the Windows paths. The ~120ms matches what I get when executing time which noexist.
I have 43 Windows entries in my PATH which might be higher than average? because I install a lot of tools through winget and each one gets its own path entry when installed that way.
I tested manually creating a micro-clip script and adding it to my first path entry (Linux folder) so micro doesn't need to try every other clip option in the list and with that, micro starts up instantly. Only later did I realize micro allows setting "clipboard": "terminal" in the config to use OSC 52 which will bypass all of this logic and works perfectly in Windows Terminal.
I think others might run into this issue as well and it might be beneficial to:
- Mention
clipboard": "terminal"in the README in the https://github.com/micro-editor/MICRO#wsl-and-windows-console section (will also help with https://github.com/micro-editor/micro/issues/1365). Out of curiosity, I checked what https://github.com/microsoft/edit does and it appears like they only support OSC 52, falling back to an internal buffer for copying/pasting when OSC 52 is not supported. - Make UI startup time not synchronously blocked by clipboard initialization? Not totally sure if okay, it's possible to type while the UI is still loading.
Environment
- Version: 2.0.15
- OS: Arch Linux (via WSL)
- Terminal: Windows Terminal
Related to #4105. But maybe we should prioritize within
clipperitself. We have some more issues related to it.