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 # Contributor Covenant Code of Conduct
## Our Pledge ## Our Pledge
@ -18,23 +17,23 @@ diverse, inclusive, and healthy community.
Examples of behavior that contributes to a positive environment for our Examples of behavior that contributes to a positive environment for our
community include: community include:
* Demonstrating empathy and kindness toward other people - Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences - Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback - Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes, - Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience 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 overall community
Examples of unacceptable behavior include: 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 advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks - Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment - Public or private harassment
* Publishing others' private information, such as a physical or email - Publishing others' private information, such as a physical or email
address, without their explicit permission 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 professional setting
## Enforcement Responsibilities ## Enforcement Responsibilities

View File

@ -95,13 +95,24 @@ cargo clippy --all-targets --all-features
## Formatting ## 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 ```sh
rustup component add rustfmt rustup component add rustfmt
cargo fmt 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
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. 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] [package]
name = "starship" name = "starship"
version = "1.2.1" version = "1.2.1"
edition = "2021"
authors = ["Starship Contributors"] 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" 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 = """ description = """
The minimal, blazing-fast, and infinitely customizable prompt for any shell! 🌌 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] [badges]
is-it-maintained-issue-resolution = { repository = "starship/starship" } is-it-maintained-issue-resolution = { repository = "starship/starship" }
@ -27,61 +27,55 @@ default = ["battery"]
battery = ["starship-battery"] battery = ["starship-battery"]
[dependencies] [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 = { version = "3.0.10", features = ["derive", "cargo", "unicode"] }
clap_complete = "3.0.4" clap_complete = "3.0.4"
ansi_term = "0.12.1"
directories-next = "2.0.0" directories-next = "2.0.0"
gethostname = "0.2.2"
git2 = { version = "0.13.25", default-features = false } git2 = { version = "0.13.25", default-features = false }
toml = { version = "0.5.8", features = ["preserve_order"] } indexmap = { version = "1.8.0", features = ["serde"] }
rust-ini = "0.17.0"
serde_json = "1.0.75"
rayon = "1.5.1"
log = { version = "0.4.14", features = ["std"] } 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 # battery is optional (on by default) because the crate doesn't currently build for Termux
# see: https://github.com/svartalf/rust-battery/issues/33 # see: https://github.com/svartalf/rust-battery/issues/33
starship-battery = { version = "0.7.9", optional = true } 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" } 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" 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" 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"] } process_control = { version = "3.2.1", features = ["crossbeam-channel"] }
shell-words = "1.0.0" shell-words = "1.0.0"
[target.'cfg(windows)'.dependencies] [target.'cfg(windows)'.dependencies]
winapi = { version = "0.3.9", features = [ winapi = { version = "0.3.9", features = ["winuser", "securitybaseapi", "processthreadsapi", "handleapi", "impl-default"] }
"winuser",
"securitybaseapi",
"processthreadsapi",
"handleapi",
"impl-default",
] }
[target.'cfg(not(windows))'.dependencies] [target.'cfg(not(windows))'.dependencies]
nix = "0.23.1" nix = "0.23.1"
@ -90,8 +84,8 @@ nix = "0.23.1"
shadow-rs = "0.8.1" shadow-rs = "0.8.1"
[dev-dependencies] [dev-dependencies]
tempfile = "3.2.0"
mockall = "0.11" mockall = "0.11"
tempfile = "3.2.0"
[profile.release] [profile.release]
codegen-units = 1 codegen-units = 1

View File

@ -330,7 +330,7 @@ Add the following to the end of your Nushell configuration (find it by running `
startup = [ startup = [
"mkdir ~/.cache/starship", "mkdir ~/.cache/starship",
"starship init nu | save ~/.cache/starship/init.nu", "starship init nu | save ~/.cache/starship/init.nu",
"source ~/.cache/starship/init.nu" "source ~/.cache/starship/init.nu",
] ]
prompt = "starship_prompt" 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 may inadvertly run executables from the current working directory
"std::process::Command::new", "std::process::Command::new",
# Setting environment variables can cause issues with non-rust code # Setting environment variables can cause issues with non-rust code
"std::env::set_var" "std::env::set_var",
] ]

View File

@ -3,75 +3,85 @@ module.exports = {
"/": { "/": {
lang: "en-US", lang: "en-US",
title: "Starship", 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/": { "/de-DE/": {
lang: "de-DE", lang: "de-DE",
title: "Starship", 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/": { "/es-ES/": {
lang: "es-ES", lang: "es-ES",
title: "Starship", 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/": { "/fr-FR/": {
lang: "fr-FR", lang: "fr-FR",
title: "Starship", 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/": { "/id-ID/": {
lang: "id-ID", lang: "id-ID",
title: "Starship", 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/": { "/it-IT/": {
lang: "it-IT", lang: "it-IT",
title: "Starship", 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/": { "/ja-JP/": {
lang: "ja-JP", lang: "ja-JP",
title: "Starship", title: "Starship",
description: "シェル用の最小限の、非常に高速で、無限にカスタマイズ可能なプロンプトです!" description: "シェル用の最小限の、非常に高速で、無限にカスタマイズ可能なプロンプトです!",
}, },
"/pt-BR/": { "/pt-BR/": {
lang: "pt-BR", lang: "pt-BR",
title: "Starship", 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/": { "/ru-RU/": {
lang: "ru-RU", lang: "ru-RU",
title: "Starship", title: "Starship",
description: "Минималистичная, быстрая и бесконечно настраиваемая командная строка для любой оболочки!" description: "Минималистичная, быстрая и бесконечно настраиваемая командная строка для любой оболочки!",
}, },
"/vi-VN/": { "/vi-VN/": {
lang: "vi-VN", lang: "vi-VN",
title: "Starship", 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/": { "/zh-CN/": {
lang: "zh-CN", lang: "zh-CN",
title: "Starship", title: "Starship",
description: "轻量级、反应迅速,可定制的高颜值终端!" description: "轻量级、反应迅速,可定制的高颜值终端!",
}, },
"/zh-TW/": { "/zh-TW/": {
lang: "zh-TW", lang: "zh-TW",
title: "Starship", title: "Starship",
description: "適合任何 shell 的最小、極速、無限客製化的提示字元!" description: "適合任何 shell 的最小、極速、無限客製化的提示字元!",
} },
}, },
// prettier-ignore // prettier-ignore
head: [ head: [
["link", { rel: "icon", href: "/icon.png" }], ["link", { rel: "icon", href: "/icon.png" }],
["meta", { property: "og:title", content: "Starship: Cross-Shell Prompt" }], ["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:type", content: "website" }],
["meta", { property: "og:url", content: "https://starship.rs/" }], ["meta", { property: "og:url", content: "https://starship.rs/" }],
["meta", { property: "og:image", content: "https://starship.rs/icon.png" }], ["meta", { property: "og:image", content: "https://starship.rs/icon.png" }],
["meta", { name: "twitter:card", content: "summary" }], ["meta", { name: "twitter:card", content: "summary" }],
["meta", { name: "twitter:title", content: "Starship: Cross-Shell Prompt" }], ["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: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:image", content: "https://starship.rs/icon.png" }],
["meta", { name: "twitter:alt", content: "Starship: Cross-Shell Prompt" }], ["meta", { name: "twitter:alt", content: "Starship: Cross-Shell Prompt" }],
], ],
@ -90,7 +100,7 @@ module.exports = {
algolia: { algolia: {
apiKey: "44118471f56286dcda7db941a043370d", apiKey: "44118471f56286dcda7db941a043370d",
indexName: "starship", indexName: "starship",
appId: "M3XUO3SQOR" appId: "M3XUO3SQOR",
}, },
locales: { locales: {
"/": { "/": {
@ -111,8 +121,8 @@ module.exports = {
["/advanced-config/", "Advanced Configuration"], ["/advanced-config/", "Advanced Configuration"],
["/faq/", "Frequently Asked Questions"], ["/faq/", "Frequently Asked Questions"],
["/presets/", "Presets"], ["/presets/", "Presets"],
["/migrating-to-0.45.0/", "Migrating to v0.45.0"] ["/migrating-to-0.45.0/", "Migrating to v0.45.0"],
] ],
}, },
"/de-DE/": { "/de-DE/": {
// text for the language dropdown // text for the language dropdown
@ -130,8 +140,8 @@ module.exports = {
["/de-DE/config/", "Konfiguration"], ["/de-DE/config/", "Konfiguration"],
["/de-DE/advanced-config/", "Erweiterte Konfiguration"], ["/de-DE/advanced-config/", "Erweiterte Konfiguration"],
["/de-DE/faq/", "Häufig gestellte Fragen"], ["/de-DE/faq/", "Häufig gestellte Fragen"],
["/de-DE/presets/", "Konfigurations-Beispiele"] ["/de-DE/presets/", "Konfigurations-Beispiele"],
] ],
}, },
"/es-ES/": { "/es-ES/": {
// text for the language dropdown // text for the language dropdown
@ -149,8 +159,8 @@ module.exports = {
["/es-ES/config/", "Configuración"], ["/es-ES/config/", "Configuración"],
["/es-ES/advanced-config/", "Configuración Avanzada"], ["/es-ES/advanced-config/", "Configuración Avanzada"],
["/es-ES/faq/", "Preguntas frecuentes"], ["/es-ES/faq/", "Preguntas frecuentes"],
["/es-ES/presets/", "Ajustes predeterminados"] ["/es-ES/presets/", "Ajustes predeterminados"],
] ],
}, },
"/fr-FR/": { "/fr-FR/": {
// text for the language dropdown // text for the language dropdown
@ -168,8 +178,8 @@ module.exports = {
["/fr-FR/config/", "Configuration"], ["/fr-FR/config/", "Configuration"],
["/fr-FR/advanced-config/", "Configuration avancée"], ["/fr-FR/advanced-config/", "Configuration avancée"],
["/fr-FR/faq/", "Foire aux questions"], ["/fr-FR/faq/", "Foire aux questions"],
["/fr-FR/presets/", "Paramètres par défaut"] ["/fr-FR/presets/", "Paramètres par défaut"],
] ],
}, },
"/id-ID/": { "/id-ID/": {
// text for the language dropdown // text for the language dropdown
@ -187,8 +197,8 @@ module.exports = {
["/id-ID/config/", "Konfigurasi"], ["/id-ID/config/", "Konfigurasi"],
["/id-ID/advanced-config/", "Konfigurasi Lanjutan"], ["/id-ID/advanced-config/", "Konfigurasi Lanjutan"],
["/id-ID/faq/", "Pertanyaan Umum"], ["/id-ID/faq/", "Pertanyaan Umum"],
["/id-ID/presets/", "Prasetel"] ["/id-ID/presets/", "Prasetel"],
] ],
}, },
"/it-IT/": { "/it-IT/": {
// text for the language dropdown // text for the language dropdown
@ -206,8 +216,8 @@ module.exports = {
["/it-IT/config/", "Configurazione"], ["/it-IT/config/", "Configurazione"],
["/it-IT/advanced-config/", "Configurazione Avanzata"], ["/it-IT/advanced-config/", "Configurazione Avanzata"],
["/it-IT/faq/", "FAQ"], ["/it-IT/faq/", "FAQ"],
["/it-IT/presets/", "Preset"] ["/it-IT/presets/", "Preset"],
] ],
}, },
"/ja-JP/": { "/ja-JP/": {
// text for the language dropdown // text for the language dropdown
@ -226,8 +236,8 @@ module.exports = {
["/ja-JP/advanced-config/", "高度な設定"], ["/ja-JP/advanced-config/", "高度な設定"],
["/ja-JP/faq/", "FAQ"], ["/ja-JP/faq/", "FAQ"],
["/ja-JP/presets/", "準備するもの"], ["/ja-JP/presets/", "準備するもの"],
["/ja-JP/migrating-to-0.45.0/", "v0.45への移行"] ["/ja-JP/migrating-to-0.45.0/", "v0.45への移行"],
] ],
}, },
"/pt-BR/": { "/pt-BR/": {
// text for the language dropdown // text for the language dropdown
@ -245,8 +255,8 @@ module.exports = {
["/pt-BR/config/", "Configuração"], ["/pt-BR/config/", "Configuração"],
["/pt-BR/advanced-config/", "Configuração avançada"], ["/pt-BR/advanced-config/", "Configuração avançada"],
["/pt-BR/faq/", "Perguntas frequentes"], ["/pt-BR/faq/", "Perguntas frequentes"],
["/pt-BR/presets/", "Predefinições"] ["/pt-BR/presets/", "Predefinições"],
] ],
}, },
"/ru-RU/": { "/ru-RU/": {
// text for the language dropdown // text for the language dropdown
@ -264,8 +274,8 @@ module.exports = {
["/ru-RU/config/", "Настройка"], ["/ru-RU/config/", "Настройка"],
["/ru-RU/advanced-config/", "Расширенная Настройка"], ["/ru-RU/advanced-config/", "Расширенная Настройка"],
["/ru-RU/faq/", "Часто Задаваемые Вопросы"], ["/ru-RU/faq/", "Часто Задаваемые Вопросы"],
["/ru-RU/presets/", "Предустановки"] ["/ru-RU/presets/", "Предустановки"],
] ],
}, },
"/vi-VN/": { "/vi-VN/": {
// text for the language dropdown // text for the language dropdown
@ -283,9 +293,9 @@ module.exports = {
["/vi-VN/config/", "Cấu hình"], ["/vi-VN/config/", "Cấu hình"],
["/vi-VN/advanced-config/", "Cấu hình nâng cao"], ["/vi-VN/advanced-config/", "Cấu hình nâng cao"],
["/vi-VN/faq/", "Các hỏi thường gặp"], ["/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/": { "/zh-TW/": {
// text for the language dropdown // text for the language dropdown
@ -301,8 +311,8 @@ module.exports = {
"/zh-TW/", "/zh-TW/",
["/zh-TW/guide/", "指引"], ["/zh-TW/guide/", "指引"],
["/zh-TW/config/", "設定"], ["/zh-TW/config/", "設定"],
["/zh-TW/advanced-config/", "進階設定"] ["/zh-TW/advanced-config/", "進階設定"],
] ],
}, },
"/zh-CN/": { "/zh-CN/": {
// text for the language dropdown // text for the language dropdown
@ -320,23 +330,23 @@ module.exports = {
["/zh-CN/config/", "配置"], ["/zh-CN/config/", "配置"],
["/zh-CN/advanced-config/", "高级配置"], ["/zh-CN/advanced-config/", "高级配置"],
["/zh-CN/faq/", "常见问题"], ["/zh-CN/faq/", "常见问题"],
["/zh-CN/presets/", "社区配置分享"] ["/zh-CN/presets/", "社区配置分享"],
] ],
} },
}, },
plugins: [ plugins: [
[ [
"@vuepress/google-analytics", "@vuepress/google-analytics",
{ {
ga: "UA-71160903-4" ga: "UA-71160903-4",
} },
], ],
[ [
"sitemap", "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 = [ startup = [
"mkdir ~/.cache/starship", "mkdir ~/.cache/starship",
"starship init nu | save ~/.cache/starship/init.nu", "starship init nu | save ~/.cache/starship/init.nu",
"source ~/.cache/starship/init.nu" "source ~/.cache/starship/init.nu",
] ]
prompt = "starship_prompt" 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 - 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/). [`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 Starship can preserve the value of the DEBUG trap, but if the trap is overwritten
after starship starts up, some functionality will break. after starship starts up, some functionality will break.

View File

@ -156,14 +156,13 @@ This is the list of prompt-wide configuration options.
### Options ### Options
| Option | Default | Description | | Option | Default | Description |
| ----------------- | ------------------------------- | ---------------------------------------------------------------- | | ----------------- | ------------------------------ | ---------------------------------------------------------------- |
| `format` | [link](#default-prompt-format) | Configure the format of the prompt. | | `format` | [link](#default-prompt-format) | Configure the format of the prompt. |
| `right_format` | `""` | See [Enable Right Prompt](/advanced-config/#enable-right-prompt) | | `right_format` | `""` | See [Enable Right Prompt](/advanced-config/#enable-right-prompt) |
| `scan_timeout` | `30` | Timeout for starship to scan files (in milliseconds). | | `scan_timeout` | `30` | Timeout for starship to scan files (in milliseconds). |
| `command_timeout` | `500` | Timeout for commands executed by starship (in milliseconds). | | `command_timeout` | `500` | Timeout for commands executed by starship (in milliseconds). |
| `add_newline` | `true` | Inserts blank line between shell prompts. | | `add_newline` | `true` | Inserts blank line between shell prompts. |
### Example ### Example
```toml ```toml
@ -306,7 +305,7 @@ date is read from the `AWSUME_EXPIRATION` env var.
| symbol | | Mirrors the value of option `symbol` | | symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` | | 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 ### Examples
@ -356,7 +355,7 @@ The `azure` module shows the current Azure Subscription. This is based on showin
### Options ### Options
| Variable | Default | Description | | Variable | Default | Description |
| ----------------- | ---------------------------------------- | ------------------------------------------ | | ---------- | ---------------------------------------- | ------------------------------------------ |
| `format` | `"on [$symbol($subscription)]($style) "` | The format for the Azure module to render. | | `format` | `"on [$symbol($subscription)]($style) "` | The format for the Azure module to render. |
| `symbol` | `"ﴃ "` | The symbol used in the format. | | `symbol` | `"ﴃ "` | The symbol used in the format. |
| `style` | `"blue bold"` | The style 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. The `display` option is an array of the following table.
| Option | Default | Description | | Option | Default | Description |
| -------------------- | ---------- | ----------------------------------------------- | | -------------------- | ---------- | --------------------------------------------------------------------------------------------------------- |
| `threshold` | `10` | The upper bound for the display option. | | `threshold` | `10` | The upper bound for the display option. |
| `style` | `bold red` | The style used if the display option is in use. | | `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. | | `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 = "💦" discharging_symbol = "💦"
# when capacity is over 30%, the battery indicator will not be displayed # when capacity is over 30%, the battery indicator will not be displayed
``` ```
## Character ## Character
@ -527,7 +525,7 @@ the module will be activated if any of the following conditions are met:
### Options ### Options
| Option | Default | Description | | Option | Default | Description |
| ------------------- | -------------------------------------- | ------------------------------------------------------------------------ | | ------------------- | -------------------------------------- | ------------------------------------------------------------------------- |
| `format` | `"via [$symbol($version )]($style)"` | The format for the module. | | `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. | | `symbol` | `"△ "` | The symbol used before the version of cmake. |
@ -545,7 +543,7 @@ the module will be activated if any of the following conditions are met:
| symbol | | Mirrors the value of option `symbol` | | symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` | | 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 ## COBOL / GNUCOBOL
@ -558,7 +556,7 @@ By default, the module will be shown if any of the following conditions are met:
### Options ### Options
| Option | Default | Description | | Option | Default | Description |
| ------------------- | ------------------------------------ | ------------------------------------------------------------------------ | | ------------------- | ------------------------------------ | ------------------------------------------------------------------------- |
| `symbol` | `"⚙️ "` | The symbol used before displaying the version of COBOL. | | `symbol` | `"⚙️ "` | The symbol used before displaying the version of COBOL. |
| `format` | `"via [$symbol($version )]($style)"` | The format for the module. | | `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` |
@ -571,12 +569,12 @@ By default, the module will be shown if any of the following conditions are met:
### Variables ### Variables
| Variable | Example | Description | | 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` | | symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` | | 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 ## Command Duration
@ -599,7 +597,7 @@ running `eval $(starship init $0)`, and then proceed as normal.
### Options ### Options
| Option | Default | Description | | Option | Default | Description |
| ------------------- | ----------------------------- | ---------------------------------------------------------- | | -------------------- | ----------------------------- | ---------------------------------------------------------- |
| `min_time` | `2_000` | Shortest duration to show time for (in milliseconds). | | `min_time` | `2_000` | Shortest duration to show time for (in milliseconds). |
| `show_milliseconds` | `false` | Show milliseconds in addition to seconds for the duration. | | `show_milliseconds` | `false` | Show milliseconds in addition to seconds for the duration. |
| `format` | `"took [$duration]($style) "` | The format for the module. | | `format` | `"took [$duration]($style) "` | The format for the module. |
@ -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 | | duration | `16m40s` | The time it took to execute the command |
| style\* | | Mirrors the value of option `style` | | 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 ### 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` | | symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` | | 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 ### Example
@ -685,7 +683,7 @@ By default the module will be shown if any of the following conditions are met:
### Options ### Options
| Option | Default | Description | | Option | Default | Description |
| ------------------- | ------------------------------------ | ------------------------------------------------------------------------ | | ------------------- | ------------------------------------ | ------------------------------------------------------------------------- |
| `symbol` | `"🔮 "` | The symbol used before displaying the version of crystal. | | `symbol` | `"🔮 "` | The symbol used before displaying the version of crystal. |
| `format` | `"via [$symbol($version )]($style)"` | The format for the module. | | `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` |
@ -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` | | symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` | | 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 ### Example
@ -726,7 +724,7 @@ By default the module will be shown if any of the following conditions are met:
### Options ### Options
| Option | Default | Description | | Option | Default | Description |
| ------------------- | ------------------------------------------------- | ------------------------------------------------------------------------ | | ------------------- | ------------------------------------------------- | ------------------------------------------------------------------------- |
| `format` | `"via [$symbol($version )]($style)"` | The format for the module. | | `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 | | `symbol` | `"🎯 "` | A format string representing the symbol of Dart |
@ -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` | | symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` | | 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 ### Example
@ -759,6 +757,7 @@ format = "via [🔰 $version](bold red) "
The `deno` module shows you your currently installed version of [Deno](https://deno.land/). 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: 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 - The current directory contains a `deno.json`, `deno.jsonc`, `mod.ts`, `mod.js`, `deps.ts` or `deps.js` file
### Options ### Options
@ -808,7 +807,7 @@ it would have been `nixpkgs/pkgs`.
### Options ### Options
| Option | Default | Description | | Option | Default | Description |
| ------------------- | -------------------------------------------------- | -------------------------------------------------------------------------------- | | ------------------- | -------------------------------------------------- | -------------------------------------------------------------------------------------- |
| `truncation_length` | `3` | The number of parent folders that the current directory should be truncated to. | | `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. | | `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. | | `format` | `"[$path]($style)[$read_only]($read_only_style) "` | The format for the module. |
@ -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 | | path | `"D:/Projects"` | The current directory path |
| style\* | `"black bold dimmed"` | Mirrors the value of option `style` | | 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 ### Example
@ -895,7 +894,7 @@ the context in use).
| symbol | | Mirrors the value of option `symbol` | | symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` | | 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 ### Example
@ -958,7 +957,7 @@ when there is a csproj file in the current directory.
| symbol | | Mirrors the value of option `symbol` | | symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` | | 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 ### 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` | | symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` | | 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 ### 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` | | symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` | | 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 ### 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 matches an existing environment variable
- The `variable` configuration option is not defined, but the `default` configuration option is - The `variable` configuration option is not defined, but the `default` configuration option is
::: tip ::: tip
Multiple environmental variables can be displayed by using a `.`. (see example) 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. 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 Example: following configuration will display value of USER environment variable
```toml ```toml
# ~/.config/starship.toml # ~/.config/starship.toml
[env_var.USER] [env_var.USER]
default = "unknown user" default = "unknown user"
``` ```
::: :::
### Options ### Options
@ -1094,7 +1094,7 @@ default = "unknown user"
| symbol | | Mirrors the value of option `symbol` | | symbol | | Mirrors the value of option `symbol` |
| style\* | `black bold dimmed` | Mirrors the value of option `style` | | 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 ### Example
@ -1107,6 +1107,7 @@ default = "unknown shell"
``` ```
Displaying multiple environmental variables: Displaying multiple environmental variables:
```toml ```toml
# ~/.config/starship.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` | | symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` | | 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 ### Example
@ -1166,7 +1167,7 @@ other modules.
### Options ### Options
| Option | Default | Description | | Option | Default | Description |
| ---------- | -------------- | -------------------------------------- | | ---------- | -------------- | --------------------------------- |
| `symbol` | `"."` | The symbol used to fill the line. | | `symbol` | `"."` | The symbol used to fill the line. |
| `style` | `"bold black"` | The style for the module. | | `style` | `"bold black"` | The style for the module. |
| `disabled` | `false` | Disables the `fill` module | | `disabled` | `false` | Disables the `fill` module |
@ -1186,7 +1187,6 @@ Produces a prompt that looks like:
``` ```
AA -------------------------------------------- BB -------------------------------------------- CC AA -------------------------------------------- BB -------------------------------------------- CC
``` ```
## Google Cloud (`gcloud`) ## 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` | | symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` | | 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 ### Examples
@ -1271,14 +1271,14 @@ The `git_branch` module shows the active branch of the repo in your current dire
### Variables ### Variables
| Variable | Example | Description | | Variable | Example | Description |
| ---------------- | -------- | ------------------------------------------------------------------------------------------------------ | | ------------- | -------- | ------------------------------------------------------------------------------------------------------ |
| branch | `master` | The current branch name, falls back to `HEAD` if there's no current branch (e.g. git detached `HEAD`). | | 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_name | `origin` | The remote name. |
| remote_branch | `master` | The name of the branch tracked on `remote_name`. | | remote_branch | `master` | The name of the branch tracked on `remote_name`. |
| symbol | | Mirrors the value of option `symbol` | | symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` | | 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 ### Example
@ -1298,7 +1298,7 @@ The `git_commit` module shows the current commit hash and also the tag (if any)
### Options ### Options
| Option | Default | Description | | Option | Default | Description |
| -------------------- | ---------------------------------------------- | ------------------------------------------------------- | | -------------------- | ------------------------------ | ------------------------------------------------------- |
| `commit_hash_length` | `7` | The length of the displayed git commit hash. | | `commit_hash_length` | `7` | The length of the displayed git commit hash. |
| `format` | `"[\\($hash$tag\\)]($style) "` | The format for the module. | | `format` | `"[\\($hash$tag\\)]($style) "` | The format for the module. |
| `style` | `"bold green"` | The style 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 | | hash | `b703eb3` | The current git commit hash |
| style\* | | Mirrors the value of option `style` | | 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 ### Example
@ -1357,7 +1357,7 @@ that information will be shown too.
| progress_total | `2` | The total operation progress | | progress_total | `2` | The total operation progress |
| style\* | | Mirrors the value of option `style` | | 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 ### Example
@ -1384,7 +1384,7 @@ To enable it, set `disabled` to `false` in your configuration file.
### Options ### Options
| Option | Default | Description | | Option | Default | Description |
| ------------------------- | -------------------------------------------------------------------- | --------------------------------------- | | -------------------- | ------------------------------------------------------------ | ------------------------------------- |
| `added_style` | `"bold green"` | The style for the added count. | | `added_style` | `"bold green"` | The style for the added count. |
| `deleted_style` | `"bold red"` | The style for the deleted count. | | `deleted_style` | `"bold red"` | The style for the deleted count. |
| `only_nonzero_diffs` | `true` | Render status only for changed items. | | `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 ### Variables
| Variable | Example | Description | | Variable | Example | Description |
| ---------------- | ---------- | ----------------------------------- | | --------------- | ------- | ------------------------------------------- |
| added | `1` | The current number of added lines | | added | `1` | The current number of added lines |
| deleted | `2` | The current number of deleted lines | | deleted | `2` | The current number of deleted lines |
| added_style\* | | Mirrors the value of option `added_style` | | added_style\* | | Mirrors the value of option `added_style` |
| deleted_style\* | | Mirrors the value of option `deleted_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 ### Example
@ -1442,7 +1442,7 @@ current directory.
The following variables can be used in `format`: The following variables can be used in `format`:
| Variable | Description | | Variable | Description |
| -------------- | ----------------------------------------------------------------------------------------------------------- | | -------------- | ------------------------------------------------------------------------------------------------------------- |
| `all_status` | Shortcut for`$conflicted$stashed$deleted$renamed$modified$staged$untracked` | | `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. | | `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. | | `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. | | `deleted` | Displays `deleted` when a file's deletion has been added to the staging area. |
| style\* | Mirrors the value of option `style` | | 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`: 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` | | symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` | | 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 ### 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` | | symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` | | 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 ### Example
@ -1602,11 +1602,11 @@ The `hostname` module shows the system hostname.
### Variables ### Variables
| Variable | Example | Description | | Variable | Example | Description |
| -------- | ---------- | ------------------------------------ | | -------- | ---------- | ----------------------------------- |
| hostname | `computer` | The hostname of the computer | | hostname | `computer` | The hostname of the computer |
| style\* | | Mirrors the value of option `style` | | 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 ### 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` | | symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` | | 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 ### 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. 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 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 `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. 0 jobs running.
The default functionality is: The default functionality is:
@ -1695,15 +1695,15 @@ then the module will also show when there are 0 jobs running.
### Options ### Options
| Option | Default | Description | | 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`. | | `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`. | | `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. | | `format` | `"[$symbol$number]($style) "` | The format for the module. |
| `symbol` | `"✦"` | The string used to represent the `symbol` variable. | | `symbol` | `"✦"` | The string used to represent the `symbol` variable. |
| `style` | `"bold blue"` | The style for the module. | | `style` | `"bold blue"` | The style for the module. |
| `disabled` | `false` | Disables the `jobs` 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 ### Variables
@ -1713,7 +1713,7 @@ then the module will also show when there are 0 jobs running.
| symbol | | Mirrors the value of option `symbol` | | symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` | | 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 ### 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` | | symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` | | 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 ### 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` | | symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` | | 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 ### Example
@ -1832,7 +1832,7 @@ To enable it, set `disabled` to `false` in your configuration file.
### Options ### Options
| Option | Default | Description | | Option | Default | Description |
| ----------------------- | -------------------------------------------------- | --------------------------------------------------------------------- | | ----------------- | -------------------------------------------------- | --------------------------------------------------------------------- |
| `symbol` | `"☸ "` | A format string representing the symbol displayed before the Cluster. | | `symbol` | `"☸ "` | A format string representing the symbol displayed before the Cluster. |
| `format` | `'[$symbol$context( \($namespace\))]($style) in '` | The format for the module. | | `format` | `'[$symbol$context( \($namespace\))]($style) in '` | The format for the module. |
| `style` | `"cyan bold"` | The style 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` | | symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` | | 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 ### Example
@ -1920,7 +1920,7 @@ By default the module will be shown if any of the following conditions are met:
### Options ### Options
| Option | Default | Description | | Option | Default | Description |
| ------------------- | ------------------------------------ | ----------------------------------------------------------------------------- | | ------------------- | ------------------------------------ | -------------------------------------------------------------------------- |
| `format` | `"via [$symbol($version )]($style)"` | The format for the module. | | `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 Lua. | | `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 ### Variables
| Variable | Example | Description | | Variable | Example | Description |
| -------- | --------- | ------------------------------------ | | -------- | -------- | ------------------------------------ |
| version | `v5.4.0` | The version of `lua` | | version | `v5.4.0` | The version of `lua` |
| symbol | | Mirrors the value of option `symbol` | | symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` | | 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 ### Example
@ -1984,8 +1984,8 @@ To enable it, set `disabled` to `false` in your configuration file.
| symbol | `🐏` | Mirrors the value of option `symbol` | | symbol | `🐏` | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` | | 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 SWAP file information is only displayed if detected on the current system *\*: The SWAP file information is only displayed if detected on the current system
### Example ### 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` | | symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` | | 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 ### 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` | | symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` | | 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 ### Example
@ -2103,7 +2103,7 @@ The module will be shown when inside a nix-shell environment.
| symbol | | Mirrors the value of option `symbol` | | symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` | | 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 ### 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` | | symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` | | 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 ### 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` | | symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` | | 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 ### Example
@ -2220,7 +2220,7 @@ to fetch the current project in use.
### Options ### Options
| Option | Default | Description | | Option | Default | Description |
| ---------------- | ------------------------------------------------ | --------------------------------------------------------------- | | ---------- | ----------------------------------------------- | -------------------------------------------------------------- |
| `format` | `"on [$symbol$cloud(\\($project\\))]($style) "` | The format for the module. | | `format` | `"on [$symbol$cloud(\\($project\\))]($style) "` | The format for the module. |
| `symbol` | `"☁️ "` | The symbol used before displaying the current OpenStack cloud. | | `symbol` | `"☁️ "` | The symbol used before displaying the current OpenStack cloud. |
| `style` | `"bold yellow"` | The style for the module. | | `style` | `"bold yellow"` | The style for the module. |
@ -2229,13 +2229,13 @@ to fetch the current project in use.
### Variables ### Variables
| Variable | Example | Description | | Variable | Example | Description |
| -------- | ---------- | ------------------------------------ | | -------- | ------- | ------------------------------------ |
| cloud | `corp` | The current OpenStack cloud | | cloud | `corp` | The current OpenStack cloud |
| project | `dev` | The current OpenStack project | | project | `dev` | The current OpenStack project |
| symbol | | Mirrors the value of option `symbol` | | symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` | | 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 ### Example
@ -2280,7 +2280,7 @@ package, and shows its current version. The module currently supports `npm`, `ni
### Options ### Options
| Option | Default | Description | | Option | Default | Description |
| ----------------- | ---------------------------------- | ------------------------------------------------------------------------ | | ----------------- | --------------------------------- | ------------------------------------------------------------------------- |
| `format` | `"is [$symbol$version]($style) "` | The format for the module. | | `format` | `"is [$symbol$version]($style) "` | The format for the module. |
| `symbol` | `"📦 "` | The symbol used before displaying the version the package. | | `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` |
@ -2296,7 +2296,7 @@ package, and shows its current version. The module currently supports `npm`, `ni
| symbol | | Mirrors the value of option `symbol` | | symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` | | 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 ### 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` | | symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` | | 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 ### Example
@ -2408,7 +2408,7 @@ By default the module will be shown if any of the following conditions are met:
### Options ### Options
| Option | Default | Description | | Option | Default | Description |
| ------------------- | ------------------------------------ | ------------------------------------------------------------------------- | | ---------------- | -------------------------------- | ------------------------------------------------------------------------- |
| `format` | `"via [$symbol$stack]($style) "` | The format string for the module. | | `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` | | `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` |
| `symbol` | `" "` | A format string shown before the Pulumi stack. | | `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` | | symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` | | 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 ### Example
@ -2444,7 +2444,6 @@ format = "[🛥 ($version )$stack]($style) "
[pulumi] [pulumi]
symbol = "🛥 " symbol = "🛥 "
format = "[$symbol$stack]($style) " format = "[$symbol$stack]($style) "
``` ```
## PureScript ## 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` | | symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` | | 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 ### Example
@ -2604,7 +2603,7 @@ any of the following conditions are met:
### Options ### Options
| Option | Default | Description | | Option | Default | Description |
|---------------------|--------------------------------------|-----------------------------------------------| | ------------------- | ------------------------------------ | ------------------------------------------------------------------------- |
| `format` | `"via [$symbol($version )]($style)"` | The format for the module. | | `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. | | `symbol` | `"📐"` | A format string representing the symbol of R. |
@ -2659,7 +2658,7 @@ The module will be shown if any of the following conditions are met:
| symbol | | Mirrors the value of option `symbol` | | symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` | | 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 ### Example
@ -2704,7 +2703,7 @@ Starship gets the current Ruby version by running `ruby -v`.
| symbol | | Mirrors the value of option `symbol` | | symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` | | 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 ### 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` | | symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` | | 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 ### Example
@ -2780,12 +2779,12 @@ By default the module will be shown if any of the following conditions are met:
### Variables ### Variables
| Variable | Example | Description | | Variable | Example | Description |
| -------- | -----------| ------------------------------------ | | -------- | -------- | ------------------------------------ |
| version | `2.13.5` | The version of `scala` | | version | `2.13.5` | The version of `scala` |
| symbol | | Mirrors the value of option `symbol` | | symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` | | 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 ### Example
@ -2829,11 +2828,11 @@ To enable it, set `disabled` to `false` in your configuration file.
### Variables ### Variables
| Variable | Default | Description | | Variable | Default | Description |
| ----------- | ------- | ---------------------------------------------------------- | | --------- | ------- | ---------------------------------------------------------- |
| indicator | | Mirrors the value of `indicator` for currently used shell. | | indicator | | Mirrors the value of `indicator` for currently used shell. |
| style\* | | Mirrors the value of option `style`. | | 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 ### Examples
@ -2872,7 +2871,7 @@ set to a number and meets or exceeds the specified threshold.
| symbol | | Mirrors the value of option `symbol` | | symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` | | 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 ### Example
@ -2907,7 +2906,7 @@ and `$SINGULARITY_NAME` is set.
| symbol | | Mirrors the value of option `symbol` | | symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` | | 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 ### Example
@ -2937,7 +2936,7 @@ This module is not supported on nu shell.
### Options ### Options
| Option | Default | Description | | Option | Default | Description |
| ------------------------- | ----------------------------- | ------------------------------------------------------ | | ----------------------- | ----------------------------------------------------------------------------- | ------------------------------------------------------- |
| `format` | `"[$symbol$status]($style) "` | The format of the module | | `format` | `"[$symbol$status]($style) "` | The format of the module |
| `symbol` | `"✖"` | The symbol displayed on program error | | `symbol` | `"✖"` | The symbol displayed on program error |
| `success_symbol` | `"✔️"` | The symbol displayed on program success | | `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 | | `recognize_signal_code` | `true` | Enable signal mapping from exit code |
| `map_symbol` | `false` | Enable symbols mapping from exit code | | `map_symbol` | `false` | Enable symbols mapping from exit code |
| `pipestatus` | `false` | Enable pipestatus reporting | | `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 | | `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. | | `disabled` | `true` | Disables the `status` module. |
### Variables ### Variables
| Variable | Example | Description | | Variable | Example | Description |
| ----------------------- | ------- | ----------------------------------------------------------------------- | | -------------- | ------- | ------------------------------------------------------------------------------------------- |
| status | `127` | The exit code of the last command | | status | `127` | The exit code of the last command |
| hex_status | `0x7F` | The exit code of the last command in hex | | hex_status | `0x7F` | The exit code of the last command in hex |
| int | `127` | The exit code of the last command | | 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` | | symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` | | 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 ### Example
```toml ```toml
# ~/.config/starship.toml # ~/.config/starship.toml
[status] [status]
@ -2982,7 +2980,6 @@ symbol = "🔴"
format = '[\[$symbol $common_meaning$signal_name$maybe_int\]]($style) ' format = '[\[$symbol $common_meaning$signal_name$maybe_int\]]($style) '
map_symbol = true map_symbol = true
disabled = false disabled = false
``` ```
## Sudo ## Sudo
@ -3000,7 +2997,7 @@ To enable it, set `disabled` to `false` in your configuration file.
### Options ### Options
| Option | Default | Description | | Option | Default | Description |
| -------------- | ----------------------- | ------------------------------------------------------------ | | --------------- | ----------------------- | ------------------------------------------------------- |
| `format` | `[as $symbol]($style)"` | The format of the module | | `format` | `[as $symbol]($style)"` | The format of the module |
| `symbol` | `"🧙 "` | The symbol displayed when credentials are cached | | `symbol` | `"🧙 "` | The symbol displayed when credentials are cached |
| `style` | `"bold blue"` | The style for the module. | | `style` | `"bold blue"` | The style for the module. |
@ -3010,16 +3007,15 @@ To enable it, set `disabled` to `false` in your configuration file.
### Variables ### Variables
| Variable | Example | Description | | Variable | Example | Description |
| --------- | ------- | ------------------------------------ | | -------- | ------- | ------------------------------------ |
| symbol | | Mirrors the value of option `symbol` | | symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` | | 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 ### Example
```toml ```toml
# ~/.config/starship.toml # ~/.config/starship.toml
[sudo] [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` | | symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` | | 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 ### 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` | | symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` | | 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 ### Example
@ -3171,7 +3167,7 @@ Manually setting `time_format` will override the `use_12hr` setting.
| time | `13:08:10` | The current time. | | time | `13:08:10` | The current time. |
| style\* | | Mirrors the value of option `style` | | 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 ### 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` | | symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` | | 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 ### Example
@ -3277,6 +3273,7 @@ format = "via [⍱ $version](bold white) "
The `vlang` module shows you your currently installed version of [V](https://vlang.io/). 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: 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 file with `.v` extension
- The current directory contains a `v.mod`, `vpkg.json` or `.vpkg-lock.json` file - 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 ### Variables
| Variable | Example | Description | | Variable | Example | Description |
| -------- | -------- | ------------------------------------ | | -------- | ------- | ------------------------------------ |
| version | `v0.2` | The version of `v` | | version | `v0.2` | The version of `v` |
| symbol | | Mirrors the value of option `symbol` | | symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` | | 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 ### Options
| Option | Default | Description | | Option | Default | Description |
| ---------- | -------------------------------- | ------------------------------------------------------- | | ---------- | -------------------------------- | ------------------------------------------------------ |
| `symbol` | | The symbol used before displaying the repository name. | | `symbol` | | The symbol used before displaying the repository name. |
| `style` | `"bold yellow"` | The style for the module. | | `style` | `"bold yellow"` | The style for the module. |
| `format` | `"vcsh [$symbol$repo]($style) "` | The format 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 ### Variables
| Variable | Example | Description | | Variable | Example | Description |
| -------- | ------------------------------------------- | ------------------------------------- | | -------- | ------------------------------------------- | ------------------------------------ |
| repo | `dotfiles` if in a VCSH repo named dotfiles | The active repository name | | repo | `dotfiles` if in a VCSH repo named dotfiles | The active repository name |
| symbol | | Mirrors the value of option `symbol` | | symbol | | Mirrors the value of option `symbol` |
| style\* | `black bold dimmed` | Mirrors the value of option `style` | | 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 ### 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` | | symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` | | 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 ### Example
@ -3430,7 +3427,7 @@ Format strings can also contain shell specific prompt sequences, e.g.
### Options ### Options
| Option | Default | Description | | Option | Default | Description |
| ------------- | ------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | | ------------- | ------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `command` | `""` | The command whose output should be printed. The command will be passed on stdin to the shell. | | `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. | | `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) | | `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` | | symbol | Mirrors the value of option `symbol` |
| style\* | Mirrors the value of option `style` | | 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 #### 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 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 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 execution of the command and output the above warning, this is expected
behaviour. This time limit is configurable using the [`command_timeout` 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
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 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 see if you can optimise it. Finally you can set the `STARSHIP_LOG` env var to
`error` to hide these warnings. `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)" 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 #### Command Duration

View File

@ -1,19 +1,19 @@
[package] [package]
name = "starship_module_config_derive" name = "starship_module_config_derive"
version = "0.2.1" version = "0.2.1"
edition = "2021"
authors = ["Matan Kushner <hello@matchai.me>"] 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"] 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 = """ description = """
The minimal, blazing-fast, and infinitely customizable prompt for any shell! 🌌 The minimal, blazing-fast, and infinitely customizable prompt for any shell! 🌌
""" """
include = ["src/**/*", "LICENSE", "README.md"]
[lib] [lib]
name = "starship_module_config_derive" name = "starship_module_config_derive"