Slow startup on WSL with default config

オープン
#4,209 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 3 日以内に返信

まだ誰も着手していません。

  • #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 の回避策をドキュメント化するか、起動時の遅延に対処するか、意図する対象範囲を明確にして 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時間
マージ済み PR(30日)
2

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

micro-editor/micro のほかの issue

micro-editor/micro の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。