LoginSignup
1
0

Starshipが遅いときにやること

Posted at

starshipはあらゆるシェルを可愛くデコれる優れものです。
しかし、新しいPCを買ったら何故かプロンプトが目で認識できるくらいに遅くなった。古いPCとバージョンやら何やら比較するも、理由がわからず...
そんなとき、starship timingsというコマンドを発見しました。これは、プロンプト出力の所要時間を計測してくれるコマンドです。これを叩いてみたところ

⌚ 22:54:10 ~\Desktop <base> took 9s
❯❯❯ starship timings

 Here are the timings of modules in your prompt (>=1ms or output):
 battery     -  284ms  -   ""
 directory   -   <1ms  -   "~\Desktop "
 conda       -   <1ms  -   "<base> "
 line_break  -   <1ms  -   "\n"
 character   -   <1ms  -   "❯❯❯ "
 time        -   <1ms  -   "⌚ 22:54:19 "

のような出力が得られました。どうやら、"battery"で時間を食っているようです。デフォルトでPCのバッテリーが少ないときに教えてくれる機能ですね。このときバッテリーは十分にあったので出力が""になっています。starship configでconfigファイルを開いて以下のように編集しました。

[battery]
disabled = true

そしたら解決しました。

多分新しいPCのOSかハードの方でバッテリーの数値取得が遅くなったとかそういう理由ですかね..

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0