简介

由 Rust 编写的轻量、高效、可自定义的高颜值终端!它开箱即用,支持各种提示符的定制,适用于 Windows、Linux、Android 和 macOS 等系统。

安装和配置

下面分别介绍在Windows(以PowerShell为例)和Linux如何安装配置

windows系统

使用winget安装
winget install --id Starship.Starship
安装scoop
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression
安装Nerd Font字体

这里用的JetbrainsMono-NF字体,其他字体可以去Nerd Font官网查看

scoop install JetbrainsMono-NF
将初始化脚本添加PowerShell配置文件

将以下内容添加到 Microsoft.PowerShell_profile.ps1。 你可以在 PowerShell 通过 $PROFILE 变量来查询文件的位置。通常目录的地址是%USERPROFILE%\Documents\PowerShell,如果Microsoft.PowerShell_profile.ps1 文件不存在则需要创建一下。

Invoke-Expression (&starship init powershell)
配置Starship

将下面附件的内容添加到%USERPROFILE%\.config\starship.toml ,如果starship.toml 文件不存在则需要创建一下。

starship.toml

从新打开PowerShell验证一下

这里可以看到一些小表情,git 的信息,当前项目的语言版本信息等

Linux系统

执行安装命令
curl -sS https://starship.rs/install.sh | sh
修改配置文件

~/.bashrc文件的最后,添加以下内容

eval "$(starship init bash)"
配置Starship

~/.config目录下创建starship.toml 文件,将starship.toml的内容复制到配置文件里面

Starship项目仓库地址

https://github.com/starship/starship

文章作者: 陆壹
版权声明: 本站所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 陆壹笔记
应用 PowerShell PowerShell Starship terminal
喜欢就支持一下吧