相容性優先
能夠在最常見的作業系統之中最常見的 shell 上運作。 在各處使用它吧!
適合任何 shell 的最小、極速、無限客製化的提示字元!
安裝 starship 執行檔:
使用 Shell 安裝:
curl -sS https://starship.rs/install.sh | sh如果想更新已安裝的 Starship,請重新執行上述指令。 指令只會更新 Starship 執行檔本身,不會影響到任何已撰寫的設定檔。
使用 Homebrew:
brew install starship使用 Winget:
winget install starship將初始化腳本 (script) 加入你的 shell 的設定檔:
將以下內容放到 ~/.bashrc 的結尾:
# ~/.bashrc
eval "$(starship init bash)"將以下內容放到 ~/.config/fish/config.fish 的結尾:
# ~/.config/fish/config.fish
starship init fish | source將以下內容放到 ~/.zshrc 的結尾:
# ~/.zshrc
eval "$(starship init zsh)"將以下內容放到 Microsoft.PowerShell_profile.ps1 的結尾。 你可以藉由在 PowerShell 查詢 $PROFILE 變數以取得這個檔案的位置。 一般來說,檔案會出現在 ~\Documents\PowerShell\Microsoft.PowerShell_profile.ps1,若是在 -Nix 上,檔案則會出現在 ~/.config/powershell/Microsoft.PowerShell_profile.ps1。
Invoke-Expression (&starship init powershell)將以下內容放到 ~/.config/ion/initrc 的結尾:
# ~/.config/ion/initrc
eval $(starship init ion)Only elvish v0.18 or higher is supported.
Add the following to the end of ~/.config/elvish/rc.elv (%AppData%\elvish\rc.elv on Windows):
# ~/.elvish/rc.elv
eval (starship init elvish)For elvish versions prior to v0.21.0 the config file might instead be ~/.elvish/rc.elv
將以下內容放到 ~/.tcshrc 的結尾:
# ~/.tcshrc
eval `starship init tcsh`This will change in the future. 只有支援 Nushell v0.96+。
Add the following to the end of your Nushell configuration (find it by running $nu.config-path in Nushell):
mkdir ($nu.data-dir | path join "vendor/autoload")
starship init nu | save -f ($nu.data-dir | path join "vendor/autoload/starship.nu")將以下內容加到 ~/.xonshrc 的結尾:
# ~/.xonshrc
execx($(starship init xonsh))您需要在 Cmd 中使用 Clink (v1.2.30+)。 新增下列的內容到檔案 starship.lua 中並將這個檔案存放在 Clink scripts 的路徑下方:
-- starship.lua
load(io.popen('starship init cmd'):read("*a"))()