ci: Use `dprint` to format documentation + TOML files (#3426)

Adds Rust-based standardized markdown formatting and a CI step to catch unformatted files.
This commit is contained in:
Kevin Song 2022-01-20 02:32:09 -06:00 committed by GitHub
parent 9a4c1b5cdb
commit 0965667807
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 907 additions and 837 deletions

43
.dprint.json Normal file
View File

@ -0,0 +1,43 @@
{
"incremental": true,
"typescript": {},
"json": {},
"markdown": {
"lineWidth": 100
},
"toml": {},
"includes": [
"docs/**/*.{ts,js,cjs,mjs}",
"**/*.{md,toml,json}"
],
"excludes": [
"**/node_modules",
"**/*-lock.json",
".github/*",
"docs/ar-SA/**",
"docs/ckb-IR/**",
"docs/de-DE/**",
"docs/es-ES/**",
"docs/fr-FR/**",
"docs/id-ID/**",
"docs/it-IT/**",
"docs/ja-JP/**",
"docs/ko-KR/**",
"docs/nl-NL/**",
"docs/pl-PL/**",
"docs/pt-BR/**",
"docs/pt-PT/**",
"docs/ru-RU/**",
"docs/tr-TR/**",
"docs/vi-VN/**",
"docs/zh-CN/**",
"docs/zh-TW/**",
"target/"
],
"plugins": [
"https://plugins.dprint.dev/typescript-0.62.0.wasm",
"https://plugins.dprint.dev/json-0.14.0.wasm",
"https://plugins.dprint.dev/markdown-0.12.0.wasm",
"https://plugins.dprint.dev/toml-0.5.3.wasm"
]
}

17
.github/workflows/format-workflow.yml vendored Normal file
View File

@ -0,0 +1,17 @@
name: Format + Docs Workflow
on:
push:
paths: ["docs/**","**.md","**.toml","**.js","**.json","**.ts"]
pull_request:
paths: ["docs/**","**.md","**.toml","**.js","**.json","**.ts"]
jobs:
# Run the dprint code formatter for documentation
dprint:
name: Dprint [Docs Formatter]
runs-on: ubuntu-latest
steps:
- name: Setup | Checkout
uses: actions/checkout@v2.4.0
- name: Docs | Format
uses: dprint/check@v2.0

View File

@ -1,4 +1,3 @@
# Contributor Covenant Code of Conduct
## Our Pledge
@ -18,23 +17,23 @@ diverse, inclusive, and healthy community.
Examples of behavior that contributes to a positive environment for our
community include:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
- Focusing on what is best not just for us as individuals, but for the
overall community
Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or
- The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
- Other conduct which could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities

View File

@ -95,13 +95,24 @@ cargo clippy --all-targets --all-features
## Formatting
Starship source files are formatted with [rustfmt](https://crates.io/crates/rustfmt-nightly), using the default configuration. Rustfmt will be ran as part of CI. Unformatted code will fail a build, so it is suggested that you run rustfmt locally:
Starship source files are formatted with [rustfmt](https://crates.io/crates/rustfmt-nightly). Markdown and TOML files (among others) are formatted with [dprint](https://github.com/dprint/dprint). Unformatted code will fail the CI, so it is suggested that you run these tools locally.
For rustfmt:
```sh
rustup component add rustfmt
cargo fmt
```
For dprint:
```sh
cargo install dprint
dprint fmt
```
Editor plugins/functionality may help you run these automatically so that you don't accidentally create a PR that fails.
## Testing
Testing is critical to making sure starship works as intended on systems big and small. Starship interfaces with many applications and system APIs when generating the prompt, so there's a lot of room for bugs to slip in.

View File

@ -1,21 +1,21 @@
[package]
name = "starship"
version = "1.2.1"
edition = "2021"
authors = ["Starship Contributors"]
homepage = "https://starship.rs"
documentation = "https://starship.rs/guide/"
repository = "https://github.com/starship/starship"
readme = "README.md"
license = "ISC"
keywords = ["prompt", "shell", "bash", "fish", "zsh"]
categories = ["command-line-utilities"]
build = "build.rs"
categories = ["command-line-utilities"]
documentation = "https://starship.rs/guide/"
edition = "2021"
homepage = "https://starship.rs"
# Keep `/` in front of `README.md` to exclude localized readmes
include = ["src/**/*", "build.rs", "Cross.toml", "LICENSE", "README.md"]
keywords = ["prompt", "shell", "bash", "fish", "zsh"]
license = "ISC"
readme = "README.md"
repository = "https://github.com/starship/starship"
description = """
The minimal, blazing-fast, and infinitely customizable prompt for any shell! 🌌
"""
# Keep `/` in front of `README.md` to exclude localized readmes
include = ["src/**/*", "build.rs", "Cross.toml", "LICENSE", "README.md"]
[badges]
is-it-maintained-issue-resolution = { repository = "starship/starship" }
@ -27,61 +27,55 @@ default = ["battery"]
battery = ["starship-battery"]
[dependencies]
ansi_term = "0.12.1"
byte-unit = "4.0.13"
chrono = "0.4.19"
clap = { version = "3.0.10", features = ["derive", "cargo", "unicode"] }
clap_complete = "3.0.4"
ansi_term = "0.12.1"
directories-next = "2.0.0"
gethostname = "0.2.2"
git2 = { version = "0.13.25", default-features = false }
toml = { version = "0.5.8", features = ["preserve_order"] }
rust-ini = "0.17.0"
serde_json = "1.0.75"
rayon = "1.5.1"
indexmap = { version = "1.8.0", features = ["serde"] }
log = { version = "0.4.14", features = ["std"] }
notify-rust = { version = "4.5.5", optional = true }
once_cell = "1.9.0"
open = "2.0.2"
os_info = "3.1.0"
path-slash = "0.1.4"
pest = "2.1.3"
pest_derive = "2.1.0"
quick-xml = "0.22.0"
rand = "0.8.4"
rayon = "1.5.1"
regex = "1.5.4"
rust-ini = "0.17.0"
semver = "1.0.4"
serde = { version = "1.0.133", features = ["derive"] }
serde_json = "1.0.75"
sha-1 = "0.10.0"
shadow-rs = "0.8.1"
# battery is optional (on by default) because the crate doesn't currently build for Termux
# see: https://github.com/svartalf/rust-battery/issues/33
starship-battery = { version = "0.7.9", optional = true }
path-slash = "0.1.4"
unicode-segmentation = "1.8.0"
gethostname = "0.2.2"
once_cell = "1.9.0"
chrono = "0.4.19"
sys-info = "0.9.1"
byte-unit = "4.0.13"
starship_module_config_derive = { version = "0.2.1", path = "starship_module_config_derive" }
yaml-rust = "0.4.5"
pest = "2.1.3"
pest_derive = "2.1.0"
regex = "1.5.4"
os_info = "3.1.0"
urlencoding = "2.1.0"
open = "2.0.2"
unicode-width = "0.1.9"
terminal_size = "0.1.17"
quick-xml = "0.22.0"
rand = "0.8.4"
serde = { version = "1.0.133", features = ["derive"] }
indexmap = { version ="1.8.0", features = ["serde"] }
notify-rust = { version = "4.5.5", optional = true }
semver = "1.0.4"
which = "4.2.2"
shadow-rs = "0.8.1"
versions = "4.0.0"
strsim = "0.10.0"
sha-1 = "0.10.0"
sys-info = "0.9.1"
terminal_size = "0.1.17"
toml = { version = "0.5.8", features = ["preserve_order"] }
toml_edit = "0.13.0"
unicode-segmentation = "1.8.0"
unicode-width = "0.1.9"
urlencoding = "2.1.0"
versions = "4.0.0"
which = "4.2.2"
yaml-rust = "0.4.5"
process_control = { version = "3.2.1", features = ["crossbeam-channel"] }
shell-words = "1.0.0"
[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3.9", features = [
"winuser",
"securitybaseapi",
"processthreadsapi",
"handleapi",
"impl-default",
] }
winapi = { version = "0.3.9", features = ["winuser", "securitybaseapi", "processthreadsapi", "handleapi", "impl-default"] }
[target.'cfg(not(windows))'.dependencies]
nix = "0.23.1"
@ -90,8 +84,8 @@ nix = "0.23.1"
shadow-rs = "0.8.1"
[dev-dependencies]
tempfile = "3.2.0"
mockall = "0.11"
tempfile = "3.2.0"
[profile.release]
codegen-units = 1

View File

@ -330,7 +330,7 @@ Add the following to the end of your Nushell configuration (find it by running `
startup = [
"mkdir ~/.cache/starship",
"starship init nu | save ~/.cache/starship/init.nu",
"source ~/.cache/starship/init.nu"
"source ~/.cache/starship/init.nu",
]
prompt = "starship_prompt"
```

View File

@ -2,5 +2,5 @@ disallowed-methods = [
# std::process::Command::new may inadvertly run executables from the current working directory
"std::process::Command::new",
# Setting environment variables can cause issues with non-rust code
"std::env::set_var"
"std::env::set_var",
]

View File

@ -3,77 +3,87 @@ module.exports = {
"/": {
lang: "en-US",
title: "Starship",
description: "The minimal, blazing-fast, and infinitely customizable prompt for any shell!"
description: "The minimal, blazing-fast, and infinitely customizable prompt for any shell!",
},
"/de-DE/": {
lang: "de-DE",
title: "Starship",
description: "Minimale, super schnelle und unendlich anpassbare Prompt für jede Shell!"
description: "Minimale, super schnelle und unendlich anpassbare Prompt für jede Shell!",
},
"/es-ES/": {
lang: "es-ES",
title: "Starship",
description: "¡El prompt minimalista, ultrarápido e infinitamente personalizable para cualquier intérprete de comandos!"
description:
"¡El prompt minimalista, ultrarápido e infinitamente personalizable para cualquier intérprete de comandos!",
},
"/fr-FR/": {
lang: "fr-FR",
title: "Starship",
description: "L'invite minimaliste, ultra-rapide et personnalisable à l'infini pour n'importe quel shell !"
description: "L'invite minimaliste, ultra-rapide et personnalisable à l'infini pour n'importe quel shell !",
},
"/id-ID/": {
lang: "id-ID",
title: "Starship",
description: "Prompt yang minimal, super cepat, dan dapat disesuaikan tanpa batas untuk shell apa pun!"
description: "Prompt yang minimal, super cepat, dan dapat disesuaikan tanpa batas untuk shell apa pun!",
},
"/it-IT/": {
lang: "it-IT",
title: "Starship",
description: "Il prompt minimalista, super veloce e infinitamente personalizzabile per qualsiasi shell!"
description: "Il prompt minimalista, super veloce e infinitamente personalizzabile per qualsiasi shell!",
},
"/ja-JP/": {
lang: "ja-JP",
title: "Starship",
description: "シェル用の最小限の、非常に高速で、無限にカスタマイズ可能なプロンプトです!"
description: "シェル用の最小限の、非常に高速で、無限にカスタマイズ可能なプロンプトです!",
},
"/pt-BR/": {
lang: "pt-BR",
title: "Starship",
description: "O prompt minimalista, extremamente rápido e infinitamente personalizável para qualquer shell!"
description:
"O prompt minimalista, extremamente rápido e infinitamente personalizável para qualquer shell!",
},
"/ru-RU/": {
lang: "ru-RU",
title: "Starship",
description: "Минималистичная, быстрая и бесконечно настраиваемая командная строка для любой оболочки!"
description: "Минималистичная, быстрая и бесконечно настраиваемая командная строка для любой оболочки!",
},
"/vi-VN/": {
lang: "vi-VN",
title: "Starship",
description: "Nhỏ gọn, cực nhanh, và khả năng tuỳ chỉnh vô hạn prompt cho bất kì shell nào!"
description: "Nhỏ gọn, cực nhanh, và khả năng tuỳ chỉnh vô hạn prompt cho bất kì shell nào!",
},
"/zh-CN/": {
lang: "zh-CN",
title: "Starship",
description: "轻量级、反应迅速,可定制的高颜值终端!"
description: "轻量级、反应迅速,可定制的高颜值终端!",
},
"/zh-TW/": {
lang: "zh-TW",
title: "Starship",
description: "適合任何 shell 的最小、極速、無限客製化的提示字元!"
}
description: "適合任何 shell 的最小、極速、無限客製化的提示字元!",
},
},
// prettier-ignore
head: [
["link", { rel: "icon", href: "/icon.png" }],
["meta", { property: "og:title", content: "Starship: Cross-Shell Prompt" }],
["meta", { property: "og:description", content: "Starship is the minimal, blazing fast, and extremely customizable prompt for any shell! Shows the information you need, while staying sleek and minimal. Quick installation available for Bash, Fish, ZSH, Ion, Tcsh, Elvish, Nu, Xonsh, Cmd, and Powershell."}],
["meta", {
property: "og:description",
content:
"Starship is the minimal, blazing fast, and extremely customizable prompt for any shell! Shows the information you need, while staying sleek and minimal. Quick installation available for Bash, Fish, ZSH, Ion, Tcsh, Elvish, Nu, Xonsh, Cmd, and Powershell.",
}],
["meta", { property: "og:type", content: "website" }],
["meta", { property: "og:url", content: "https://starship.rs/" }],
["meta", { property: "og:image", content: "https://starship.rs/icon.png" }],
["meta", { name: "twitter:card", content: "summary"}],
["meta", { name: "twitter:title", content: "Starship: Cross-Shell Prompt"}],
["meta", { name: "twitter:description", content: "Starship is the minimal, blazing fast, and extremely customizable prompt for any shell! Shows the information you need, while staying sleek and minimal. Quick installation available for Bash, Fish, ZSH, Ion, Tcsh, Elvish, Nu, Xonsh, Cmd, and Powershell."}],
["meta", { name: "twitter:image", content: "https://starship.rs/icon.png"}],
["meta", { name: "twitter:alt", content: "Starship: Cross-Shell Prompt"}],
["meta", { name: "twitter:card", content: "summary" }],
["meta", { name: "twitter:title", content: "Starship: Cross-Shell Prompt" }],
["meta", {
name: "twitter:description",
content:
"Starship is the minimal, blazing fast, and extremely customizable prompt for any shell! Shows the information you need, while staying sleek and minimal. Quick installation available for Bash, Fish, ZSH, Ion, Tcsh, Elvish, Nu, Xonsh, Cmd, and Powershell.",
}],
["meta", { name: "twitter:image", content: "https://starship.rs/icon.png" }],
["meta", { name: "twitter:alt", content: "Starship: Cross-Shell Prompt" }],
],
theme: "default-prefers-color-scheme",
themeConfig: {
@ -90,7 +100,7 @@ module.exports = {
algolia: {
apiKey: "44118471f56286dcda7db941a043370d",
indexName: "starship",
appId: "M3XUO3SQOR"
appId: "M3XUO3SQOR",
},
locales: {
"/": {
@ -111,8 +121,8 @@ module.exports = {
["/advanced-config/", "Advanced Configuration"],
["/faq/", "Frequently Asked Questions"],
["/presets/", "Presets"],
["/migrating-to-0.45.0/", "Migrating to v0.45.0"]
]
["/migrating-to-0.45.0/", "Migrating to v0.45.0"],
],
},
"/de-DE/": {
// text for the language dropdown
@ -130,8 +140,8 @@ module.exports = {
["/de-DE/config/", "Konfiguration"],
["/de-DE/advanced-config/", "Erweiterte Konfiguration"],
["/de-DE/faq/", "Häufig gestellte Fragen"],
["/de-DE/presets/", "Konfigurations-Beispiele"]
]
["/de-DE/presets/", "Konfigurations-Beispiele"],
],
},
"/es-ES/": {
// text for the language dropdown
@ -149,8 +159,8 @@ module.exports = {
["/es-ES/config/", "Configuración"],
["/es-ES/advanced-config/", "Configuración Avanzada"],
["/es-ES/faq/", "Preguntas frecuentes"],
["/es-ES/presets/", "Ajustes predeterminados"]
]
["/es-ES/presets/", "Ajustes predeterminados"],
],
},
"/fr-FR/": {
// text for the language dropdown
@ -168,8 +178,8 @@ module.exports = {
["/fr-FR/config/", "Configuration"],
["/fr-FR/advanced-config/", "Configuration avancée"],
["/fr-FR/faq/", "Foire aux questions"],
["/fr-FR/presets/", "Paramètres par défaut"]
]
["/fr-FR/presets/", "Paramètres par défaut"],
],
},
"/id-ID/": {
// text for the language dropdown
@ -187,8 +197,8 @@ module.exports = {
["/id-ID/config/", "Konfigurasi"],
["/id-ID/advanced-config/", "Konfigurasi Lanjutan"],
["/id-ID/faq/", "Pertanyaan Umum"],
["/id-ID/presets/", "Prasetel"]
]
["/id-ID/presets/", "Prasetel"],
],
},
"/it-IT/": {
// text for the language dropdown
@ -206,8 +216,8 @@ module.exports = {
["/it-IT/config/", "Configurazione"],
["/it-IT/advanced-config/", "Configurazione Avanzata"],
["/it-IT/faq/", "FAQ"],
["/it-IT/presets/", "Preset"]
]
["/it-IT/presets/", "Preset"],
],
},
"/ja-JP/": {
// text for the language dropdown
@ -226,8 +236,8 @@ module.exports = {
["/ja-JP/advanced-config/", "高度な設定"],
["/ja-JP/faq/", "FAQ"],
["/ja-JP/presets/", "準備するもの"],
["/ja-JP/migrating-to-0.45.0/", "v0.45への移行"]
]
["/ja-JP/migrating-to-0.45.0/", "v0.45への移行"],
],
},
"/pt-BR/": {
// text for the language dropdown
@ -245,8 +255,8 @@ module.exports = {
["/pt-BR/config/", "Configuração"],
["/pt-BR/advanced-config/", "Configuração avançada"],
["/pt-BR/faq/", "Perguntas frequentes"],
["/pt-BR/presets/", "Predefinições"]
]
["/pt-BR/presets/", "Predefinições"],
],
},
"/ru-RU/": {
// text for the language dropdown
@ -264,8 +274,8 @@ module.exports = {
["/ru-RU/config/", "Настройка"],
["/ru-RU/advanced-config/", "Расширенная Настройка"],
["/ru-RU/faq/", "Часто Задаваемые Вопросы"],
["/ru-RU/presets/", "Предустановки"]
]
["/ru-RU/presets/", "Предустановки"],
],
},
"/vi-VN/": {
// text for the language dropdown
@ -283,9 +293,9 @@ module.exports = {
["/vi-VN/config/", "Cấu hình"],
["/vi-VN/advanced-config/", "Cấu hình nâng cao"],
["/vi-VN/faq/", "Các hỏi thường gặp"],
["/vi-VN/presets/", "Mẫu thiết lập"]
]
}
["/vi-VN/presets/", "Mẫu thiết lập"],
],
},
},
"/zh-TW/": {
// text for the language dropdown
@ -301,8 +311,8 @@ module.exports = {
"/zh-TW/",
["/zh-TW/guide/", "指引"],
["/zh-TW/config/", "設定"],
["/zh-TW/advanced-config/", "進階設定"]
]
["/zh-TW/advanced-config/", "進階設定"],
],
},
"/zh-CN/": {
// text for the language dropdown
@ -320,23 +330,23 @@ module.exports = {
["/zh-CN/config/", "配置"],
["/zh-CN/advanced-config/", "高级配置"],
["/zh-CN/faq/", "常见问题"],
["/zh-CN/presets/", "社区配置分享"]
]
}
["/zh-CN/presets/", "社区配置分享"],
],
},
},
plugins: [
[
"@vuepress/google-analytics",
{
ga: "UA-71160903-4"
}
ga: "UA-71160903-4",
},
],
[
"sitemap",
{
hostname: "https://starship.rs"
}
hostname: "https://starship.rs",
},
],
["vuepress-plugin-code-copy", true],
],
['vuepress-plugin-code-copy', true]
]
};

View File

@ -144,7 +144,7 @@ description: Starship is the minimal, blazing fast, and extremely customizable p
startup = [
"mkdir ~/.cache/starship",
"starship init nu | save ~/.cache/starship/init.nu",
"source ~/.cache/starship/init.nu"
"source ~/.cache/starship/init.nu",
]
prompt = "starship_prompt"
```

View File

@ -62,7 +62,7 @@ starship_precmd_user_func="blastoff"
- To run a custom function right before a command runs, you can use the
[`DEBUG` trap mechanism](https://jichu4n.com/posts/debug-trap-and-prompt_command-in-bash/).
However, you **must** trap the DEBUG signal *before* initializing Starship!
However, you **must** trap the DEBUG signal _before_ initializing Starship!
Starship can preserve the value of the DEBUG trap, but if the trap is overwritten
after starship starts up, some functionality will break.
@ -193,9 +193,9 @@ Note: `continuation_prompt` should be set to a literal string without any variab
Note: Continuation prompts are only available in the following shells:
- `bash`
- `zsh`
- `PowerShell`
- `bash`
- `zsh`
- `PowerShell`
### Example
@ -210,15 +210,15 @@ continuation_prompt = "▶▶"
Style strings are a list of words, separated by whitespace. The words are not case sensitive (i.e. `bold` and `BoLd` are considered the same string). Each word can be one of the following:
- `bold`
- `italic`
- `underline`
- `dimmed`
- `inverted`
- `bg:<color>`
- `fg:<color>`
- `<color>`
- `none`
- `bold`
- `italic`
- `underline`
- `dimmed`
- `inverted`
- `bg:<color>`
- `fg:<color>`
- `<color>`
- `none`
where `<color>` is a color specifier (discussed below). `fg:<color>` and `<color>` currently do the same thing, though this may change in the future. `inverted` swaps the background and foreground colors. The order of words in the string does not matter.
@ -226,11 +226,11 @@ The `none` token overrides all other tokens in a string if it is not part of a `
A color specifier can be one of the following:
- One of the standard terminal colors: `black`, `red`, `green`, `blue`,
- One of the standard terminal colors: `black`, `red`, `green`, `blue`,
`yellow`, `purple`, `cyan`, `white`. You can optionally prefix these
with `bright-` to get the bright version (e.g. `bright-white`).
- A `#` followed by a six-digit hexadecimal number. This specifies an
- A `#` followed by a six-digit hexadecimal number. This specifies an
[RGB color hex code](https://www.w3schools.com/colors/colors_hexadecimal.asp).
- A number between 0-255. This specifies an [8-bit ANSI Color Code](https://i.stack.imgur.com/KTSQa.png).
- A number between 0-255. This specifies an [8-bit ANSI Color Code](https://i.stack.imgur.com/KTSQa.png).
If multiple colors are specified for foreground/background, the last one in the string will take priority.

View File

@ -66,7 +66,7 @@ os.setenv('STARSHIP_CACHE', 'C:\\Users\\user\\AppData\\Local\\Temp')
**Variable**: Smaller sub-components that contain information provided by the module. For example, the "version" variable in the "nodejs" module contains the current version of Node.js.
By convention, most modules have a prefix of default terminal color (e.g. `via ` in "nodejs") and an empty space as a suffix.
By convention, most modules have a prefix of default terminal color (e.g. `via` in "nodejs") and an empty space as a suffix.
### Format Strings
@ -97,7 +97,7 @@ In the second part, which is enclosed in a `()`, is a [style string](#style-stri
For example:
- `[on](red bold)` will print a string `on` with bold text colored red.
- `[⌘ $version](bold green)` will print a symbol `⌘ ` followed by the content of variable `version`, with bold text colored green.
- `[⌘ $version](bold green)` will print a symbol `⌘` followed by the content of variable `version`, with bold text colored green.
- `[a [b](red) c](green)` will print `a b c` with `b` red, and `a` and `c` green.
#### Style Strings
@ -121,7 +121,7 @@ For example:
- `(@$region)` will show nothing if the variable `region` is `None` or empty string, otherwise `@` followed by the value of region.
- `(some text)` will always show nothing since there are no variables wrapped in the braces.
- When `$all` is a shortcut for `\[$a$b\] `, `($all)` will show nothing only if `$a` and `$b` are both `None`.
- When `$all` is a shortcut for `\[$a$b\]`, `($all)` will show nothing only if `$a` and `$b` are both `None`.
This works the same as `(\[$a$b\] )`.
#### Special characters
@ -156,14 +156,13 @@ This is the list of prompt-wide configuration options.
### Options
| Option | Default | Description |
| ----------------- | ------------------------------- | ---------------------------------------------------------------- |
| ----------------- | ------------------------------ | ---------------------------------------------------------------- |
| `format` | [link](#default-prompt-format) | Configure the format of the prompt. |
| `right_format` | `""` | See [Enable Right Prompt](/advanced-config/#enable-right-prompt) |
| `scan_timeout` | `30` | Timeout for starship to scan files (in milliseconds). |
| `command_timeout` | `500` | Timeout for commands executed by starship (in milliseconds). |
| `add_newline` | `true` | Inserts blank line between shell prompts. |
### Example
```toml
@ -264,7 +263,7 @@ modules you explicitly add to the format will not be duplicated. Eg.
```toml
# Move the directory to the second line
format="$all$directory$character"
format = "$all$directory$character"
```
## AWS
@ -306,7 +305,7 @@ date is read from the `AWSUME_EXPIRATION` env var.
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
*: This variable can only be used as a part of a style string
### Examples
@ -356,7 +355,7 @@ The `azure` module shows the current Azure Subscription. This is based on showin
### Options
| Variable | Default | Description |
| ----------------- | ---------------------------------------- | ------------------------------------------ |
| ---------- | ---------------------------------------- | ------------------------------------------ |
| `format` | `"on [$symbol($subscription)]($style) "` | The format for the Azure module to render. |
| `symbol` | `"ﴃ "` | The symbol used in the format. |
| `style` | `"blue bold"` | The style used in the format. |
@ -421,7 +420,7 @@ The default value for the `charging_symbol` and `discharging_symbol` option is r
The `display` option is an array of the following table.
| Option | Default | Description |
| -------------------- | ---------- | ----------------------------------------------- |
| -------------------- | ---------- | --------------------------------------------------------------------------------------------------------- |
| `threshold` | `10` | The upper bound for the display option. |
| `style` | `bold red` | The style used if the display option is in use. |
| `charging_symbol` | `-` | Optional symbol displayed if display option is in use, defaults to battery's `charging_symbol` option. |
@ -440,7 +439,6 @@ style = "bold yellow"
discharging_symbol = "💦"
# when capacity is over 30%, the battery indicator will not be displayed
```
## Character
@ -527,9 +525,9 @@ the module will be activated if any of the following conditions are met:
### Options
| Option | Default | Description |
| ------------------- | -------------------------------------- | ------------------------------------------------------------------------ |
| ------------------- | -------------------------------------- | ------------------------------------------------------------------------- |
| `format` | `"via [$symbol($version )]($style)"` | The format for the module. |
| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch`|
| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` |
| `symbol` | `"△ "` | The symbol used before the version of cmake. |
| `detect_extensions` | `[]` | Which extensions should trigger this module |
| `detect_files` | `["CMakeLists.txt", "CMakeCache.txt"]` | Which filenames should trigger this module |
@ -545,7 +543,7 @@ the module will be activated if any of the following conditions are met:
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
*: This variable can only be used as a part of a style string
## COBOL / GNUCOBOL
@ -558,10 +556,10 @@ By default, the module will be shown if any of the following conditions are met:
### Options
| Option | Default | Description |
| ------------------- | ------------------------------------ | ------------------------------------------------------------------------ |
| ------------------- | ------------------------------------ | ------------------------------------------------------------------------- |
| `symbol` | `"⚙️ "` | The symbol used before displaying the version of COBOL. |
| `format` | `"via [$symbol($version )]($style)"` | The format for the module. |
| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch`|
| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` |
| `style` | `"bold blue"` | The style for the module. |
| `detect_extensions` | `["cbl", "cob", "CBL", "COB"]` | Which extensions should trigger this module. |
| `detect_files` | `[]` | Which filenames should trigger this module. |
@ -571,12 +569,12 @@ By default, the module will be shown if any of the following conditions are met:
### Variables
| Variable | Example | Description |
| -------- | --------- | ------------------------------------ |
| version | `v3.1.2.0`| The version of `cobol` |
| -------- | ---------- | ------------------------------------ |
| version | `v3.1.2.0` | The version of `cobol` |
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
*: This variable can only be used as a part of a style string
## Command Duration
@ -599,14 +597,14 @@ running `eval $(starship init $0)`, and then proceed as normal.
### Options
| Option | Default | Description |
| ------------------- | ----------------------------- | ---------------------------------------------------------- |
| -------------------- | ----------------------------- | ---------------------------------------------------------- |
| `min_time` | `2_000` | Shortest duration to show time for (in milliseconds). |
| `show_milliseconds` | `false` | Show milliseconds in addition to seconds for the duration. |
| `format` | `"took [$duration]($style) "` | The format for the module. |
| `style` | `"bold yellow"` | The style for the module. |
| `disabled` | `false` | Disables the `cmd_duration` module. |
| `show_notifications`| `false` | Show desktop notifications when command completes. |
| `min_time_to_notify`| `45_000` | Shortest duration for notification (in milliseconds). |
| `show_notifications` | `false` | Show desktop notifications when command completes. |
| `min_time_to_notify` | `45_000` | Shortest duration for notification (in milliseconds). |
::: tip
@ -622,7 +620,7 @@ supports notifications by running `STARSHIP_LOG=debug starship module cmd_durati
| duration | `16m40s` | The time it took to execute the command |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
*: This variable can only be used as a part of a style string
### Example
@ -663,7 +661,7 @@ This does not suppress conda's own prompt modifier, you may want to run `conda c
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
*: This variable can only be used as a part of a style string
### Example
@ -685,10 +683,10 @@ By default the module will be shown if any of the following conditions are met:
### Options
| Option | Default | Description |
| ------------------- | ------------------------------------ | ------------------------------------------------------------------------ |
| ------------------- | ------------------------------------ | ------------------------------------------------------------------------- |
| `symbol` | `"🔮 "` | The symbol used before displaying the version of crystal. |
| `format` | `"via [$symbol($version )]($style)"` | The format for the module. |
| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch`|
| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` |
| `style` | `"bold red"` | The style for the module. |
| `detect_extensions` | `["cr"]` | Which extensions should trigger this module. |
| `detect_files` | `["shard.yml"]` | Which filenames should trigger this module. |
@ -703,7 +701,7 @@ By default the module will be shown if any of the following conditions are met:
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
*: This variable can only be used as a part of a style string
### Example
@ -726,9 +724,9 @@ By default the module will be shown if any of the following conditions are met:
### Options
| Option | Default | Description |
| ------------------- | ------------------------------------------------- | ------------------------------------------------------------------------ |
| ------------------- | ------------------------------------------------- | ------------------------------------------------------------------------- |
| `format` | `"via [$symbol($version )]($style)"` | The format for the module. |
| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch`|
| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` |
| `symbol` | `"🎯 "` | A format string representing the symbol of Dart |
| `detect_extensions` | `["dart"]` | Which extensions should trigger this module. |
| `detect_files` | `["pubspec.yaml", "pubspec.yml", "pubspec.lock"]` | Which filenames should trigger this module. |
@ -744,7 +742,7 @@ By default the module will be shown if any of the following conditions are met:
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
*: This variable can only be used as a part of a style string
### Example
@ -759,6 +757,7 @@ format = "via [🔰 $version](bold red) "
The `deno` module shows you your currently installed version of [Deno](https://deno.land/).
By default the module will be shown if any of the following conditions are met:
- The current directory contains a `deno.json`, `deno.jsonc`, `mod.ts`, `mod.js`, `deps.ts` or `deps.js` file
### Options
@ -808,7 +807,7 @@ it would have been `nixpkgs/pkgs`.
### Options
| Option | Default | Description |
| ------------------- | -------------------------------------------------- | -------------------------------------------------------------------------------- |
| ------------------- | -------------------------------------------------- | -------------------------------------------------------------------------------------- |
| `truncation_length` | `3` | The number of parent folders that the current directory should be truncated to. |
| `truncate_to_repo` | `true` | Whether or not to truncate to the root of the git repo that you're currently in. |
| `format` | `"[$path]($style)[$read_only]($read_only_style) "` | The format for the module. |
@ -817,7 +816,7 @@ it would have been `nixpkgs/pkgs`.
| `read_only` | `"🔒"` | The symbol indicating current directory is read only. |
| `read_only_style` | `"red"` | The style for the read only symbol. |
| `truncation_symbol` | `""` | The symbol to prefix to truncated paths. eg: "…/" |
| `repo_root_style` | `None` | The style for the root of the git repo when `truncate_to_repo` option is set to false.|
| `repo_root_style` | `None` | The style for the root of the git repo when `truncate_to_repo` option is set to false. |
| `home_symbol` | `"~"` | The symbol indicating home directory. |
| `use_os_path_sep` | `true` | Use the OS specific path seperator instead of always using `/` (e.g. `\` on Windows) |
@ -854,7 +853,7 @@ a single character. For `fish_style_pwd_dir_length = 2`, it would be `/bu/th/ci/
| path | `"D:/Projects"` | The current directory path |
| style\* | `"black bold dimmed"` | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
*: This variable can only be used as a part of a style string
### Example
@ -895,7 +894,7 @@ the context in use).
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
*: This variable can only be used as a part of a style string
### Example
@ -958,7 +957,7 @@ when there is a csproj file in the current directory.
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
*: This variable can only be used as a part of a style string
### Example
@ -1000,7 +999,7 @@ By default the module will be shown if any of the following conditions are met:
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
*: This variable can only be used as a part of a style string
### Example
@ -1043,7 +1042,7 @@ By default the module will be shown if any of the following conditions are met:
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
*: This variable can only be used as a part of a style string
### Example
@ -1062,18 +1061,19 @@ The module will be shown only if any of the following conditions are met:
- The `variable` configuration option matches an existing environment variable
- The `variable` configuration option is not defined, but the `default` configuration option is
::: tip
Multiple environmental variables can be displayed by using a `.`. (see example)
If the `variable` configuration option is not set, the module will display value of variable under the name of text after the `.` character.
Example: following configuration will display value of USER environment variable
```toml
# ~/.config/starship.toml
[env_var.USER]
default = "unknown user"
```
:::
### Options
@ -1094,7 +1094,7 @@ default = "unknown user"
| symbol | | Mirrors the value of option `symbol` |
| style\* | `black bold dimmed` | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
*: This variable can only be used as a part of a style string
### Example
@ -1107,6 +1107,7 @@ default = "unknown shell"
```
Displaying multiple environmental variables:
```toml
# ~/.config/starship.toml
@ -1146,7 +1147,7 @@ By default the module will be shown if any of the following conditions are met:
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
*: This variable can only be used as a part of a style string
### Example
@ -1166,7 +1167,7 @@ other modules.
### Options
| Option | Default | Description |
| ---------- | -------------- | -------------------------------------- |
| ---------- | -------------- | --------------------------------- |
| `symbol` | `"."` | The symbol used to fill the line. |
| `style` | `"bold black"` | The style for the module. |
| `disabled` | `false` | Disables the `fill` module |
@ -1175,7 +1176,7 @@ other modules.
```toml
# ~/.config/starship.toml
format="AA $fill BB $fill CC"
format = "AA $fill BB $fill CC"
[fill]
symbol = "-"
@ -1186,7 +1187,6 @@ Produces a prompt that looks like:
```
AA -------------------------------------------- BB -------------------------------------------- CC
```
## Google Cloud (`gcloud`)
@ -1216,7 +1216,7 @@ This is based on the `~/.config/gcloud/active_config` file and the `~/.config/gc
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
*: This variable can only be used as a part of a style string
### Examples
@ -1271,14 +1271,14 @@ The `git_branch` module shows the active branch of the repo in your current dire
### Variables
| Variable | Example | Description |
| ---------------- | -------- | ------------------------------------------------------------------------------------------------------ |
| ------------- | -------- | ------------------------------------------------------------------------------------------------------ |
| branch | `master` | The current branch name, falls back to `HEAD` if there's no current branch (e.g. git detached `HEAD`). |
| remote_name | `origin` | The remote name. |
| remote_branch | `master` | The name of the branch tracked on `remote_name`. |
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
*: This variable can only be used as a part of a style string
### Example
@ -1298,7 +1298,7 @@ The `git_commit` module shows the current commit hash and also the tag (if any)
### Options
| Option | Default | Description |
| -------------------- | ---------------------------------------------- | ------------------------------------------------------- |
| -------------------- | ------------------------------ | ------------------------------------------------------- |
| `commit_hash_length` | `7` | The length of the displayed git commit hash. |
| `format` | `"[\\($hash$tag\\)]($style) "` | The format for the module. |
| `style` | `"bold green"` | The style for the module. |
@ -1314,7 +1314,7 @@ The `git_commit` module shows the current commit hash and also the tag (if any)
| hash | `b703eb3` | The current git commit hash |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
*: This variable can only be used as a part of a style string
### Example
@ -1357,7 +1357,7 @@ that information will be shown too.
| progress_total | `2` | The total operation progress |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
*: This variable can only be used as a part of a style string
### Example
@ -1384,7 +1384,7 @@ To enable it, set `disabled` to `false` in your configuration file.
### Options
| Option | Default | Description |
| ------------------------- | -------------------------------------------------------------------- | --------------------------------------- |
| -------------------- | ------------------------------------------------------------ | ------------------------------------- |
| `added_style` | `"bold green"` | The style for the added count. |
| `deleted_style` | `"bold red"` | The style for the deleted count. |
| `only_nonzero_diffs` | `true` | Render status only for changed items. |
@ -1394,13 +1394,13 @@ To enable it, set `disabled` to `false` in your configuration file.
### Variables
| Variable | Example | Description |
| ---------------- | ---------- | ----------------------------------- |
| --------------- | ------- | ------------------------------------------- |
| added | `1` | The current number of added lines |
| deleted | `2` | The current number of deleted lines |
| added_style\* | | Mirrors the value of option `added_style` |
| deleted_style\* | | Mirrors the value of option `deleted_style` |
\*: This variable can only be used as a part of a style string
*: This variable can only be used as a part of a style string
### Example
@ -1442,7 +1442,7 @@ current directory.
The following variables can be used in `format`:
| Variable | Description |
| -------------- | ----------------------------------------------------------------------------------------------------------- |
| -------------- | ------------------------------------------------------------------------------------------------------------- |
| `all_status` | Shortcut for`$conflicted$stashed$deleted$renamed$modified$staged$untracked` |
| `ahead_behind` | Displays `diverged`, `ahead`, `behind` or `up_to_date` format string based on the current status of the repo. |
| `conflicted` | Displays `conflicted` when this branch has merge conflicts. |
@ -1454,7 +1454,7 @@ The following variables can be used in `format`:
| `deleted` | Displays `deleted` when a file's deletion has been added to the staging area. |
| style\* | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
*: This variable can only be used as a part of a style string
The following variables can be used in `diverged`:
@ -1534,7 +1534,7 @@ By default the module will be shown if any of the following conditions are met:
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
*: This variable can only be used as a part of a style string
### Example
@ -1574,7 +1574,7 @@ By default the module will be shown if any of the following conditions are met:
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
*: This variable can only be used as a part of a style string
### Example
@ -1602,11 +1602,11 @@ The `hostname` module shows the system hostname.
### Variables
| Variable | Example | Description |
| -------- | ---------- | ------------------------------------ |
| -------- | ---------- | ----------------------------------- |
| hostname | `computer` | The hostname of the computer |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
*: This variable can only be used as a part of a style string
### Example
@ -1649,7 +1649,7 @@ By default the module will be shown if any of the following conditions are met:
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
*: This variable can only be used as a part of a style string
### Example
@ -1668,7 +1668,7 @@ The module will show the number of jobs running if there are at least
2 jobs, or more than the `number_threshold` config value, if it exists.
The module will show a symbol if there is at least 1 job, or more than the
`symbol_threshold` config value, if it exists. You can set both values
to 0 in order to *always* show the symbol and number of jobs, even if there are
to 0 in order to _always_ show the symbol and number of jobs, even if there are
0 jobs running.
The default functionality is:
@ -1695,15 +1695,15 @@ then the module will also show when there are 0 jobs running.
### Options
| Option | Default | Description |
| ----------- | ----------------------------- | ------------------------------------------------ |
| `threshold`\* | `1` | Show number of jobs if exceeded. |
| ------------------------------------------------------------------------------------------------------- | ----------------------------- | ------------------------------------------------------------------------ |
| `threshold`* | `1` | Show number of jobs if exceeded. |
| `symbol_threshold` | `1` | Show `symbol` if the job count is at least `symbol_threshold`. |
| `number_threshold` | `2` | Show the number of jobs if the job count is at least `number_threshold`. |
| `format` | `"[$symbol$number]($style) "` | The format for the module. |
| `symbol` | `"✦"` | The string used to represent the `symbol` variable. |
| `style` | `"bold blue"` | The style for the module. |
| `disabled` | `false` | Disables the `jobs` module. |
\*: This option is deprecated, please use the `number_threshold` and `symbol_threshold` options instead.
| *: This option is deprecated, please use the `number_threshold` and `symbol_threshold` options instead. | | |
### Variables
@ -1713,7 +1713,7 @@ then the module will also show when there are 0 jobs running.
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
*: This variable can only be used as a part of a style string
### Example
@ -1756,7 +1756,7 @@ By default the module will be shown if any of the following conditions are met:
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
*: This variable can only be used as a part of a style string
### Example
@ -1796,7 +1796,7 @@ By default the module will be shown if any of the following conditions are met:
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
*: This variable can only be used as a part of a style string
### Example
@ -1832,7 +1832,7 @@ To enable it, set `disabled` to `false` in your configuration file.
### Options
| Option | Default | Description |
| ----------------------- | -------------------------------------------------- | --------------------------------------------------------------------- |
| ----------------- | -------------------------------------------------- | --------------------------------------------------------------------- |
| `symbol` | `"☸ "` | A format string representing the symbol displayed before the Cluster. |
| `format` | `'[$symbol$context( \($namespace\))]($style) in '` | The format for the module. |
| `style` | `"cyan bold"` | The style for the module. |
@ -1848,7 +1848,7 @@ To enable it, set `disabled` to `false` in your configuration file.
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
*: This variable can only be used as a part of a style string
### Example
@ -1920,7 +1920,7 @@ By default the module will be shown if any of the following conditions are met:
### Options
| Option | Default | Description |
| ------------------- | ------------------------------------ | ----------------------------------------------------------------------------- |
| ------------------- | ------------------------------------ | -------------------------------------------------------------------------- |
| `format` | `"via [$symbol($version )]($style)"` | The format for the module. |
| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` |
| `symbol` | `"🌙 "` | A format string representing the symbol of Lua. |
@ -1934,12 +1934,12 @@ By default the module will be shown if any of the following conditions are met:
### Variables
| Variable | Example | Description |
| -------- | --------- | ------------------------------------ |
| -------- | -------- | ------------------------------------ |
| version | `v5.4.0` | The version of `lua` |
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
*: This variable can only be used as a part of a style string
### Example
@ -1984,8 +1984,8 @@ To enable it, set `disabled` to `false` in your configuration file.
| symbol | `🐏` | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
\*\*: The SWAP file information is only displayed if detected on the current system
*: This variable can only be used as a part of a style string
*\*: The SWAP file information is only displayed if detected on the current system
### Example
@ -2022,7 +2022,7 @@ The `hg_branch` module shows the active branch of the repo in your current direc
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
*: This variable can only be used as a part of a style string
### Example
@ -2066,7 +2066,7 @@ By default the module will be shown if any of the following conditions are met:
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
*: This variable can only be used as a part of a style string
### Example
@ -2103,7 +2103,7 @@ The module will be shown when inside a nix-shell environment.
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
*: This variable can only be used as a part of a style string
### Example
@ -2151,7 +2151,7 @@ By default the module will be shown if any of the following conditions are met:
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
*: This variable can only be used as a part of a style string
### Example
@ -2199,7 +2199,7 @@ By default the module will be shown if any of the following conditions are met:
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
*: This variable can only be used as a part of a style string
### Example
@ -2220,7 +2220,7 @@ to fetch the current project in use.
### Options
| Option | Default | Description |
| ---------------- | ------------------------------------------------ | --------------------------------------------------------------- |
| ---------- | ----------------------------------------------- | -------------------------------------------------------------- |
| `format` | `"on [$symbol$cloud(\\($project\\))]($style) "` | The format for the module. |
| `symbol` | `"☁️ "` | The symbol used before displaying the current OpenStack cloud. |
| `style` | `"bold yellow"` | The style for the module. |
@ -2229,13 +2229,13 @@ to fetch the current project in use.
### Variables
| Variable | Example | Description |
| -------- | ---------- | ------------------------------------ |
| -------- | ------- | ------------------------------------ |
| cloud | `corp` | The current OpenStack cloud |
| project | `dev` | The current OpenStack project |
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
*: This variable can only be used as a part of a style string
### Example
@ -2280,10 +2280,10 @@ package, and shows its current version. The module currently supports `npm`, `ni
### Options
| Option | Default | Description |
| ----------------- | ---------------------------------- | ------------------------------------------------------------------------ |
| ----------------- | --------------------------------- | ------------------------------------------------------------------------- |
| `format` | `"is [$symbol$version]($style) "` | The format for the module. |
| `symbol` | `"📦 "` | The symbol used before displaying the version the package. |
| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch`|
| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` |
| `style` | `"bold 208"` | The style for the module. |
| `display_private` | `false` | Enable displaying version for packages marked as private. |
| `disabled` | `false` | Disables the `package` module. |
@ -2296,7 +2296,7 @@ package, and shows its current version. The module currently supports `npm`, `ni
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
*: This variable can only be used as a part of a style string
### Example
@ -2378,7 +2378,7 @@ By default the module will be shown if any of the following conditions are met:
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
*: This variable can only be used as a part of a style string
### Example
@ -2408,7 +2408,7 @@ By default the module will be shown if any of the following conditions are met:
### Options
| Option | Default | Description |
| ------------------- | ------------------------------------ | ------------------------------------------------------------------------- |
| ---------------- | -------------------------------- | ------------------------------------------------------------------------- |
| `format` | `"via [$symbol$stack]($style) "` | The format string for the module. |
| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` |
| `symbol` | `" "` | A format string shown before the Pulumi stack. |
@ -2424,7 +2424,7 @@ By default the module will be shown if any of the following conditions are met:
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
*: This variable can only be used as a part of a style string
### Example
@ -2444,7 +2444,6 @@ format = "[🛥 ($version )$stack]($style) "
[pulumi]
symbol = "🛥 "
format = "[$symbol$stack]($style) "
```
## PureScript
@ -2476,7 +2475,7 @@ By default the module will be shown if any of the following conditions are met:
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
*: This variable can only be used as a part of a style string
### Example
@ -2516,7 +2515,7 @@ By default the module will be shown if any of the following conditions are met:
| `symbol` | `"🐍 "` | A format string representing the symbol of Python |
| `style` | `"yellow bold"` | The style for the module. |
| `pyenv_version_name` | `false` | Use pyenv to get Python version |
| `pyenv_prefix` | `pyenv ` | Prefix before pyenv version display, only used if pyenv is used |
| `pyenv_prefix` | `pyenv` | Prefix before pyenv version display, only used if pyenv is used |
| `python_binary` | `["python", "python3", "python2"]` | Configures the python binaries that Starship should executes when getting the version. |
| `detect_extensions` | `["py"]` | Which extensions should trigger this module |
| `detect_files` | `[".python-version", "Pipfile", "__init__.py", "pyproject.toml", "requirements.txt", "setup.py", "tox.ini"]` | Which filenames should trigger this module |
@ -2604,9 +2603,9 @@ any of the following conditions are met:
### Options
| Option | Default | Description |
|---------------------|--------------------------------------|-----------------------------------------------|
| ------------------- | ------------------------------------ | ------------------------------------------------------------------------- |
| `format` | `"via [$symbol($version )]($style)"` | The format for the module. |
| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch`|
| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` |
| `symbol` | `"📐"` | A format string representing the symbol of R. |
| `style` | `"blue bold"` | The style for the module. |
| `detect_extensions` | `["R", "Rd", "Rmd", "Rproj", "Rsx"]` | Which extensions should trigger this module |
@ -2659,7 +2658,7 @@ The module will be shown if any of the following conditions are met:
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
*: This variable can only be used as a part of a style string
### Example
@ -2704,7 +2703,7 @@ Starship gets the current Ruby version by running `ruby -v`.
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
*: This variable can only be used as a part of a style string
### Example
@ -2744,7 +2743,7 @@ The module will be shown if any of the following conditions are met:
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
*: This variable can only be used as a part of a style string
### Example
@ -2780,12 +2779,12 @@ By default the module will be shown if any of the following conditions are met:
### Variables
| Variable | Example | Description |
| -------- | -----------| ------------------------------------ |
| -------- | -------- | ------------------------------------ |
| version | `2.13.5` | The version of `scala` |
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
*: This variable can only be used as a part of a style string
### Example
@ -2829,11 +2828,11 @@ To enable it, set `disabled` to `false` in your configuration file.
### Variables
| Variable | Default | Description |
| ----------- | ------- | ---------------------------------------------------------- |
| --------- | ------- | ---------------------------------------------------------- |
| indicator | | Mirrors the value of `indicator` for currently used shell. |
| style\* | | Mirrors the value of option `style`. |
\*: This variable can only be used as a part of a style string
*: This variable can only be used as a part of a style string
### Examples
@ -2872,7 +2871,7 @@ set to a number and meets or exceeds the specified threshold.
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
*: This variable can only be used as a part of a style string
### Example
@ -2907,7 +2906,7 @@ and `$SINGULARITY_NAME` is set.
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
*: This variable can only be used as a part of a style string
### Example
@ -2937,7 +2936,7 @@ This module is not supported on nu shell.
### Options
| Option | Default | Description |
| ------------------------- | ----------------------------- | ------------------------------------------------------ |
| ----------------------- | ----------------------------------------------------------------------------- | ------------------------------------------------------- |
| `format` | `"[$symbol$status]($style) "` | The format of the module |
| `symbol` | `"✖"` | The symbol displayed on program error |
| `success_symbol` | `"✔️"` | The symbol displayed on program success |
@ -2949,14 +2948,14 @@ This module is not supported on nu shell.
| `recognize_signal_code` | `true` | Enable signal mapping from exit code |
| `map_symbol` | `false` | Enable symbols mapping from exit code |
| `pipestatus` | `false` | Enable pipestatus reporting |
| `pipestatus_separator` | `|` | The symbol that separate in pipe program exit codes |
| `pipestatus_separator` | ` | ` |
| `pipestatus_format` | `\\[$pipestatus\\] => [$symbol$common_meaning$signal_name$maybe_int]($style)` | The format of the module when the command is a pipeline |
| `disabled` | `true` | Disables the `status` module. |
### Variables
| Variable | Example | Description |
| ----------------------- | ------- | ----------------------------------------------------------------------- |
| -------------- | ------- | ------------------------------------------------------------------------------------------- |
| status | `127` | The exit code of the last command |
| hex_status | `0x7F` | The exit code of the last command in hex |
| int | `127` | The exit code of the last command |
@ -2968,12 +2967,11 @@ This module is not supported on nu shell.
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
*: This variable can only be used as a part of a style string
### Example
```toml
# ~/.config/starship.toml
[status]
@ -2982,7 +2980,6 @@ symbol = "🔴"
format = '[\[$symbol $common_meaning$signal_name$maybe_int\]]($style) '
map_symbol = true
disabled = false
```
## Sudo
@ -3000,26 +2997,25 @@ To enable it, set `disabled` to `false` in your configuration file.
### Options
| Option | Default | Description |
| -------------- | ----------------------- | ------------------------------------------------------------ |
| --------------- | ----------------------- | ------------------------------------------------------- |
| `format` | `[as $symbol]($style)"` | The format of the module |
| `symbol` | `"🧙 "` | The symbol displayed when credentials are cached |
| `style` | `"bold blue"` | The style for the module. |
| `allow_windows`| `false` | Since windows has no default sudo, default is disabled. |
| `allow_windows` | `false` | Since windows has no default sudo, default is disabled. |
| `disabled` | `true` | Disables the `sudo` module. |
### Variables
| Variable | Example | Description |
| --------- | ------- | ------------------------------------ |
| -------- | ------- | ------------------------------------ |
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
*: This variable can only be used as a part of a style string
### Example
```toml
# ~/.config/starship.toml
[sudo]
@ -3066,7 +3062,7 @@ The module will be shown if any of the following conditions are met:
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
*: This variable can only be used as a part of a style string
### Example
@ -3115,7 +3111,7 @@ By default the module will be shown if any of the following conditions are met:
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
*: This variable can only be used as a part of a style string
### Example
@ -3171,7 +3167,7 @@ Manually setting `time_format` will override the `use_12hr` setting.
| time | `13:08:10` | The current time. |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
*: This variable can only be used as a part of a style string
### Example
@ -3262,7 +3258,7 @@ By default the module will be shown if any of the following conditions are met:
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
*: This variable can only be used as a part of a style string
### Example
@ -3277,6 +3273,7 @@ format = "via [⍱ $version](bold white) "
The `vlang` module shows you your currently installed version of [V](https://vlang.io/).
By default the module will be shown if any of the following conditions are met:
- The current directory contains a file with `.v` extension
- The current directory contains a `v.mod`, `vpkg.json` or `.vpkg-lock.json` file
@ -3296,7 +3293,7 @@ By default the module will be shown if any of the following conditions are met:
### Variables
| Variable | Example | Description |
| -------- | -------- | ------------------------------------ |
| -------- | ------- | ------------------------------------ |
| version | `v0.2` | The version of `v` |
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
@ -3317,7 +3314,7 @@ The module will be shown only if a repository is currently in use.
### Options
| Option | Default | Description |
| ---------- | -------------------------------- | ------------------------------------------------------- |
| ---------- | -------------------------------- | ------------------------------------------------------ |
| `symbol` | | The symbol used before displaying the repository name. |
| `style` | `"bold yellow"` | The style for the module. |
| `format` | `"vcsh [$symbol$repo]($style) "` | The format for the module. |
@ -3326,12 +3323,12 @@ The module will be shown only if a repository is currently in use.
### Variables
| Variable | Example | Description |
| -------- | ------------------------------------------- | ------------------------------------- |
| -------- | ------------------------------------------- | ------------------------------------ |
| repo | `dotfiles` if in a VCSH repo named dotfiles | The active repository name |
| symbol | | Mirrors the value of option `symbol` |
| style\* | `black bold dimmed` | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
*: This variable can only be used as a part of a style string
### Example
@ -3370,7 +3367,7 @@ The module will be shown if any of the following conditions are met:
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
*: This variable can only be used as a part of a style string
### Example
@ -3430,7 +3427,7 @@ Format strings can also contain shell specific prompt sequences, e.g.
### Options
| Option | Default | Description |
| ------------- | ------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| ------------- | ------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `command` | `""` | The command whose output should be printed. The command will be passed on stdin to the shell. |
| `when` | | A shell command used as a condition to show the module. The module will be shown if the command returns a `0` status code. |
| `shell` | | [See below](#custom-command-shell) |
@ -3452,7 +3449,7 @@ Format strings can also contain shell specific prompt sequences, e.g.
| symbol | Mirrors the value of option `symbol` |
| style\* | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
*: This variable can only be used as a part of a style string
#### Custom command shell

View File

@ -63,8 +63,7 @@ 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_timeout`
key](/config/#prompt) so if you want you can increase the time limit. You can
behaviour. This time limit is configurable using the [`command_timeout`key](/config/#prompt) 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.

View File

@ -109,7 +109,7 @@ To configure the prompt to use the older `use_symbol_for_status = true` configur
error_symbol = "[✖](bold red)"
```
*Note:* The `character` element automatically adds a space after, so unlike the other `format` strings, we specifically do not add one in the above examples.
_Note:_ The `character` element automatically adds a space after, so unlike the other `format` strings, we specifically do not add one in the above examples.
#### Command Duration

View File

@ -1,19 +1,19 @@
[package]
name = "starship_module_config_derive"
version = "0.2.1"
edition = "2021"
authors = ["Matan Kushner <hello@matchai.me>"]
homepage = "https://starship.rs"
documentation = "https://starship.rs/guide/"
repository = "https://github.com/starship/starship"
readme = "README.md"
license = "ISC"
keywords = ["prompt", "shell", "bash", "fish", "zsh"]
categories = ["command-line-utilities"]
documentation = "https://starship.rs/guide/"
edition = "2021"
homepage = "https://starship.rs"
include = ["src/**/*", "LICENSE", "README.md"]
keywords = ["prompt", "shell", "bash", "fish", "zsh"]
license = "ISC"
readme = "README.md"
repository = "https://github.com/starship/starship"
description = """
The minimal, blazing-fast, and infinitely customizable prompt for any shell! 🌌
"""
include = ["src/**/*", "LICENSE", "README.md"]
[lib]
name = "starship_module_config_derive"