Slow startup on WSL with default config

未关闭
#4,209 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 3 天内回复

还没有人认领这个 Issue。

  • #4215 来自 @frankischilling —— 已关闭,未合并

评估

难度
3/5
预计耗时
1-2 天
新手友好度
55/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
go
领域
cli, performance

调研方向

从 cmd/micro/micro.go 第 386 行附近开始,检查 issue 中描述的同步剪贴板初始化。然后查看 README 的“WSL and Windows Console”部分以及现有的 "clipboard": "terminal" 配置。完成标准应由 maintainers 定义:记录 OSC 52 workaround、解决启动延迟,或明确预期的范围并验证 WSL 的启动行为。

由索引模型根据 Issue 内容生成。

描述

bug dependencies
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.408161ms

My 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:

Environment
  • Version: 2.0.15
  • OS: Arch Linux (via WSL)
  • Terminal: Windows Terminal
主要语言
Go
星标
29.8k
派生
1.4k
平均合并
1 天 12 小时
30 天内合并 PR
2

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

micro-editor/micro 的其他 Issue

查看 micro-editor/micro 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。