starship/docs/ja-JP/faq/README.md

8.1 KiB
Raw Blame History

Frequently Asked Questions

デモGIFで使用される構成は何ですか

デモのGIFのようにコマンド補完はどうしたら使用できますか

補完サポート、または自動補完は選択したシェルによって提供されます。 デモ中では、デフォルトのFish Shellによって補完されています。 Z Shell (zsh) を利用しているのであれば、zsh-autosuggestionsを参照してください。

トップレベルのformat<module>.disabledは同じように動作しますか?

はい、両方ともプロンプトでモジュールを無効にするために使用できます。 モジュールを無効にするだけの場合は、これらの理由から<module> .disabledを無効にする方法をお勧めします。

  • モジュールを無効化することは、トップレベルのformatを削除するよりも明示的です。
  • Starshipが更新されると、新しく作成されたモジュールがプロンプトに追加されます

Starshipはcross-shellとのことです。 私の好みのshellはサポートしていないようですが。

Starshipの構築方法は、事実上すべてのシェルのサポートを追加できるはずです。 Starshipのバイナリはステートレスであり、シェルに依存しないため、シェルがプロンプトのカスタマイズとシェルの拡張をサポートしている限り、Starshipを使用できます。

Starshipをbashで動作させる例を次に示します。

# Get the status code from the last command executed
STATUS=$?

# 実行中のジョブの数を取得します。
NUM_JOBS=$(jobs -p | wc -l)

# プロンプトを `starship prompt`に設定
PS1="$(starship prompt --status=$STATUS --jobs=$NUM_JOBS)"

Starshipに組み込まれたBashの実装は、 Command Durationモジュールなどの高度な機能を可能にし、Starshipが事前にインストールされたBash構成と互換性があるようにするため、少し複雑です。

Starshipのプロンプトで受け入れられるすべてのフラグのリストは、次のコマンドを取得できます。

starship prompt --help

プロンプトは提供されているコンテキストを使用しますが、フラグは「必須」ではありません。

古いバージョンの glibc を使用する Linux ディストリビューションで Starship を実行するにはどうすればよいですか?

CentOS6や7などで事前にビルドされたバイナリを使用していて、"version 'GLIBC_2.18' not found (required by starship)" のようなエラーが出た場合、glibcの替わりに muslでコンパイルされたバイナリを使用できます。

curl -sS https://starship.rs/install.sh | sh -s -- --platform unknown-linux-musl

Why do I see Executing command "..." timed out. warnings?

Starship executes different commands to get information to display in the prompt, for example the version of a program or the current git status. To make sure starship doesn't hang while trying to execute these commands we set a time limit, if a command takes longer than this limit starship will stop the execution of the command and output the above warning, this is expected behaviour. This time limit is configurable using the command_timeoutkey so if you want you can increase the time limit. You can also follow the debugging steps below to see which command is being slow and see if you can optimise it. Finally you can set the STARSHIP_LOG env var to error to hide these warnings.

よくわからない記号を見つけました。これはどういった意味ですか?

不明な記号に遭遇した場合、starship explain を使用することで、現在表示しているモジュールの説明を見ることができます。

Starship is doing something unexpected, how can I debug it?

You can enable the debug logs by using the STARSHIP_LOG env var. These logs can be very verbose so it is often useful to use the module command if you are trying to debug a particular module, for example, if you are trying to debug the rust module you could run the following command to get the trace logs and output from the module.

env STARSHIP_LOG=trace starship module rust

If starship is being slow you can try using the timings command to see if there is a particular module or command that to blame.

env STARSHIP_LOG=trace starship timings

This will output the trace log and a breakdown of all modules that either took more than 1ms to execute or produced some output.

Finally if you find a bug you can use the bug-report command to create a Github issue.

starship bug-report

プロンプトにグリフ記号が表示されないのはなぜですか?

これの最も一般的な原因は、システムの設定ミスです。 いくつかのLinuxディストリビューション 特に、すぐに使用できるフォントサポートは付属していません。 次のことを確認する必要があります。

  • ロケールが、de_DE.UTF-8 ja_JP.UTF-8などのUTF-8に設定されている。 LC_ALLがUTF-8でない場合、変更する必要があります
  • 絵文字フォントがインストールされている。 ほとんどのシステムにはデフォルトで絵文字フォントが付属していますが、 一部 (特にArch Linux) はそうではありません。 通常、システムの パッケージマネージャーからインストールすることができます。--noto emojiは一般的な選択肢です。
  • Nerd Fontを使用している。

システムをテストするには、ターミナルで次のコマンドを実行します。

echo -e "\xf0\x9f\x90\x8d"
echo -e "\xee\x82\xa0"

1行目はsnake emojiを生成し、2行目はpowerline branch symbol (e0a0)を生成するはずです。

いずれかのシンボルが正しく表示されない場合でも、システムの設定が間違っています。 残念ながら、フォント設定を正しくするのは難しい場合があります。 Discordのユーザーがお役に立てるかもしれません。 両方の記号が正しく表示されているにもかかわらず、まだStarshipに表示されていない場合は、バグ報告をしてください!

Starshipをアンインストールするにはどうすればいいですか?

Starshipは、最初の場所にインストールするのと同じくらい簡単にアンインストールできます。

  1. Starshipを初期化するために使用した、シェルの設定行を削除します (例:~/.bashrc)。
  2. Starshipのバイナリを削除します。

Starship がパッケージマネージャを使用してインストールされている場合は、アンインストール手順については、そのドキュメントを参照してください。

Starship をインストールスクリプトを使用してインストールした場合、次のコマンドでバイナリが削除されます。

# Locate and delete the starship binary
sh -c 'rm "$(command -v 'starship')"'