Slow startup on WSL with default config
维护者通常 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 内容生成。
描述
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:
- 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
- 主要语言
- Go
- 星标
- 29.8k
- 派生
- 1.4k
- 平均合并
- 1 天 12 小时
- 30 天内合并 PR
- 2
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
micro-editor/micro 的其他 Issue
-
feature syntax
难度 2/5 1-3 小时 新手友好度 72/100
micro-editor/micro#4289 ·
维护者通常 3 天内回复
-
Also bind alt-click for multi-cursors可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭feature
难度 2/5 1-3 小时 新手友好度 68/100
micro-editor/micro#4260 ·
维护者通常 3 天内回复
-
XML syntax highlighting breaks if empty tag contains whitespace before close可能已有人在做 @justadityaraj 于 56 天前认领。 未关闭bug syntax
难度 2/5 1-3 小时 新手友好度 68/100
micro-editor/micro#4213 · 1 条评论 ·
维护者通常 3 天内回复
-
难度 1/5 1 小时以内 新手友好度 78/100
micro-editor/micro#3553 · 5 条评论 ·
维护者通常 3 天内回复
-
syntax
难度 2/5 1-3 小时 新手友好度 64/100
micro-editor/micro#2969 · 3 条评论 · 1 个 reaction ·
维护者通常 3 天内回复
查看 micro-editor/micro 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
kubeflow/semantic-operator#52 ·
维护者通常 10 天内回复
-
enhancement help wanted
难度 2/5 1-3 小时 新手友好度 78/100
PramodBasavarajMenasi/siftwise#52 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
dragonflydb/dragonfly-operator#619 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 2 天内回复
-
难度 1/5 1 小时以内 新手友好度 78/100