docs(i18n): new Crowdin translations (#1262)

* New translations README.md (Portuguese, Brazilian)

* New translations README.md (German)

* New translations README.md (French)

* New translations README.md (Japanese)

* New translations README.md (Spanish)

* New translations README.md (Portuguese, Brazilian)

* New translations README.md (Portuguese)

* New translations README.md (Chinese Traditional)

* New translations README.md (Chinese Simplified)

* New translations README.md (Russian)

* New translations README.md (Spanish)

* New translations README.md (Spanish)

* New translations README.md (Spanish)

* New translations README.md (Spanish)

* New translations README.md (Chinese Simplified)

* New translations README.md (Chinese Traditional)

* New translations README.md (Portuguese)

* New translations README.md (Portuguese, Brazilian)

* New translations README.md (French)

* New translations README.md (Spanish)

* New translations README.md (German)

* New translations README.md (Russian)

* New translations README.md (Japanese)

* New translations README.md (Portuguese, Brazilian)

* New translations README.md (Portuguese, Brazilian)

* New translations README.md (Portuguese, Brazilian)

* New translations README.md (Chinese Simplified)

* New translations README.md (Chinese Traditional)

* New translations README.md (Portuguese)

* New translations README.md (Portuguese, Brazilian)

* New translations README.md (French)

* New translations README.md (Spanish)

* New translations README.md (German)

* New translations README.md (Russian)

* New translations README.md (Japanese)

* New translations README.md (French)

* New translations README.md (Japanese)

* New translations README.md (German)

* New translations README.md (Spanish)

* New translations README.md (Chinese Traditional)

* New translations README.md (Portuguese, Brazilian)

* New translations README.md (Portuguese)

* New translations README.md (Chinese Simplified)

* New translations README.md (Russian)

* New translations README.md (Spanish)

* New translations README.md (Spanish)

* New translations README.md (Spanish)

* New translations README.md (Portuguese, Brazilian)

* New translations README.md (Chinese Traditional)

* New translations README.md (Chinese Traditional)

* New translations README.md (Portuguese)

* New translations README.md (Portuguese)

* New translations README.md (Chinese Simplified)

* New translations README.md (Portuguese, Brazilian)

* New translations README.md (French)

* New translations README.md (French)

* New translations README.md (Spanish)

* New translations README.md (Spanish)

* New translations README.md (German)

* New translations README.md (German)

* New translations README.md (Chinese Simplified)

* New translations README.md (Japanese)

* New translations README.md (Japanese)

* New translations README.md (Russian)

* New translations README.md (Russian)

* New translations README.md (Japanese)

* New translations README.md (Japanese)

* New translations README.md (Japanese)

* New translations README.md (Japanese)
This commit is contained in:
Matan Kushner 2020-06-10 21:28:04 -04:00 committed by GitHub
parent 30ff5913be
commit e29140a3cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 1366 additions and 710 deletions

View file

@ -113,6 +113,7 @@ prompt_order = [
"haskell",
"java",
"julia",
"nim",
"nodejs",
"ocaml",
"php",
@ -376,9 +377,18 @@ For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, an
| Variable | Standardwert | Beschreibung |
| --------------------------- | ------------ | ---------------------------------------------------------------------------------------- |
| `substitutions` | | A table of substitutions to be made to the path. |
| `fish_style_pwd_dir_length` | `0` | The number of characters to use when applying fish shell pwd path logic. |
| `use_logical_path` | `true` | Displays the logical path provided by the shell (`PWD`) instead of the path from the OS. |
`substitutions` allows you to define arbitrary replacements for literal strings that occur in the path, for example long network prefixes or development directories (i.e. Java). Note that this will disable the fish style PWD.
```toml
[directory.substitutions]
"/Volumes/network/path" = "/net"
"src/com/long/java/path" = "mypath"
```
`fish_style_pwd_dir_length` interacts with the standard truncation options in a way that can be surprising at first: if it's non-zero, the components of the path that would normally be truncated are instead displayed with that many characters. For example, the path `/built/this/city/on/rock/and/roll`, which would normally be displayed as as `rock/and/roll`, would be displayed as `/b/t/c/o/rock/and/roll` with `fish_style_pwd_dir_length = 1`--the path components that would normally be removed are displayed with a single character. For `fish_style_pwd_dir_length = 2`, it would be `/bu/th/ci/on/rock/and/roll`.
</details>
@ -444,7 +454,7 @@ heuristic = false
## Elixir
The `elixir` module shows the currently installed version of Elixir and Erlang/OTP. Das Modul wird nur dann angezeigt, wenn eine der folgenden Bedingungen zutrifft:
The `elixir` module shows the currently installed version of Elixir and Erlang/OTP. Das Modul wird gezeigt, wenn mindestens einer der folgenden Punkte erfüllt ist:
- Das aktuelle Verzeichnis enthält eine `mix.exs`-Datei.
@ -548,7 +558,7 @@ symbol = "e "
## Git-Branch
Das `git_branch`-Modul zeigt den aktiven Git-Branch des Repositories im aktuellen Verzeichnis an.
The `git_branch` module shows the active branch of the repo in your current directory.
### Optionen
@ -685,7 +695,7 @@ deleted = "🗑"
## Golang
Das `golang`-Modul zeigt die aktuell installierte Version von Golang. Das Modul wird gezeigt, wenn mindestens einer der folgenden Punkte erfüllt ist:
The `golang` module shows the currently installed version of Golang. Das Modul wird gezeigt, wenn mindestens einer der folgenden Punkte erfüllt ist:
- Das aktuelle Verzeichnis enthält eine `go.mod`-Datei
- Das aktuelle Verzeichnis enthält eine `go.sum`-Datei
@ -738,7 +748,7 @@ symbol = " "
## Hostname
Das `hostname`-Modul zeigt den Hostnamen des Systems an.
The `hostname` module shows the system hostname.
### Optionen
@ -758,15 +768,15 @@ Das `hostname`-Modul zeigt den Hostnamen des Systems an.
[hostname]
ssh_only = false
prefix = "10218;"
suffix = " 10219;"
prefix = ""
suffix = ""
trim_at = ".companyname.com"
disabled = false
```
## Java
Das `java` Modul zeigt die derzeit installierte Version von Java an. Das Modul wird gezeigt, wenn mindestens einer der folgenden Punkte erfüllt ist:
The `java` module shows the currently installed version of Java. Das Modul wird gezeigt, wenn mindestens einer der folgenden Punkte erfüllt ist:
- The current directory contains a `pom.xml`, `build.gradle.kts`, `build.sbt` or `.java-version` file
- The current directory contains a file with the `.java`, `.class`, `.gradle` or `.jar` extension
@ -839,9 +849,9 @@ symbol = "∴ "
Displays the current Kubernetes context name and, if set, the namespace from the kubeconfig file. The namespace needs to be set in the kubeconfig file, this can be done via `kubectl config set-context starship-cluster --namespace astronaut`. If the `$KUBECONFIG` env var is set the module will use that if not it will use the `~/.kube/config`.
::: Tipp
::: tip
Dieses Modul ist standardmäßig deaktiviert. Setze in deiner Konfiguration `disabled` auf `false` um es zu aktivieren.
This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
:::
@ -869,7 +879,7 @@ disabled = false
## Zeilenumbruch
Das `line_break`-Modul unterteilt den Prompt in zwei Zeilen.
The `line_break` module separates the prompt into two lines.
### Optionen
@ -888,13 +898,13 @@ disabled = true
## Speicherauslastung
Das `memory_usage` Modul zeigt den aktuellen Systemspeicher und die swap-Nutzung an.
The `memory_usage` module shows current system memory and swap usage.
Standardmäßig wird die swap-Nutzung angezeigt, wenn der gesamte System-swap nicht Null ist.
By default the swap usage is displayed if the total system swap is non-zero.
::: Tipp
::: tip
Dieses Modul ist standardmäßig deaktiviert. Setze in deiner Konfiguration `disabled` auf `false` um es zu aktivieren.
This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
:::
@ -950,20 +960,46 @@ truncation_length = 4
truncation_symbol = ""
```
## Nix-Shell
## Nim
Das `nix_shell`-Modul zeigt die nix-shell Umgebung an. Das Modul wird angezeigt, wenn es sich in einer nix-Shell-Umgebung befindet.
The `nim` module shows the currently installed version of Nim. Das Modul wird gezeigt, wenn mindestens einer der folgenden Punkte erfüllt ist:
- The current directory contains a `nim.cfg` file
- The current directory contains a file with the `.nim` extension
- The current directory contains a file with the `.nims` extension
- The current directory contains a file with the `.nimble` extension
### Optionen
| Variable | Standardwert | Beschreibung |
| ---------- | --------------- | ----------------------------------------------------- |
| `symbol` | `"👑 "` | The symbol used before displaying the version of Nim. |
| `style` | `"bold yellow"` | Stil für dieses Modul. |
| `disabled` | `false` | Disables the `nim` module. |
### Beispiel
```toml
# ~/.config/starship.toml
[nim]
style = "yellow"
symbol = "🎣 "
```
## Nix-shell
The `nix_shell` module shows the nix-shell environment. The module will be shown when inside a nix-shell environment.
### Optionen
| Variable | Standardwert | Beschreibung |
| ------------ | ------------- | ------------------------------------------------- |
| `use_name` | `false` | Namen der nix-Shell anzeigen. |
| `impure_msg` | `"impure"` | Passt die "impure"-Nachricht an. |
| `pure_msg` | `"pure"` | Passt die "pure"-Nachricht an. |
| `use_name` | `false` | Display the name of the nix-shell. |
| `impure_msg` | `"impure"` | Customize the "impure" msg. |
| `pure_msg` | `"pure"` | Customize the "pure" msg. |
| `symbol` | `"❄️ "` | The symbol used before displaying the shell name. |
| `style` | `"bold blue"` | Stil für dieses Modul. |
| `disabled` | `false` | Deaktiviert das `nix_shell`-Modul. |
| `disabled` | `false` | Disables the `nix_shell` module. |
### Beispiel
@ -980,20 +1016,20 @@ symbol = "☃️ "
## NodeJS
Das `nodejs`-Modul zeigt die aktuell installierte Version von NodeJS. Das Modul wird gezeigt, wenn mindestens einer der folgenden Punkte erfüllt ist:
The `nodejs` module shows the currently installed version of NodeJS. Das Modul wird gezeigt, wenn mindestens einer der folgenden Punkte erfüllt ist:
- Das aktuelle Verzeichnis enthält eine `package.json`-Datei
- The current directory contains a `package.json` file
- The current directory contains a `.node-version` file
- Das aktuelle Verzeichnis enthält ein `node_modules`-Verzeichnis
- Das aktuelle Verzeichnis enthält eine Datei mit der `.js`-Erweiterung
- The current directory contains a `node_modules` directory
- The current directory contains a file with the `.js` extension
### Optionen
| Variable | Standardwert | Beschreibung |
| ---------- | -------------- | ------------------------------------------------- |
| `symbol` | `"⬢ "` | Symbol das vor der NodeJS-Version angezeigt wird. |
| `style` | `"bold green"` | Stil für dieses Modul. |
| `disabled` | `false` | Deaktiviert das `nodejs`-Modul. |
| Variable | Standartwert | Beschreibung |
| ---------- | -------------- | -------------------------------------------------------- |
| `symbol` | `"⬢ "` | The symbol used before displaying the version of NodeJS. |
| `style` | `"bold green"` | Stil für dieses Modul. |
| `disabled` | `false` | Disables the `nodejs` module. |
### Beispiel
@ -1004,13 +1040,13 @@ Das `nodejs`-Modul zeigt die aktuell installierte Version von NodeJS. Das Modul
symbol = "🤖 "
```
## Paketversion
## Package Version
Das `Package` Modul wird angezeigt, wenn das aktuelle Verzeichnis das Repository für ein Paket ist, und zeigt dessen aktuelle Version an. The module currently supports `npm`, `cargo`, `poetry`, `composer`, `gradle`, `julia` and `mix` packages.
The `package` module is shown when the current directory is the repository for a package, and shows its current version. The module currently supports `npm`, `cargo`, `poetry`, `composer`, `gradle`, `julia` and `mix` packages.
- **npm** Die `npm` Paketversion wird aus dem `package.json` gelesen, das sich im aktuellen Verzeichnis befindet
- **Cargo** Die `Cargo` Paketversion wird aus dem `Cargo.toml` gelesen, das sich im aktuellen Verzeichnis befindet
- **poetry** Die `poetry` Paketversion wird aus der `pyproject.toml` gelesen, das sich im aktuellen Verzeichnis befindet
- **npm** The `npm` package version is extracted from the `package.json` present in the current directory
- **cargo** The `cargo` package version is extracted from the `Cargo.toml` present in the current directory
- **poetry** The `poetry` package version is extracted from the `pyproject.toml` present in the current directory
- **composer** The `composer` package version is extracted from the `composer.json` present in the current directory
- **gradle** The `gradle` package version is extracted from the `build.gradle` present
- **julia** - The package version is extracted from the `Project.toml` present
@ -1020,12 +1056,12 @@ Das `Package` Modul wird angezeigt, wenn das aktuelle Verzeichnis das Repository
### Optionen
| Variable | Standartwert | Beschreibung |
| ----------------- | ------------ | --------------------------------------------------------- |
| `symbol` | `"📦 "` | Symbol das vor der Paketversion angezeigt wird. |
| `style` | `"bold 208"` | Stil für dieses Modul. |
| `display_private` | `false` | Enable displaying version for packages marked as private. |
| `disabled` | `false` | Deaktiviert das `package`-Modul. |
| Variable | Standardwert | Beschreibung |
| ----------------- | ------------ | ---------------------------------------------------------- |
| `symbol` | `"📦 "` | The symbol used before displaying the version the package. |
| `style` | `"bold 208"` | Stil für dieses Modul. |
| `display_private` | `false` | Enable displaying version for packages marked as private. |
| `disabled` | `false` | Disables the `package` module. |
### Beispiel
@ -1066,19 +1102,19 @@ symbol = "🐪 "
## PHP
Das `php`-Modul zeigt die aktuell installierte Version von PHP. Das Modul wird gezeigt, wenn mindestens einer der folgenden Punkte erfüllt ist:
The `php` module shows the currently installed version of PHP. Das Modul wird gezeigt, wenn mindestens einer der folgenden Punkte erfüllt ist:
- Das aktuelle Verzeichnis enthält eine `composer.json`-Datei
- The current directory contains a `composer.json` file
- The current directory contains a `.php-version` file
- Das aktuelle Verzeichnis enthält eine `.php`-Datei
- The current directory contains a `.php` file
### Optionen
| Variable | Standardwert | Beschreibung |
| ---------- | ------------ | ---------------------------------------------- |
| `symbol` | `"🐘 "` | Symbol das vor der PHP-Version angezeigt wird. |
| `style` | `"bold 147"` | Stil für dieses Modul. |
| `disabled` | `false` | Deaktiviert das `php`-Modul. |
| Variable | Standardwert | Beschreibung |
| ---------- | ------------ | ----------------------------------------------------- |
| `symbol` | `"🐘 "` | The symbol used before displaying the version of PHP. |
| `style` | `"bold 147"` | Stil für dieses Modul. |
| `disabled` | `false` | Disables the `php` module. |
### Beispiel
@ -1097,26 +1133,26 @@ If `pyenv_version_name` is set to `true`, it will display the pyenv version name
Das Modul wird gezeigt, wenn mindestens einer der folgenden Punkte erfüllt ist:
- Das aktuelle Verzeichnis enthält eine `.python-version`-Datei
- Das aktuelle Verzeichnis enthält eine `requirements.txt`-Datei
- Das aktuelle Verzeichnis enthält eine `pyproject.toml`-Datei
- The current directory contains a `.python-version` file
- The current directory contains a `requirements.txt` file
- The current directory contains a `pyproject.toml` file
- The current directory contains a file with the `.py` extension (and `scan_for_pyfiles` is true)
- Das aktuelle Verzeichnis enthält eine `Pipfile`-Datei
- Das aktuelle Verzeichnis enthält eine `tox.ini`-Datei
- Das aktuelle Verzeichnis enthält eine `setup.py`-Datei
- The current directory contains a `Pipfile` file
- The current directory contains a `tox.ini` file
- The current directory contains a `setup.py` file
- The current directory contains a `__init__.py` file
- Ein virtualenv ist momentan aktiv
- A virtual environment is currently activated
### Optionen
| Variable | Standardwert | Beschreibung |
| -------------------- | --------------- | -------------------------------------------------------------------------- |
| `symbol` | `"🐍 "` | Symbol das vor der Python-Version angezeigt wird. |
| `pyenv_version_name` | `false` | Verwende `pyenv` um die Python-Versionzu beziehen. |
| `pyenv_prefix` | `"pyenv "` | Prefix zur Anzeige der pyenv-Version (Standard: `pyenv MY_VERSION`) |
| `scan_for_pyfiles` | `true` | If false, Python files in the current directory will not show this module. |
| `style` | `"bold yellow"` | Stil für dieses Modul. |
| `disabled` | `false` | Deaktiviert das `python`-Modul. |
| Variable | Standardwert | Beschreibung |
| -------------------- | --------------- | --------------------------------------------------------------------------- |
| `symbol` | `"🐍 "` | The symbol used before displaying the version of Python. |
| `pyenv_version_name` | `false` | Use pyenv to get Python version |
| `pyenv_prefix` | `"pyenv "` | Prefix before pyenv version display (default display is `pyenv MY_VERSION`) |
| `scan_for_pyfiles` | `true` | If false, Python files in the current directory will not show this module. |
| `style` | `"bold yellow"` | Stil für dieses Modul. |
| `disabled` | `false` | Disables the `python` module. |
### Beispiel
@ -1131,19 +1167,19 @@ pyenv_prefix = "foo "
## Ruby
Das `ruby` Modul zeigt die derzeit installierte Version von Ruby an. Das Modul wird gezeigt, wenn mindestens einer der folgenden Punkte erfüllt ist:
The `ruby` module shows the currently installed version of Ruby. Das Modul wird gezeigt, wenn mindestens einer der folgenden Punkte erfüllt ist:
- Das aktuelle Verzeichnis enthält eine `Gemfile`-Datei
- The current directory contains a `Gemfile` file
- The current directory contains a `.ruby-version` file
- Das aktuelle Verzeichnis enthält eine `.rb`-Datei
- The current directory contains a `.rb` file
### Optionen
| Variable | Standardwert | Beschreibung |
| ---------- | ------------ | ----------------------------------------------- |
| `symbol` | `"💎 "` | Symbol das vor der Ruby-Version angezeigt wird. |
| `style` | `"bold red"` | Stil für dieses Modul. |
| `disabled` | `false` | Deaktiviert das `ruby`-Modul. |
| Variable | Standardwert | Beschreibung |
| ---------- | ------------ | ------------------------------------------------------ |
| `symbol` | `"💎 "` | The symbol used before displaying the version of Ruby. |
| `style` | `"bold red"` | Stil für dieses Modul. |
| `disabled` | `false` | Disables the `ruby` module. |
### Beispiel
@ -1156,18 +1192,18 @@ symbol = "🔺 "
## Rust
Das `rust` Modul zeigt die derzeit installierte Version von Rust an. Das Modul wird gezeigt, wenn mindestens einer der folgenden Punkte erfüllt ist:
The `rust` module shows the currently installed version of Rust. Das Modul wird gezeigt, wenn mindestens einer der folgenden Punkte erfüllt ist:
- Das aktuelle Verzeichnis enthält eine `Cargo.toml`-Datei
- Das aktuelle Verzeichnis enthält eine Datei mit der `.rs`-Erweiterung
- The current directory contains a `Cargo.toml` file
- The current directory contains a file with the `.rs` extension
### Optionen
| Variable | Standardwert | Beschreibung |
| ---------- | ------------ | ----------------------------------------------- |
| `symbol` | `"🦀 "` | Symbol das vor der Rust-Version angezeigt wird. |
| `style` | `"bold red"` | Stil für dieses Modul. |
| `disabled` | `false` | Deaktiviert das `rust`-Modul. |
| Variable | Standardwert | Beschreibung |
| ---------- | ------------ | ------------------------------------------------------ |
| `symbol` | `"🦀 "` | The symbol used before displaying the version of Rust. |
| `style` | `"bold red"` | Stil für dieses Modul. |
| `disabled` | `false` | Disables the `rust` module. |
### Beispiel
@ -1204,19 +1240,19 @@ symbol = "📦 "
## Terraform
Das `Terraform` Modul zeigt den aktuell ausgewählten terraform Arbeitsbereich und die Version an. Standardmäßig wird die Terraform-Version nicht angezeigt, da dies bei aktuellen Versionen von Terraform langsam ist, wenn viele Plugins verwendet werden. Das Modul wird gezeigt, wenn mindestens einer der folgenden Punkte erfüllt ist:
The `terraform` module shows the currently selected terraform workspace and version. By default the terraform version is not shown, since this is slow on current versions of terraform when a lot of plugins are in use. Das Modul wird gezeigt, wenn mindestens einer der folgenden Punkte erfüllt ist:
- Das aktuelle Verzeichnis enthält eine `.terraform`-Datei
- Das aktuelle Verzeichnis enthält eine Datei mit der `.tf`-Erweiterung
- The current directory contains a `.terraform` folder
- Current directory contains a file with the `.tf` extension
### Optionen
| Variable | Standardwert | Beschreibung |
| -------------- | ------------ | -------------------------------------------------------------------------------------- |
| `symbol` | `"💠 "` | Das Symbol das vor dem Terraform-Workspacenamen angezeigt wird. |
| `show_version` | `false` | Blendet die Terraform Versionsnummer ein. Kann In großen Workspaces sehr langsam sein. |
| `style` | `"bold 105"` | Stil für dieses Modul. |
| `disabled` | `false` | Deaktiviert das `terraform` Modul. |
| Variable | Standartwert | Beschreibung |
| -------------- | ------------ | ----------------------------------------------------------- |
| `symbol` | `"💠 "` | The symbol used before displaying the terraform workspace. |
| `show_version` | `false` | Shows the terraform version. Very slow on large workspaces. |
| `style` | `"bold 105"` | Stil für dieses Modul. |
| `disabled` | `false` | Disables the `terraform` module. |
### Beispiel
@ -1227,27 +1263,28 @@ Das `Terraform` Modul zeigt den aktuell ausgewählten terraform Arbeitsbereich u
symbol = "🏎💨 "
```
## Zeit
## Time
Das `time` Modul zeigt die aktuelle **lokale** Zeit an. Der `format` Wert wird von der crate [`chrono`](https://crates.io/crates/chrono) benutzt um die Zeit zu formatieren. Schau dir [die chrono strftime Dokumentation](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) an, um die möglichen Optionen zu sehen.
The `time` module shows the current **local** time. The `format` configuration value is used by the [`chrono`](https://crates.io/crates/chrono) crate to control how the time is displayed. Take a look [at the chrono strftime docs](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) to see what options are available.
::: Tipp
::: tip
Dieses Modul ist standardmäßig deaktiviert. Setze in deiner Konfiguration `disabled` auf `false` um es zu aktivieren.
This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
:::
### Optionen
| Variable | Standartwert | Beschreibung |
| ----------------- | --------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| `use_12hr` | `false` | Aktiviert 12-Stunden-Format |
| `format` | siehe unten | Das Format zum Anzeigen der Uhrzeit in [chrono-Formatierung](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html). |
| `style` | `"bold yellow"` | Stil für dieses Modul |
| `utc_time_offset` | `"local"` | Verwendetes Zeitzonen-Offset. Liegt zwischen -24 < x < 24. Allows floats to accommodate 30/45 minute timezone offsets. |
| `disabled` | `true` | Deaktiviert das `time`-Modul. |
| Variable | Standartwert | Beschreibung |
| ----------------- | --------------- | ------------------------------------------------------------------------------------------------------------------- |
| `use_12hr` | `false` | Enables 12 hour formatting. |
| `format` | see below | The [chrono format string](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) used to format the time. |
| `style` | `"bold yellow"` | The style for the module time. |
| `utc_time_offset` | `"local"` | Sets the UTC offset to use. Range from -24 < x < 24. Allows floats to accommodate 30/45 minute timezone offsets. |
| `disabled` | `true` | Disables the `time` module. |
| `time_range` | `"-"` | Sets the time range during which the module will be shown. Times must be specified in 24-hours format |
Wird `use_12hr` auf `true` gestellt, nimmt `format` automatisch den Wert `"%r"` an. Andernfalls ist es standardmäßig `"%T"`. Wird hingegen `format` gesetzt, so überschreibt dies die Einstellung `use_12hr`.
If `use_12hr` is `true`, then `format` defaults to `"%r"`. Otherwise, it defaults to `"%T"`. Manually setting `format` will override the `use_12hr` setting.
### Beispiel
@ -1258,25 +1295,26 @@ Wird `use_12hr` auf `true` gestellt, nimmt `format` automatisch den Wert `"%r"`
disabled = false
format = "🕙[ %T ]"
utc_time_offset = "-5"
time_range = "10:00:00-14:00:00"
```
## Username
Das `username` Modul zeigt den Namen des aktiven Benutzers. Das Modul wird gezeigt, wenn mindestens einer der folgenden Punkte erfüllt ist:
The `username` module shows active user's username. Das Modul wird gezeigt, wenn mindestens einer der folgenden Punkte erfüllt ist:
- Der aktuelle Benutzer ist root
- Der aktuelle Benutzer ist nicht der eingeloggte Benutzer
- Der Benutzer ist aktuell via SSH verbunden
- Die Variable `show_always` ist auf true gesetzt
- The current user is root
- The current user isn't the same as the one that is logged in
- The user is currently connected as an SSH session
- The variable `show_always` is set to true
### Optionen
| Variable | Standartwert | Beschreibung |
| ------------- | --------------- | ---------------------------------------------- |
| `style_root` | `"bold red"` | Stil wenn der Benutzer unter root läuft. |
| `style_user` | `"bold yellow"` | Stil wenn der Benutzer nicht unter root läuft. |
| `show_always` | `false` | Immer das `username` Modul anzeigen. |
| `disabled` | `false` | Deavktiviert das `username` Modul. |
| Variable | Standartwert | Beschreibung |
| ------------- | --------------- | ------------------------------------- |
| `style_root` | `"bold red"` | The style used when the user is root. |
| `style_user` | `"bold yellow"` | The style used for non-root users. |
| `show_always` | `false` | Always shows the `username` module. |
| `disabled` | `false` | Disables the `username` module. |
### Beispiel
@ -1321,13 +1359,13 @@ These modules will be shown if any of the following conditions are met:
- The current directory contains a file whose extension is in `extensions`
- The `when` command returns 0
::: Tipp
::: tip
Multiple custom modules can be defined by using a `.`.
:::
::: Tipp
::: tip
The order in which custom modules are shown can be individually set by setting `custom.foo` in `prompt_order`. By default, the `custom` module will simply show all custom modules in the order they were defined.
@ -1335,20 +1373,46 @@ The order in which custom modules are shown can be individually set by setting `
### Optionen
| Variable | Standartwert | Beschreibung |
| -------------- | ------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| `command` | | The command whose output should be printed. |
| `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` | | The path to the shell to use to execute the command. If unset, it will fallback to STARSHIP_SHELL and then to "sh". |
| `beschreibung` | `"<custom module>"` | The description of the module that is shown when running `starship explain`. |
| `files` | `[]` | The files that will be searched in the working directory for a match. |
| `directories` | `[]` | The directories that will be searched in the working directory for a match. |
| `extensions` | `[]` | The extensions that will be searched in the working directory for a match. |
| `symbol` | `""` | The symbol used before displaying the command output. |
| `style` | `"bold green"` | Stil für dieses Modul. |
| `prefix` | `""` | Prefix to display immediately before the command output. |
| `suffix` | `""` | Suffix to display immediately after the command output. |
| `disabled` | `false` | Disables this `custom` module. |
| Variable | Standartwert | Beschreibung |
| ------------- | ------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| `command` | | The command whose output should be printed. |
| `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) |
| `description` | `"<custom module>"` | The description of the module that is shown when running `starship explain`. |
| `files` | `[]` | The files that will be searched in the working directory for a match. |
| `directories` | `[]` | The directories that will be searched in the working directory for a match. |
| `extensions` | `[]` | The extensions that will be searched in the working directory for a match. |
| `symbol` | `""` | The symbol used before displaying the command output. |
| `style` | `"bold green"` | Stil für dieses Modul. |
| `prefix` | `""` | Prefix to display immediately before the command output. |
| `suffix` | `""` | Suffix to display immediately after the command output. |
| `disabled` | `false` | Disables this `custom` module. |
#### Custom command shell
`shell` accepts a non-empty list of strings, where:
- The first string is the path to the shell to use to execute the command.
- Other following arguments are passed to the shell.
If unset, it will fallback to STARSHIP_SHELL and then to "sh" on Linux, and "cmd /C" on Windows.
If `shell` is not given or only contains one element and Starship detects PowerShell will be used, the following arguments will automatically be added: `-NoProfile -Command -`. This behavior can be avoided by explicitly passing arguments to the shell, e.g.
```toml
shell = ["pwsh", "-Command", "-"]
```
::: warning Make sure your custom shell configuration exits gracefully
If you set a custom command, make sure that the default Shell used by starship will properly execute the command with a graceful exit (via the `shell` option).
For example, PowerShell requires the `-Command` parameter to execute a one liner. Omitting this parameter might throw starship into a recursive loop where the shell might try to load a full profile environment with starship itself again and hence re-execute the custom command, getting into a never ending loop.
Parameters similar to `-NoProfile` in PowerShell are recommended for other shells as well to avoid extra loading time of a custom profile on every starship invocation.
Automatic detection of shells and proper parameters addition are currently implemented, but it's possible that not all shells are covered. [Please open an issue](https://github.com/starship/starship/issues/new/choose) with shell details and starship configuration if you hit such scenario.
:::
### Beispiel
@ -1360,18 +1424,24 @@ command = "echo foo" # shows output of command
files = ["foo"] # can specify filters
when = """ test "$HOME" == "$PWD" """
prefix = " transcending "
[custom.time]
command = "time /T"
files = ["*.pst"]
prefix = "transcending "
shell = ["pwsh.exe", "-NoProfile", "-Command", "-"]
```
## PureScript
The `purescript` module shows the currently installed version of PureScript version. Das Modul wird nur dann angezeigt, wenn eine der folgenden Bedingungen zutrifft:
The `purescript` module shows the currently installed version of PureScript version. Das Modul wird gezeigt, wenn mindestens einer der folgenden Punkte erfüllt ist:
- The current directory contains a `spago.dhall` file
- The current directory contains a \*.purs files
### Optionen
| Variable | Standartwert | Beschreibung |
| Variable | Standardwert | Beschreibung |
| ---------- | -------------- | ------------------------------------------------------------ |
| `symbol` | `"<=> "` | The symbol used before displaying the version of PureScript. |
| `style` | `"bold white"` | Stil für dieses Modul. |

View file

@ -56,6 +56,9 @@ symbol = " "
[memory_usage]
symbol = " "
[nim]
symbol = " "
[nix_shell]
symbol = " "

View file

@ -8,11 +8,11 @@ Las configuraciones de esta sección pueden sufrir cambios en futuras versiones
:::
## Custom pre-prompt and pre-execution Commands in Bash
## Comandos pre-prompt y pre-ejecucucióne personalizados en Bash
Bash does not have a formal preexec/precmd framework like most other shells. Because of this, it is difficult to provide fully customizable hooks in `bash`. However, Starship does give you limited ability to insert your own functions into the prompt-rendering procedure:
Bash no posee un framework oficial de preexec/precmd como la mayoría de las demás shells. Por lo tanto, es complicado proveer una personalización completa en `bash`. Sin embargo, Starship te da la posibilidad de insertar de forma limitada tus propias funciones en el proceso de renderizado del prompt:
- To run a custom function right before the prompt is drawn, define a new function and then assign its name to `starship_precmd_user_func`. For example, to draw a rocket before the prompt, you would do
- Para ejecutar una función personalizada previa al renderizado del prompt, defina una nueva función y asigne su nombre a `starship_precmd_user_func`. Por ejemplo, para renderizar un cohete antes del prompt, se puede realizar así:
```bash
function blastoff(){
@ -21,7 +21,7 @@ function blastoff(){
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! Starship can preserve the value of the DEBUG trap, but if the trap is overwritten after starship starts up, some functionality will break.
- Para ejecutar una función personalizada antes de que un comando sea ejecutado, es posible usar el [mecanismo `DEBUG` trap](https://jichu4n.com/posts/debug-trap-and-prompt_command-in-bash/). No obstante, ¡es **necesario** atrapar la señal DEBUG *antes* de inicializar Starship! Starship puede preservar el valor del mecanismo, pero si el mecanismo es reemplazado después de que Starship se inicie, algunas funcionalidades fallarán.
```bash
function blastoff(){
@ -31,37 +31,37 @@ trap blastoff DEBUG # Trap DEBUG *before* running starship
eval $(starship init bash)
```
## Change Window Title
## Cambiar el título de la ventana
Some shell prompts will automatically change the window title for you (e.g. to reflect your working directory). Fish even does it by default. Starship does not do this, but it's fairly straightforward to add this functionality to `bash` or `zsh`.
Algunos shell prompts van a cambiar automáticamente el título de la ventana por ti. (Por ejemplo, para mostrar tu directorio actual). Fish incluso lo hace de forma predeterminada. Starship no hace esto, pero es bastante sencillo añadir esta funcionalidad a `bash` o `zsh`.
First, define a window title change function (identical in bash and zsh):
Primero defina una función para el cambio de titulo de la ventana (idéntico en bash y zsh):
```bash
function set_win_title(){
echo -ne "\033]0; YOUR_WINDOW_TITLE_HERE \007"
echo -ne "\033]0; TU_TÍTULO_DE_VENTANA_AQUÍ \007"
}
```
You can use variables to customize this title (`$USER`, `$HOSTNAME`, and `$PWD` are popular choices).
Puede usar variables para personalizar este titulo (`$USER`, `$HOSTNAME` y `$PWD` son opciones populares).
In `bash`, set this function to be the precmd starship function:
En `bash`, establezca que esta función sea la función precmd de Starship:
```bash
starship_precmd_user_func="set_win_title"
```
In `zsh`, add this to the `precmd_functions` array:
En `zsh`, añade esto al array `precmd_functions`:
```bash
precmd_functions+=(set_win_title)
```
If you like the result, add these lines to your shell configuration file (`~/.bashrc` or `~/.zsrhc`) to make it permanent.
Si te gusta el resultado, añade estas líneas a tu archivo de configuración del shell (`~/.bashrc` o `~/.zsrhc`) para hacerlo permanente.
## Dar estilo a cadenas de texto
## Cadenas de estilo
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:
Las cadenas de estilo son una lista de palabras, separadas por espacios en blanco. Las palabras no son sensibles a mayúsculas (es decir, `negrita` y `NeGriTa` se consideran la misma cadena). Cada palabra puede ser una de las siguientes:
- `bold`
- `underline`
@ -71,14 +71,14 @@ Style strings are a list of words, separated by whitespace. The words are not ca
- `<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. The order of words in the string does not matter.
donde `<color>` es un especificador de color (discutido a continuación). `fg:<color>` y `<color>` hacen actualmente lo mismo, aunque esto puede cambiar en el futuro. El orden de las palabras en la cadena no importa.
The `none` token overrides all other tokens in a string, so that e.g. `fg:red none fg:blue` will still create a string with no styling. It may become an error to use `none` in conjunction with other tokens in the future.
El token `none` anula todas las otras fichas en una cadena, por lo que, por ejemplo, `fg:red none fg:blue` creará una cadena sin ningún tipo de estilo. Puede convertirse en un error usar `none` junto con otros tokens en el futuro.
A color specifier can be one of the following:
Un especificador de color puede ser uno de los siguientes:
- 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 [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).
- Uno de los colores estándar del terminal: `black`, `red`, `green`, `blue`, `yellow`, `purple`, `cyan`, `white`. Opcionalmente puedes prefijar estos con `bright-` para obtener la versión brillante (por ejemplo, `bright-white`).
- Un `#` seguido de un número hexadecimal de seis dígitos. Esto especifica un [código hexadecimal de color RGB](https://www.w3schools.com/colors/colors_hexadecimal.asp).
- Un número entre 0-255. Esto especifica un [Código ANSI de color de 8-bits](https://i.stack.imgur.com/KTSQa.png).
If multiple colors are specified for foreground/background, the last one in the string will take priority.
Si se especifican varios colores para el primer plano/fondo, el último en la cadena tendrá prioridad.

View file

@ -32,7 +32,7 @@ Puedes modificar la ubicación por defecto del fichero `starship.toml` con la va
export STARSHIP_CONFIG=~/.starship
```
Equivalently in PowerShell (Windows) would be adding this line to your `$PROFILE`:
El equivalente en PowerShell (Windows) es añadir esta línea a tu `$PROFILE`:
```ps1
$ENV:STARSHIP_CONFIG = "$HOME\.starship"
```
@ -113,6 +113,7 @@ prompt_order = [
"haskell",
"java",
"julia",
"nim",
"nodejs",
"ocaml",
"php",
@ -376,9 +377,18 @@ Por ejemplo, dado `~/Dev/Nix/nixpkgs/pkgs` donde `nixpkgs` es la raíz del repos
| Variable | Por defecto | Descripción |
| --------------------------- | ----------- | ---------------------------------------------------------------------------------------- |
| `substitutions` | | A table of substitutions to be made to the path. |
| `fish_style_pwd_dir_length` | `0` | The number of characters to use when applying fish shell pwd path logic. |
| `use_logical_path` | `true` | Displays the logical path provided by the shell (`PWD`) instead of the path from the OS. |
`substitutions` allows you to define arbitrary replacements for literal strings that occur in the path, for example long network prefixes or development directories (i.e. Java). Note that this will disable the fish style PWD.
```toml
[directory.substitutions]
"/Volumes/network/path" = "/net"
"src/com/long/java/path" = "mypath"
```
`fish_style_pwd_dir_length` interacts with the standard truncation options in a way that can be surprising at first: if it's non-zero, the components of the path that would normally be truncated are instead displayed with that many characters. For example, the path `/built/this/city/on/rock/and/roll`, which would normally be displayed as as `rock/and/roll`, would be displayed as `/b/t/c/o/rock/and/roll` with `fish_style_pwd_dir_length = 1`--the path components that would normally be removed are displayed with a single character. For `fish_style_pwd_dir_length = 2`, it would be `/bu/th/ci/on/rock/and/roll`.
</details>
@ -394,7 +404,7 @@ truncation_length = 8
## Docker context
El módulo `docker_context` muestra el [Docker context](https://docs.docker.com/engine/context/working-with-contexts/) activo si no está a `default`.
The `docker_context` module shows the currently active [Docker context](https://docs.docker.com/engine/context/working-with-contexts/) if it's not set to `default`.
### Opciones
@ -950,6 +960,32 @@ truncation_length = 4
truncation_symbol = ""
```
## Nim
The `nim` module shows the currently installed version of Nim. El módulo se muestra si algunas de las siguientes condiciones se cumplen:
- The current directory contains a `nim.cfg` file
- The current directory contains a file with the `.nim` extension
- The current directory contains a file with the `.nims` extension
- The current directory contains a file with the `.nimble` extension
### Opciones
| Variable | Por defecto | Descripción |
| ---------- | --------------- | ----------------------------------------------------- |
| `symbol` | `"👑 "` | The symbol used before displaying the version of Nim. |
| `style` | `"bold yellow"` | El estilo del módulo. |
| `disabled` | `false` | Disables the `nim` module. |
### Ejemplo
```toml
# ~/.config/starship.toml
[nim]
style = "yellow"
symbol = "🎣 "
```
## Nix-shell
The `nix_shell` module shows the nix-shell environment. The module will be shown when inside a nix-shell environment.
@ -982,7 +1018,7 @@ symbol = "☃️ "
The `nodejs` module shows the currently installed version of NodeJS. El módulo se muestra si algunas de las siguientes condiciones se cumplen:
- El directorio actual contiene un fichero `package.json`
- The current directory contains a `package.json` file
- The current directory contains a `.node-version` file
- The current directory contains a `node_modules` directory
- The current directory contains a file with the `.js` extension
@ -1004,7 +1040,7 @@ The `nodejs` module shows the currently installed version of NodeJS. El módulo
symbol = "🤖 "
```
## Versión del paquete
## Package Version
The `package` module is shown when the current directory is the repository for a package, and shows its current version. The module currently supports `npm`, `cargo`, `poetry`, `composer`, `gradle`, `julia` and `mix` packages.
@ -1068,7 +1104,7 @@ symbol = "🐪 "
The `php` module shows the currently installed version of PHP. El módulo se muestra si algunas de las siguientes condiciones se cumplen:
- El directorio actual contiene un fichero `composer.json`
- The current directory contains a `composer.json` file
- The current directory contains a `.php-version` file
- The current directory contains a `.php` file
@ -1098,12 +1134,12 @@ If `pyenv_version_name` is set to `true`, it will display the pyenv version name
El módulo se muestra si algunas de las siguientes condiciones se cumplen:
- The current directory contains a `.python-version` file
- El directorio actual contiene un fichero `requirements.txt`
- El directorio actual contiene un fichero `pyproject.toml`
- The current directory contains a `requirements.txt` file
- The current directory contains a `pyproject.toml` file
- The current directory contains a file with the `.py` extension (and `scan_for_pyfiles` is true)
- The current directory contains a `Pipfile` file
- El directorio actual contiene un fichero `tox.ini`
- El directorio actual contiene un fichero `setup.py`
- The current directory contains a `tox.ini` file
- The current directory contains a `setup.py` file
- The current directory contains a `__init__.py` file
- A virtual environment is currently activated
@ -1227,7 +1263,7 @@ The `terraform` module shows the currently selected terraform workspace and vers
symbol = "🏎💨 "
```
## Hora
## Time
The `time` module shows the current **local** time. The `format` configuration value is used by the [`chrono`](https://crates.io/crates/chrono) crate to control how the time is displayed. Take a look [at the chrono strftime docs](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) to see what options are available.
@ -1241,11 +1277,12 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y
| Variable | Por defecto | Descripción |
| ----------------- | --------------- | ------------------------------------------------------------------------------------------------------------------- |
| `use_12hr` | `false` | Enables 12 hour formatting |
| `use_12hr` | `false` | Enables 12 hour formatting. |
| `format` | see below | The [chrono format string](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) used to format the time. |
| `style` | `"bold yellow"` | The style for the module time |
| `style` | `"bold yellow"` | The style for the module time. |
| `utc_time_offset` | `"local"` | Sets the UTC offset to use. Range from -24 < x < 24. Allows floats to accommodate 30/45 minute timezone offsets. |
| `disabled` | `true` | Disables the `time` module. |
| `time_range` | `"-"` | Sets the time range during which the module will be shown. Times must be specified in 24-hours format |
If `use_12hr` is `true`, then `format` defaults to `"%r"`. Otherwise, it defaults to `"%T"`. Manually setting `format` will override the `use_12hr` setting.
@ -1258,9 +1295,10 @@ If `use_12hr` is `true`, then `format` defaults to `"%r"`. Otherwise, it default
disabled = false
format = "🕙[ %T ]"
utc_time_offset = "-5"
time_range = "10:00:00-14:00:00"
```
## Nombre de usuario
## Username
The `username` module shows active user's username. El módulo se muestra si algunas de las siguientes condiciones se cumplen:
@ -1311,7 +1349,7 @@ The `zig` module shows the currently installed version of Zig. El módulo se mue
symbol = "⚡️ "
```
## Comandos personalizados
## Custom commands
The `custom` modules show the output of some arbitrary commands.
@ -1339,8 +1377,8 @@ The order in which custom modules are shown can be individually set by setting `
| ------------- | ------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| `command` | | The command whose output should be printed. |
| `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` | | The path to the shell to use to execute the command. If unset, it will fallback to STARSHIP_SHELL and then to "sh". |
| `descripción` | `"<custom module>"` | The description of the module that is shown when running `starship explain`. |
| `shell` | | [See below](#custom-command-shell) |
| `description` | `"<custom module>"` | The description of the module that is shown when running `starship explain`. |
| `files` | `[]` | The files that will be searched in the working directory for a match. |
| `directories` | `[]` | The directories that will be searched in the working directory for a match. |
| `extensions` | `[]` | The extensions that will be searched in the working directory for a match. |
@ -1350,6 +1388,32 @@ The order in which custom modules are shown can be individually set by setting `
| `suffix` | `""` | Suffix to display immediately after the command output. |
| `disabled` | `false` | Disables this `custom` module. |
#### Custom command shell
`shell` accepts a non-empty list of strings, where:
- The first string is the path to the shell to use to execute the command.
- Other following arguments are passed to the shell.
If unset, it will fallback to STARSHIP_SHELL and then to "sh" on Linux, and "cmd /C" on Windows.
If `shell` is not given or only contains one element and Starship detects PowerShell will be used, the following arguments will automatically be added: `-NoProfile -Command -`. This behavior can be avoided by explicitly passing arguments to the shell, e.g.
```toml
shell = ["pwsh", "-Command", "-"]
```
::: warning Make sure your custom shell configuration exits gracefully
If you set a custom command, make sure that the default Shell used by starship will properly execute the command with a graceful exit (via the `shell` option).
For example, PowerShell requires the `-Command` parameter to execute a one liner. Omitting this parameter might throw starship into a recursive loop where the shell might try to load a full profile environment with starship itself again and hence re-execute the custom command, getting into a never ending loop.
Parameters similar to `-NoProfile` in PowerShell are recommended for other shells as well to avoid extra loading time of a custom profile on every starship invocation.
Automatic detection of shells and proper parameters addition are currently implemented, but it's possible that not all shells are covered. [Please open an issue](https://github.com/starship/starship/issues/new/choose) with shell details and starship configuration if you hit such scenario.
:::
### Ejemplo
```toml
@ -1360,6 +1424,12 @@ command = "echo foo" # shows output of command
files = ["foo"] # can specify filters
when = """ test "$HOME" == "$PWD" """
prefix = " transcending "
[custom.time]
command = "time /T"
files = ["*.pst"]
prefix = "transcending "
shell = ["pwsh.exe", "-NoProfile", "-Command", "-"]
```
## PureScript

View file

@ -56,6 +56,9 @@ symbol = " "
[memory_usage]
symbol = " "
[nim]
symbol = " "
[nix_shell]
symbol = " "

View file

@ -113,6 +113,7 @@ prompt_order = [
"haskell",
"java",
"julia",
"nim",
"nodejs",
"ocaml",
"php",
@ -376,9 +377,18 @@ For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, an
| Variable | Default | Description |
| --------------------------- | ------- | ---------------------------------------------------------------------------------------- |
| `substitutions` | | A table of substitutions to be made to the path. |
| `fish_style_pwd_dir_length` | `0` | The number of characters to use when applying fish shell pwd path logic. |
| `use_logical_path` | `true` | Displays the logical path provided by the shell (`PWD`) instead of the path from the OS. |
`substitutions` allows you to define arbitrary replacements for literal strings that occur in the path, for example long network prefixes or development directories (i.e. Java). Note that this will disable the fish style PWD.
```toml
[directory.substitutions]
"/Volumes/network/path" = "/net"
"src/com/long/java/path" = "mypath"
```
`fish_style_pwd_dir_length` interacts with the standard truncation options in a way that can be surprising at first: if it's non-zero, the components of the path that would normally be truncated are instead displayed with that many characters. For example, the path `/built/this/city/on/rock/and/roll`, which would normally be displayed as as `rock/and/roll`, would be displayed as `/b/t/c/o/rock/and/roll` with `fish_style_pwd_dir_length = 1`--the path components that would normally be removed are displayed with a single character. For `fish_style_pwd_dir_length = 2`, it would be `/bu/th/ci/on/rock/and/roll`.
</details>
@ -841,7 +851,7 @@ Displays the current Kubernetes context name and, if set, the namespace from the
::: tip
Ce module est désactivé par défaut. Pour l'activer, configurez `disabled` sur `false` dans votre fichier de configuration.
This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
:::
@ -894,7 +904,7 @@ By default the swap usage is displayed if the total system swap is non-zero.
::: tip
Ce module est désactivé par défaut. Pour l'activer, configurez `disabled` sur `false` dans votre fichier de configuration.
This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
:::
@ -950,6 +960,32 @@ truncation_length = 4
truncation_symbol = ""
```
## Nim
The `nim` module shows the currently installed version of Nim. Le module est affiché si l'une des ces conditions est remplie :
- The current directory contains a `nim.cfg` file
- The current directory contains a file with the `.nim` extension
- The current directory contains a file with the `.nims` extension
- The current directory contains a file with the `.nimble` extension
### Options
| Variable | Default | Description |
| ---------- | --------------- | ----------------------------------------------------- |
| `symbol` | `"👑 "` | The symbol used before displaying the version of Nim. |
| `style` | `"bold yellow"` | The style for the module. |
| `disabled` | `false` | Disables the `nim` module. |
### Exemple
```toml
# ~/.config/starship.toml
[nim]
style = "yellow"
symbol = "🎣 "
```
## Nix-shell
The `nix_shell` module shows the nix-shell environment. The module will be shown when inside a nix-shell environment.
@ -1109,7 +1145,7 @@ Le module est affiché si l'une des ces conditions est remplie :
### Options
| Variable | Default | Description |
| Variable | Défault | Description |
| -------------------- | --------------- | --------------------------------------------------------------------------- |
| `symbol` | `"🐍 "` | The symbol used before displaying the version of Python. |
| `pyenv_version_name` | `false` | Use pyenv to get Python version |
@ -1139,7 +1175,7 @@ The `ruby` module shows the currently installed version of Ruby. Le module est a
### Options
| Variable | Défault | Description |
| Variable | Défaut | Description |
| ---------- | -------------- | ------------------------------------------------------ |
| `symbol` | `"💎 "` | The symbol used before displaying the version of Ruby. |
| `style` | `"bold green"` | The style for the module. |
@ -1163,7 +1199,7 @@ The `rust` module shows the currently installed version of Rust. Le module est a
### Options
| Variable | Défaut | Description |
| Variable | Default | Description |
| ---------- | -------------- | ------------------------------------------------------ |
| `symbol` | `"🦀 "` | The symbol used before displaying the version of Rust. |
| `style` | `"bold green"` | The style for the module. |
@ -1227,27 +1263,28 @@ The `terraform` module shows the currently selected terraform workspace and vers
symbol = "🏎💨 "
```
## Temps
## Time
Le module `time` affiche l'heure actuelle **localement**. La valeur de `format` est utilisée par le package [`chrono`](https://crates.io/crates/chrono) pour contrôler la façon dont l'heure est affichée. Consultez la [doc de chrono strftime](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) pour découvrir les options disponibles.
The `time` module shows the current **local** time. The `format` configuration value is used by the [`chrono`](https://crates.io/crates/chrono) crate to control how the time is displayed. Take a look [at the chrono strftime docs](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) to see what options are available.
::: tip
Ce module est désactivé par défaut. Pour l'activer, configurez `disabled` sur `false` dans votre fichier de configuration.
This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
:::
### Options
| Variable | Default | Description |
| ----------------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| `use_12hr` | `false` | Activer le format 12h |
| `format` | voir plus bas | Le [format chrono](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) utilisé pour formater l'heure. |
| `style` | `"bold yellow"` | Le style utilisé par le module |
| `utc_time_offset` | `"local"` | Définir le décalage horaire UTC à utiliser. Intervalle de -24 < x < 24. Accepte des nombres décimaux pour s'adapter aux décalages de 30/45 minutes. |
| `disabled` | `true` | Désactiver le module `time`. |
| Variable | Default | Description |
| ----------------- | --------------- | ------------------------------------------------------------------------------------------------------------------- |
| `use_12hr` | `false` | Enables 12 hour formatting. |
| `format` | see below | The [chrono format string](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) used to format the time. |
| `style` | `"bold yellow"` | The style for the module time. |
| `utc_time_offset` | `"local"` | Sets the UTC offset to use. Range from -24 < x < 24. Allows floats to accommodate 30/45 minute timezone offsets. |
| `disabled` | `true` | Disables the `time` module. |
| `time_range` | `"-"` | Sets the time range during which the module will be shown. Times must be specified in 24-hours format |
Si `use_12hr` a pour valeur `true`, le `format` par défaut est `"%r"`. Sinon, il est défini comme `"%T"`. Définir manuellement le `format` passera outre la valeur de `user_12hr`.
If `use_12hr` is `true`, then `format` defaults to `"%r"`. Otherwise, it defaults to `"%T"`. Manually setting `format` will override the `use_12hr` setting.
### Exemple
@ -1258,25 +1295,26 @@ Si `use_12hr` a pour valeur `true`, le `format` par défaut est `"%r"`. Sinon, i
disabled = false
format = "🕙[ %T ]"
utc_time_offset = "-5"
time_range = "10:00:00-14:00:00"
```
## Nom d'utilisateur
## Username
Le module `username` affiche le nom d'utilisateur de l'utilisateur actif. Le module est affiché si l'une des ces conditions est remplie :
The `username` module shows active user's username. Le module est affiché si l'une des ces conditions est remplie :
- L'utilisateur courant est root
- L'utilisateur courant est différent de celui connecté
- L'utilisateur est actuellement connecté à une session SSH
- La variable `show_always` a comme valeur true
- The current user is root
- The current user isn't the same as the one that is logged in
- The user is currently connected as an SSH session
- The variable `show_always` is set to true
### Options
| Variable | Default | Description |
| ------------- | --------------- | ------------------------------------------------ |
| `style_root` | `"bold green"` | Le style utilisé quand l'utilisateur est root. |
| `style_user` | `"bold yellow"` | Le style utilisé pour les utilisateurs non-root. |
| `show_always` | `false` | Toujours afficher le module `username`. |
| `disabled` | `false` | Désactiver le module `username`. |
| Variable | Default | Description |
| ------------- | --------------- | ------------------------------------- |
| `style_root` | `"bold green"` | The style used when the user is root. |
| `style_user` | `"bold yellow"` | The style used for non-root users. |
| `show_always` | `false` | Always shows the `username` module. |
| `disabled` | `false` | Disables the `username` module. |
### Exemple
@ -1339,7 +1377,7 @@ The order in which custom modules are shown can be individually set by setting `
| ------------- | ------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| `command` | | The command whose output should be printed. |
| `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` | | The path to the shell to use to execute the command. If unset, it will fallback to STARSHIP_SHELL and then to "sh". |
| `shell` | | [See below](#custom-command-shell) |
| `description` | `"<custom module>"` | The description of the module that is shown when running `starship explain`. |
| `files` | `[]` | The files that will be searched in the working directory for a match. |
| `directories` | `[]` | The directories that will be searched in the working directory for a match. |
@ -1350,6 +1388,32 @@ The order in which custom modules are shown can be individually set by setting `
| `suffix` | `""` | Suffix to display immediately after the command output. |
| `disabled` | `false` | Disables this `custom` module. |
#### Custom command shell
`shell` accepts a non-empty list of strings, where:
- The first string is the path to the shell to use to execute the command.
- Other following arguments are passed to the shell.
If unset, it will fallback to STARSHIP_SHELL and then to "sh" on Linux, and "cmd /C" on Windows.
If `shell` is not given or only contains one element and Starship detects PowerShell will be used, the following arguments will automatically be added: `-NoProfile -Command -`. This behavior can be avoided by explicitly passing arguments to the shell, e.g.
```toml
shell = ["pwsh", "-Command", "-"]
```
::: warning Make sure your custom shell configuration exits gracefully
If you set a custom command, make sure that the default Shell used by starship will properly execute the command with a graceful exit (via the `shell` option).
For example, PowerShell requires the `-Command` parameter to execute a one liner. Omitting this parameter might throw starship into a recursive loop where the shell might try to load a full profile environment with starship itself again and hence re-execute the custom command, getting into a never ending loop.
Parameters similar to `-NoProfile` in PowerShell are recommended for other shells as well to avoid extra loading time of a custom profile on every starship invocation.
Automatic detection of shells and proper parameters addition are currently implemented, but it's possible that not all shells are covered. [Please open an issue](https://github.com/starship/starship/issues/new/choose) with shell details and starship configuration if you hit such scenario.
:::
### Exemple
```toml
@ -1360,6 +1424,12 @@ command = "echo foo" # shows output of command
files = ["foo"] # can specify filters
when = """ test "$HOME" == "$PWD" """
prefix = " transcending "
[custom.time]
command = "time /T"
files = ["*.pst"]
prefix = "transcending "
shell = ["pwsh.exe", "-NoProfile", "-Command", "-"]
```
## PureScript

View file

@ -56,6 +56,9 @@ symbol = " "
[memory_usage]
symbol = " "
[nim]
symbol = " "
[nix_shell]
symbol = " "

View file

@ -32,7 +32,7 @@ disabled = true
export STARSHIP_CONFIG=~/.starship
```
Equivalently in PowerShell (Windows) would be adding this line to your `$PROFILE`:
PowerShell (Windows) で同様に `$PROFILE`にこの行を追加します。
```ps1
$ENV:STARSHIP_CONFIG = "$HOME\.starship"
```
@ -113,6 +113,7 @@ prompt_order = [
"haskell",
"java",
"julia",
"nim",
"nodejs",
"ocaml",
"php",
@ -142,7 +143,7 @@ prompt_order = [
`aws` モジュールは現在のAWSプロファイルが表示されます。 これは `~/.aws/config` に記述されている `AWS_REGION`, `AWS_DEFAULT_REGION`, and `AWS_PROFILE` 環境変数に基づいています。
When using [aws-vault](https://github.com/99designs/aws-vault) the profile is read from the `AWS_VAULT` env var.
[aws-vault](https://github.com/99designs/aws-vault)を使用する場合、プロファイル は`AWS_VAULT`env varから読み取られます。
### オプション
@ -312,12 +313,12 @@ Note: これはconda自身の プロンプト修飾子 を抑制しません。`
### オプション
| 変数 | デフォルト | 説明 |
| ------------------- | -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `truncation_length` | `1` | The number of directories the environment path should be truncated to, if the environment was created via `conda create -p [path]`. `0` means no truncation. Also see the [`directory`](#directory) module. |
| `symbol` | `"C "` | 環境名の直前に使用されるシンボルです。 |
| `style` | `"bold green"` | モジュールのスタイルです。 |
| `disabled` | `false` | `conda`モジュールを無効にします。 |
| 変数 | デフォルト | 説明 |
| ------------------- | -------------- | ---------------------------------------------------------------------------------------------------------------- |
| `truncation_length` | `1` | 環境が`conda create -p [path]`で作成された場合、環境パスが切り捨てられるディレクトリ数。 `0`は切り捨てがないことを意味します。 [`directory`](#directory)もご覧ください。 |
| `symbol` | `"C "` | 環境名の直前に使用されるシンボルです。 |
| `style` | `"bold green"` | モジュールのスタイルです。 |
| `disabled` | `false` | `conda`モジュールを無効にします。 |
### 設定例
@ -374,10 +375,19 @@ fishスタイルのpwdオプションを使用すると、切り捨てられた
<details>
<summary>このモジュールは、どのようにディレクトリを表示するかについての高度なオプションをいくつか持っています。</summary>
| 変数 | デフォルト | 説明 |
| --------------------------- | ------ | -------------------------------------------- |
| `fish_style_pwd_dir_length` | `0` | fish shellのpwdパスロジックを適用するときに使用する文字数です。 |
| `use_logical_path` | `true` | OSからのパスの代わりに、シェル(`PWD`) によって提供される論理パスを表示します。 |
| 変数 | デフォルト | 説明 |
| --------------------------- | ------ | ---------------------------------------------------------------------------------------- |
| `substitutions` | | A table of substitutions to be made to the path. |
| `fish_style_pwd_dir_length` | `0` | The number of characters to use when applying fish shell pwd path logic. |
| `use_logical_path` | `true` | Displays the logical path provided by the shell (`PWD`) instead of the path from the OS. |
`substitutions` allows you to define arbitrary replacements for literal strings that occur in the path, for example long network prefixes or development directories (i.e. Java). Note that this will disable the fish style PWD.
```toml
[directory.substitutions]
"/Volumes/network/path" = "/net"
"src/com/long/java/path" = "mypath"
```
`fish_style_pwd_dir_length` interacts with the standard truncation options in a way that can be surprising at first: if it's non-zero, the components of the path that would normally be truncated are instead displayed with that many characters. For example, the path `/built/this/city/on/rock/and/roll`, which would normally be displayed as as `rock/and/roll`, would be displayed as `/b/t/c/o/rock/and/roll` with `fish_style_pwd_dir_length = 1`--the path components that would normally be removed are displayed with a single character. For `fish_style_pwd_dir_length = 2`, it would be `/bu/th/ci/on/rock/and/roll`.
@ -394,7 +404,7 @@ truncation_length = 8
## Docker Context
The `docker_context` module shows the currently active [Docker context](https://docs.docker.com/engine/context/working-with-contexts/) if it's not set to `default`.
`docker_context`モジュールは、 [Dockerコンテキスト](https://docs.docker.com/engine/context/working-with-contexts/)が`デフォルト`に設定されていない場合、現在アクティブな <1>Dockerコンテキストを表示します。
### オプション
@ -403,7 +413,7 @@ The `docker_context` module shows the currently active [Docker context](https://
| `symbol` | `"🐳 "` | The symbol used before displaying the Docker context . |
| `only_with_files` | `false` | Only show when there's a `docker-compose.yml` or `Dockerfile` in the current directory. |
| `style` | `"bold blue"` | モジュールのスタイルです。 |
| `disabled` | `true` | Disables the `docker_context` module. |
| `disabled` | `true` | `docker_context`モジュールを無効にします。 |
### 設定例
@ -471,7 +481,7 @@ symbol = "🔮 "
- カレントディレクトリに`elm.json`ファイルが含まれている
- カレントディレクトリに`elm-package.json`ファイルが含まれている
- The current directory contains a `.elm-version` file
- カレントディレクトリに`.elm-version`ファイルが含まれている
- カレントディレクトリに`elm-stuff`フォルダが含まれている
- カレントディレクトリに`*.elm`ファイルが含まれている
@ -692,7 +702,7 @@ deleted = "🗑"
- カレントディレクトリに`glide.yaml`ファイルが含まれている
- カレントディレクトリに`Gopkg.yml`ファイルが含まれている
- カレントディレクトリに`Gopkg.lock`ファイルが含まれている
- The current directory contains a `.go-version` file
- カレントディレクトリに`.go-version`ファイルが含まれている
- カレントディレクトリに`Godeps`ファイルが含まれている
- カレントディレクトリに`.go`の拡張子のファイルが含まれている
@ -768,7 +778,7 @@ disabled = false
`java`モジュールは、現在インストールされているJavaのバージョンを示します。 次の条件のいずれかが満たされると、モジュールが表示されます。
- The current directory contains a `pom.xml`, `build.gradle.kts`, `build.sbt` or `.java-version` file
- カレントディレクトリに `pom.xml`, `build.gradle.kts`, `build.sbt` ,もしくは`.java-version`が含まれている
- カレントディレクトリに拡張子が`.java`, `.class`, `.gradle`, もしくは`.jar`のファイルが含まれている
### オプション
@ -869,7 +879,7 @@ disabled = false
## 改行
`line_break`モジュールは、プロンプトを2行に分割します。
The `line_break` module separates the prompt into two lines.
### オプション
@ -888,14 +898,13 @@ disabled = true
## メモリ使用量
`memory_usage</ 0>モジュールは、現在のシステムメモリとスワップ使用量を示します。</p>
The `memory_usage` module shows current system memory and swap usage.
<p spaces-before="0">デフォルトでは、システムスワップの合計がゼロ以外の場合、スワップ使用量が表示されます。</p>
By default the swap usage is displayed if the total system swap is non-zero.
<p spaces-before="0">::: tip</p>
::: tip
<p spaces-before="0">このモジュールはデフォルトで無効になっています。
有効にするには、設定ファイルで<code>disabled`を`false`に設定します。
このモジュールはデフォルトで無効になっています。 有効にするには、設定ファイルで`disabled`を`false`に設定します。
:::
@ -928,7 +937,7 @@ style = "bold dimmed green"
## Mercurial ブランチ
` hg_branch `モジュールは、現在のディレクトリにあるリポジトリのアクティブなブランチを示します。
The `hg_branch` module shows the active branch of the repo in your current directory.
### オプション
@ -951,20 +960,46 @@ truncation_length = 4
truncation_symbol = ""
```
## Nim
The `nim` module shows the currently installed version of Nim. 次の条件のいずれかが満たされると、モジュールが表示されます。
- The current directory contains a `nim.cfg` file
- The current directory contains a file with the `.nim` extension
- The current directory contains a file with the `.nims` extension
- The current directory contains a file with the `.nimble` extension
### オプション
| 変数 | デフォルト | 説明 |
| ---------- | --------------- | ----------------------------------------------------- |
| `symbol` | `"👑 "` | The symbol used before displaying the version of Nim. |
| `style` | `"bold yellow"` | モジュールのスタイルです。 |
| `disabled` | `false` | Disables the `nim` module. |
### 設定例
```toml
# ~/.config/starship.toml
[nim]
style = "yellow"
symbol = "🎣 "
```
## Nix-shell
`nix_shell`モジュールは、nix-shell環境を示しています。 このモジュールは、nixシェル環境内にあるときに表示されます。
The `nix_shell` module shows the nix-shell environment. The module will be shown when inside a nix-shell environment.
### オプション
| 変数 | デフォルト | 説明 |
| ------------ | ------------- | ------------------------------------------------- |
| `use_name` | `false` | nix-shellの名前を表示します。 |
| `impure_msg` | `"impure"` | impureメッセージをカスタマイズします。 |
| `pure_msg` | `"pure"` | pureメッセージをカスタマイズします。 |
| `use_name` | `false` | Display the name of the nix-shell. |
| `impure_msg` | `"impure"` | Customize the "impure" msg. |
| `pure_msg` | `"pure"` | Customize the "pure" msg. |
| `symbol` | `"❄️ "` | The symbol used before displaying the shell name. |
| `style` | `"bold blue"` | モジュールのスタイルです。 |
| `disabled` | `false` | `nix_shell`モジュールを無効にします。 |
| `disabled` | `false` | Disables the `nix_shell` module. |
### 設定例
@ -981,20 +1016,20 @@ symbol = "☃️ "
## NodeJS
`nodejs`モジュールは、現在インストールされているNodeJSのバージョンを示します。 次の条件のいずれかが満たされると、モジュールが表示されます。
The `nodejs` module shows the currently installed version of NodeJS. 次の条件のいずれかが満たされると、モジュールが表示されます。
- カレントディレクトリに`package.json`ファイルが含まれている
- The current directory contains a `package.json` file
- The current directory contains a `.node-version` file
- カレントディレクトリに`node_modules`ディレクトリが含まれている
- カレントディレクトリに`.js`の拡張子のファイルが含まれている
- The current directory contains a `node_modules` directory
- The current directory contains a file with the `.js` extension
### オプション
| 変数 | デフォルト | 説明 |
| ---------- | -------------- | ----------------------------- |
| `symbol` | `"⬢ "` | NodeJSのバージョンを表示する前に使用される記号です。 |
| `style` | `"bold green"` | モジュールのスタイルです。 |
| `disabled` | `false` | `nodejs`モジュールを無効にします。 |
| 変数 | デフォルト | 説明 |
| ---------- | -------------- | -------------------------------------------------------- |
| `symbol` | `"⬢ "` | The symbol used before displaying the version of NodeJS. |
| `style` | `"bold green"` | モジュールのスタイルです。 |
| `disabled` | `false` | Disables the `nodejs` module. |
### 設定例
@ -1005,14 +1040,14 @@ symbol = "☃️ "
symbol = "🤖 "
```
## パッケージのバージョン
## Package Version
`package`モジュールは、現在のディレクトリがパッケージのリポジトリである場合に表示され、現在のバージョンが表示されます。 The module currently supports `npm`, `cargo`, `poetry`, `composer`, `gradle`, `julia` and `mix` packages.
The `package` module is shown when the current directory is the repository for a package, and shows its current version. The module currently supports `npm`, `cargo`, `poetry`, `composer`, `gradle`, `julia` and `mix` packages.
- **npm** `npm`パッケージバージョンは、現在のディレクトリにある`package.json`から抽出されます
- **cargo** `cargo`パッケージバージョンは、現在のディレクトリにある`Cargo.toml`から抽出されます。
- **poetry** `poetry`パッケージバージョンは、現在のディレクトリにある`pyproject.toml`から抽出されます
- **composer** `composer`パッケージバージョンは、現在のディレクトリにある`composer.json`から抽出されます
- **npm** The `npm` package version is extracted from the `package.json` present in the current directory
- **cargo** The `cargo` package version is extracted from the `Cargo.toml` present in the current directory
- **poetry** The `poetry` package version is extracted from the `pyproject.toml` present in the current directory
- **composer** The `composer` package version is extracted from the `composer.json` present in the current directory
- **gradle** The `gradle` package version is extracted from the `build.gradle` present
- **julia** - The package version is extracted from the `Project.toml` present
- **mix** - The `mix` package version is extracted from the `mix.exs` present
@ -1021,12 +1056,12 @@ symbol = "🤖 "
### オプション
| 変数 | デフォルト | 説明 |
| ----------------- | ------------ | --------------------------------------------------------- |
| `symbol` | `"📦 "` | パッケージのバージョンを表示する前に使用される記号です。 |
| `style` | `"bold 208"` | モジュールのスタイルです。 |
| `display_private` | `false` | Enable displaying version for packages marked as private. |
| `disabled` | `false` | `package` モジュールを無効にします。 |
| 変数 | デフォルト | 説明 |
| ----------------- | ------------ | ---------------------------------------------------------- |
| `symbol` | `"📦 "` | The symbol used before displaying the version the package. |
| `style` | `"bold 208"` | モジュールのスタイルです。 |
| `display_private` | `false` | Enable displaying version for packages marked as private. |
| `disabled` | `false` | Disables the `package` module. |
### 設定例
@ -1067,19 +1102,19 @@ symbol = "🐪 "
## PHP
`php`モジュールは、現在インストールされているPHPのバージョンを示します。 次の条件のいずれかが満たされると、モジュールが表示されます。
The `php` module shows the currently installed version of PHP. 次の条件のいずれかが満たされると、モジュールが表示されます。
- カレントディレクトリに`composer.json`ファイルが含まれている
- The current directory contains a `composer.json` file
- The current directory contains a `.php-version` file
- カレントディレクトリに`.php`の拡張子のファイルが含まれている
- The current directory contains a `.php` file
### オプション
| 変数 | デフォルト | 説明 |
| ---------- | ------------ | -------------------------- |
| `symbol` | `"🐘 "` | PHPのバージョンを表示する前に使用される記号です。 |
| `style` | `"bold 147"` | モジュールのスタイルです。 |
| `disabled` | `false` | `php`モジュールを無効にします。 |
| 変数 | デフォルト | 説明 |
| ---------- | ------------ | ----------------------------------------------------- |
| `symbol` | `"🐘 "` | The symbol used before displaying the version of PHP. |
| `style` | `"bold 147"` | モジュールのスタイルです。 |
| `disabled` | `false` | Disables the `php` module. |
### 設定例
@ -1098,26 +1133,26 @@ If `pyenv_version_name` is set to `true`, it will display the pyenv version name
次の条件のいずれかが満たされると、モジュールが表示されます。
- カレントディレクトリに`.python-version`ファイルが含まれている
- カレントディレクトリに`requirements.txt`ファイルが含まれている
- カレントディレクトリに`pyproject.toml`ファイルが含まれている
- The current directory contains a `.python-version` file
- The current directory contains a `requirements.txt` file
- The current directory contains a `pyproject.toml` file
- The current directory contains a file with the `.py` extension (and `scan_for_pyfiles` is true)
- カレントディレクトリに`Pipfile`ファイルが含まれている
- カレントディレクトリに`tox.ini`ファイルが含まれている
- カレントディレクトリに`setup.py`ファイルが含まれている
- The current directory contains a `Pipfile` file
- The current directory contains a `tox.ini` file
- The current directory contains a `setup.py` file
- The current directory contains a `__init__.py` file
- 仮想環境がアクティブである
- A virtual environment is currently activated
### オプション
| 変数 | デフォルト | 説明 |
| -------------------- | --------------- | -------------------------------------------------------------------------- |
| `symbol` | `"🐍 "` | Pythonのバージョンを表示する前に使用される記号です。 |
| `pyenv_version_name` | `false` | pyenvを使用してPythonバージョンを取得します |
| `pyenv_prefix` | `"pyenv "` | pyenvバージョン表示の前のprefix (デフォルトの表示は`pyenv MY_VERSION`) です |
| `scan_for_pyfiles` | `true` | If false, Python files in the current directory will not show this module. |
| `style` | `"bold yellow"` | モジュールのスタイルです。 |
| `disabled` | `false` | `python`モジュールを無効にします。 |
| 変数 | デフォルト | 説明 |
| -------------------- | --------------- | --------------------------------------------------------------------------- |
| `symbol` | `"🐍 "` | The symbol used before displaying the version of Python. |
| `pyenv_version_name` | `false` | Use pyenv to get Python version |
| `pyenv_prefix` | `"pyenv "` | Prefix before pyenv version display (default display is `pyenv MY_VERSION`) |
| `scan_for_pyfiles` | `true` | If false, Python files in the current directory will not show this module. |
| `style` | `"bold yellow"` | モジュールのスタイルです。 |
| `disabled` | `false` | Disables the `python` module. |
### 設定例
@ -1132,19 +1167,19 @@ pyenv_prefix = "foo "
## Ruby
`ruby`モジュールは、現在インストールされているRubyのバージョンを示します。 次の条件のいずれかが満たされると、モジュールが表示されます。
The `ruby` module shows the currently installed version of Ruby. 次の条件のいずれかが満たされると、モジュールが表示されます。
- カレントディレクトリに`Gemfile`ファイルが含まれている
- The current directory contains a `Gemfile` file
- The current directory contains a `.ruby-version` file
- カレントディレクトリに`.rb`の拡張子のファイルが含まれている
- The current directory contains a `.rb` file
### オプション
| 変数 | デフォルト | 説明 |
| ---------- | ------------ | --------------------------- |
| `symbol` | `"💎 "` | Rubyのバージョンを表示する前に使用される記号です。 |
| `style` | `"bold red"` | モジュールのスタイルです。 |
| `disabled` | `false` | `ruby`モジュールを無効にします。 |
| 変数 | デフォルト | 説明 |
| ---------- | ------------ | ------------------------------------------------------ |
| `symbol` | `"💎 "` | The symbol used before displaying the version of Ruby. |
| `style` | `"bold red"` | モジュールのスタイルです。 |
| `disabled` | `false` | Disables the `ruby` module. |
### 設定例
@ -1157,18 +1192,18 @@ symbol = "🔺 "
## Rust
`rust`モジュールには、現在インストールされているRustのバージョンが表示されます。 次の条件のいずれかが満たされると、モジュールが表示されます。
The `rust` module shows the currently installed version of Rust. 次の条件のいずれかが満たされると、モジュールが表示されます。
- カレントディレクトリに`Cargo.toml`ファイルが含まれている
- カレントディレクトリに`.rs`の拡張子のファイルが含まれている
- The current directory contains a `Cargo.toml` file
- The current directory contains a file with the `.rs` extension
### オプション
| 変数 | デフォルト | 説明 |
| ---------- | ------------ | --------------------------- |
| `symbol` | `"🦀 "` | Rustのバージョンを表示する前に使用される記号です。 |
| `style` | `"bold red"` | モジュールのスタイルです。 |
| `disabled` | `false` | `rust`モジュールを無効にします。 |
| 変数 | デフォルト | 説明 |
| ---------- | ------------ | ------------------------------------------------------ |
| `symbol` | `"🦀 "` | The symbol used before displaying the version of Rust. |
| `style` | `"bold red"` | モジュールのスタイルです。 |
| `disabled` | `false` | Disables the `rust` module. |
### 設定例
@ -1205,19 +1240,19 @@ symbol = "📦 "
## Terraform
`terraform`モジュールには、現在選択されているterraformワークスペースとバージョンが表示されます。 デフォルトでは、Terraformのバージョンは表示されません。これは、多くのプラグインが使用されている場合、Terraformの現在のバージョンでは遅いためです。 次の条件のいずれかが満たされると、モジュールが表示されます。
The `terraform` module shows the currently selected terraform workspace and version. By default the terraform version is not shown, since this is slow on current versions of terraform when a lot of plugins are in use. 次の条件のいずれかが満たされると、モジュールが表示されます。
- カレントディレクトリに`.terraform`フォルダが含まれている
- カレントディレクトリに`.tf`の拡張子のファイルが含まれている
- The current directory contains a `.terraform` folder
- Current directory contains a file with the `.tf` extension
### オプション
| 変数 | デフォルト | 説明 |
| -------------- | ------------ | --------------------------------------------- |
| `symbol` | `"💠 "` | Terraform ワークスペースを表示する前に使用される記号です。 |
| `show_version` | `false` | Terraformのバージョンを表示します。 大きなワークスペースでは非常に遅くなります。 |
| `style` | `"bold 105"` | モジュールのスタイルです。 |
| `disabled` | `false` | `terraform`モジュールを無効にします。 |
| 変数 | デフォルト | 説明 |
| -------------- | ------------ | ----------------------------------------------------------- |
| `symbol` | `"💠 "` | The symbol used before displaying the terraform workspace. |
| `show_version` | `false` | Shows the terraform version. Very slow on large workspaces. |
| `style` | `"bold 105"` | モジュールのスタイルです。 |
| `disabled` | `false` | Disables the `terraform` module. |
### 設定例
@ -1228,9 +1263,9 @@ symbol = "📦 "
symbol = "🏎💨 "
```
## 時刻
## Time
`time`モジュールは、現在の**現地**時間を示します。 `format`設定は、時間の表示方法を制御するために[`chrono`](https://crates.io/crates/chrono)クレートによって使用されます。 使用可能なオプションを確認するには、[chrono strftimeのドキュメント](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html)をご覧ください。
The `time` module shows the current **local** time. The `format` configuration value is used by the [`chrono`](https://crates.io/crates/chrono) crate to control how the time is displayed. Take a look [at the chrono strftime docs](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) to see what options are available.
::: tip
@ -1240,15 +1275,16 @@ symbol = "🏎💨 "
### オプション
| 変数 | デフォルト | 説明 |
| ----------------- | --------------- | ------------------------------------------------------------------------------------------------- |
| `use_12hr` | `false` | 12時間のフォーマットを有効にします。 |
| `format` | この表の下を参照してください | 時刻のフォーマットに使用される[クロノフォーマット文字列](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) です。 |
| `style` | `"bold yellow"` | モジュールのスタイルです。 |
| `utc_time_offset` | `"local"` | 使用するUTCオフセットを設定します。 -24から24までの間で設定可能です。 フロートが30/45分のタイムゾーンオフセットに対応できるようにします。 |
| `disabled` | `true` | `time`モジュールを無効にします。 |
| 変数 | デフォルト | 説明 |
| ----------------- | --------------- | ------------------------------------------------------------------------------------------------------------------- |
| `use_12hr` | `false` | Enables 12 hour formatting. |
| `format` | see below | The [chrono format string](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) used to format the time. |
| `style` | `"bold yellow"` | The style for the module time. |
| `utc_time_offset` | `"local"` | Sets the UTC offset to use. Range from -24 < x < 24. Allows floats to accommodate 30/45 minute timezone offsets. |
| `disabled` | `true` | Disables the `time` module. |
| `time_range` | `"-"` | Sets the time range during which the module will be shown. Times must be specified in 24-hours format |
`use_12hr``true` の場合、`format` のデフォルトは `"%r"` です。 それ以外の場合、デフォルトは`"%T"`です。 `format`を手動で設定すると、`use_12hr`の設定が上書きされます。
If `use_12hr` is `true`, then `format` defaults to `"%r"`. Otherwise, it defaults to `"%T"`. Manually setting `format` will override the `use_12hr` setting.
### 設定例
@ -1259,25 +1295,26 @@ symbol = "🏎💨 "
disabled = false
format = "🕙[ %T ]"
utc_time_offset = "-5"
time_range = "10:00:00-14:00:00"
```
## ユーザー名
## Username
`username`モジュールには、アクティブなユーザーのユーザー名が表示されます。 次の条件のいずれかが満たされると、モジュールが表示されます。
The `username` module shows active user's username. 次の条件のいずれかが満たされると、モジュールが表示されます。
- カレントユーザーがroot
- カレントユーザーが、ログインしているユーザーとは異なる
- ユーザーがSSHセッションとして接続されている
- `show_always`変数がtrueに設定されている
- The current user is root
- The current user isn't the same as the one that is logged in
- The user is currently connected as an SSH session
- The variable `show_always` is set to true
### オプション
| 変数 | デフォルト | 説明 |
| ------------- | --------------- | ------------------------- |
| `style_root` | `"bold red"` | ユーザーがrootのときに使用されるスタイルです。 |
| `style_user` | `"bold yellow"` | 非rootユーザーに使用されるスタイルです。 |
| `show_always` | `false` | `username` モジュールを常に表示します。 |
| `disabled` | `false` | `username` モジュールを無効にします。 |
| 変数 | デフォルト | 説明 |
| ------------- | --------------- | ------------------------------------- |
| `style_root` | `"bold red"` | The style used when the user is root. |
| `style_user` | `"bold yellow"` | The style used for non-root users. |
| `show_always` | `false` | Always shows the `username` module. |
| `disabled` | `false` | Disables the `username` module. |
### 設定例
@ -1340,8 +1377,8 @@ The order in which custom modules are shown can be individually set by setting `
| ------------- | ------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| `command` | | The command whose output should be printed. |
| `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` | | The path to the shell to use to execute the command. If unset, it will fallback to STARSHIP_SHELL and then to "sh". |
| `説明` | `"<custom module>"` | The description of the module that is shown when running `starship explain`. |
| `shell` | | [See below](#custom-command-shell) |
| `description` | `"<custom module>"` | The description of the module that is shown when running `starship explain`. |
| `files` | `[]` | The files that will be searched in the working directory for a match. |
| `directories` | `[]` | The directories that will be searched in the working directory for a match. |
| `extensions` | `[]` | The extensions that will be searched in the working directory for a match. |
@ -1351,6 +1388,32 @@ The order in which custom modules are shown can be individually set by setting `
| `suffix` | `""` | Suffix to display immediately after the command output. |
| `disabled` | `false` | Disables this `custom` module. |
#### Custom command shell
`shell` accepts a non-empty list of strings, where:
- The first string is the path to the shell to use to execute the command.
- Other following arguments are passed to the shell.
If unset, it will fallback to STARSHIP_SHELL and then to "sh" on Linux, and "cmd /C" on Windows.
If `shell` is not given or only contains one element and Starship detects PowerShell will be used, the following arguments will automatically be added: `-NoProfile -Command -`. This behavior can be avoided by explicitly passing arguments to the shell, e.g.
```toml
shell = ["pwsh", "-Command", "-"]
```
::: warning Make sure your custom shell configuration exits gracefully
If you set a custom command, make sure that the default Shell used by starship will properly execute the command with a graceful exit (via the `shell` option).
For example, PowerShell requires the `-Command` parameter to execute a one liner. Omitting this parameter might throw starship into a recursive loop where the shell might try to load a full profile environment with starship itself again and hence re-execute the custom command, getting into a never ending loop.
Parameters similar to `-NoProfile` in PowerShell are recommended for other shells as well to avoid extra loading time of a custom profile on every starship invocation.
Automatic detection of shells and proper parameters addition are currently implemented, but it's possible that not all shells are covered. [Please open an issue](https://github.com/starship/starship/issues/new/choose) with shell details and starship configuration if you hit such scenario.
:::
### 設定例
```toml
@ -1361,6 +1424,12 @@ command = "echo foo" # shows output of command
files = ["foo"] # can specify filters
when = """ test "$HOME" == "$PWD" """
prefix = " transcending "
[custom.time]
command = "time /T"
files = ["*.pst"]
prefix = "transcending "
shell = ["pwsh.exe", "-NoProfile", "-Command", "-"]
```
## PureScript

View file

@ -27,10 +27,10 @@ Starshipをbashで動作させる小さな例を次に示します。
# Get the status code from the last command executed
STATUS=$?
# Get the number of jobs running.
# 実行中のジョブの数を取得します。
NUM_JOBS=$(jobs -p | wc -l)
# Set the prompt to the output of `starship prompt`
# プロンプトを `starship prompt`に設定
PS1="$(starship prompt --status=$STATUS --jobs=$NUM_JOBS)"
```
@ -44,10 +44,10 @@ starship prompt --help
プロンプトは提供されているコンテキストを使用しますが、フラグは「必須」ではありません。
## How do I run Starship on Linux distributions with older versions of glibc?
## 古いバージョンの glibc を使用する Linux ディストリビューションで Starship を実行するにはどうすればよいですか?
If you get an error like "*version 'GLIBC_2.18' not found (required by starship)*" when using the prebuilt binary (for example, on CentOS 6 or 7), you can use a binary compiled with `musl` instead of `glibc`:
"*version 'GLIBC_2のようなエラーが表示された場合。 8' が見つかりません (starshipで要求されます)*" プリビルドバイナリを使用しています(例えば、 CentOS 6 または 7 では、`glibc`の代わりに`musl`でコンパイルされたバイナリを使用できます。
```sh
curl -fsSL https://starship.rs/install.sh | bash -s -- --platform unknown-linux-musl
curl -fsSL https://starship.rs/install.sh | bash -s --- -platform unknown-linux-musl
```

View file

@ -222,22 +222,22 @@
もしあなたが Starship への貢献に興味がある場合は、我々の[貢献ガイド](https://github.com/starship/starship/blob/master/CONTRIBUTING.md)をご覧ください。 また、気軽に我々の[Discord サーバー](https://discord.gg/8Jzqu3T)へ顔を出してください。 👋
### Code Contributors
### コードに貢献していただいた方々
This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].
このプロジェクトは、貢献したすべての人々のおかげで存在します。 [[Contribute](CONTRIBUTING.md)].
<a href="https://github.com/starship/starship/graphs/contributors"><img src="https://opencollective.com/starship/contributors.svg?width=890&button=false" /></a>
### Financial Contributors
### 財政的な貢献をしていただいた方々
Become a financial contributor and help us sustain our community. [[Contribute](https://opencollective.com/starship/contribute)]
財政的な貢献者になって、私たちのコミュニティを維持するのを助けていただけると嬉しいです。 [[Contribute](https://opencollective.com/starship/contribute)]
#### Individuals
#### 個人
<a href="https://opencollective.com/starship"><img src="https://opencollective.com/starship/individuals.svg?width=890"></a>
#### Organizations
#### 組織
Support this project with your organization. Your logo will show up here with a link to your website. [[Contribute](https://opencollective.com/starship/contribute)]
あなたの組織でこのプロジェクトをサポートします。 あなたのロゴはあなたのウェブサイトへのリンクとここに表示されます。 [[Contribute](https://opencollective.com/starship/contribute)]
<a href="https://opencollective.com/starship/organization/0/website"><img src="https://opencollective.com/starship/organization/0/avatar.svg"></a>
<a href="https://opencollective.com/starship/organization/1/website"><img src="https://opencollective.com/starship/organization/1/avatar.svg"></a>

View file

@ -56,6 +56,9 @@ symbol = " "
[memory_usage]
symbol = " "
[nim]
symbol = " "
[nix_shell]
symbol = " "

View file

@ -61,7 +61,7 @@ If you like the result, add these lines to your shell configuration file (`~/.ba
## Estilo dos textos
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:
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). Cada palavra pode ser uma das seguintes:
- `bold`
- `underline`
@ -79,6 +79,6 @@ A color specifier can be one of the following:
- 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 [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).
- Um número entre 0-255. Este especifica um [Código de Cor ANSI 8 bits](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

@ -32,7 +32,7 @@ Você pode alterar o caminho padrão do arquivo `starship.toml` com a variável
export STARSHIP_CONFIG=~/.starship
```
Equivalently in PowerShell (Windows) would be adding this line to your `$PROFILE`:
No PowerShell (Windows) você pode adicionar a seguinte linha no seu `$PROFILE`:
```ps1
$ENV:STARSHIP_CONFIG = "$HOME\.starship"
```
@ -52,16 +52,16 @@ Aqui está a representação do módulo Node. No exemplo a seguir, "symbol" e "v
### Estilo dos textos
Most modules in starship allow you to configure their display styles. This is done with an entry (usually called `style`) which is a string specifying the configuration. Here are some examples of style strings along with what they do. For details on the full syntax, consult the [advanced config guide](/advanced-config/).
A maioria dos módulos do starship permite que você configure o estilo de exibição dos textos. Isso é feito através de um parâmetro (geralmente chamado `style`) que é uma string especificando a configuração. Aqui estão alguns exemplos de strings de estilo e o que elas fazem. Para detalhes sobre a sintaxe completa, consulte o [guia de configurações avançadas](/advanced-config/).
- `"fg:green bg:blue"` sets green text on a blue background
- `"bg:blue fg:bright-green"` sets bright green text on a blue background
- `"bold fg:27"` sets bold text with [ANSI color](https://i.stack.imgur.com/KTSQa.png) 27
- `"underline bg:#bf5700"` sets underlined text on a burnt orange background
- `"bold italic fg:purple"` sets bold italic purple text
- `""` explicitly disables all styling
- `"fg:green bg:blue"` deixa o texto verde com o fundo azul
- `"bg:blue fg:bright-green"` deixa o texto verde brilhante com o fundo azul
- `"bold fg:27"` deixa o texto em negrito com a cor 27 [da tabela ANSI](https://i.stack.imgur.com/KTSQa.png)
- `"underline bg:#bf5700"` deixa o texto sublinhado com o fundo laranja escuro
- `"bold italic fg:purple"` deixa o texto em negrito e itálico com a cor roxa
- `""` desabilita explicitamente todos os estilos
Note that what styling looks like will be controlled by your terminal emulator. For example, some terminal emulators will brighten the colors instead of bolding text, and some color themes use the same values for the normal and bright colors. Also, to get italic text, your terminal must support italics.
Note que a aparência do estilo será controlado pelo seu terminal. Por exemplo, alguns terminais deixarão as cores mais brilhantes ao invés de deixar o texto em negrito, ou alguns temas podem usar as mesmas cores para cores brilhantes e normais. Além disso, para textos em itálico, o terminal precisa ter suporte.
## Prompt
@ -113,6 +113,7 @@ prompt_order = [
"haskell",
"java",
"julia",
"nim",
"nodejs",
"ocaml",
"php",
@ -376,9 +377,18 @@ For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, an
| Variable | Default | Description |
| --------------------------- | ------- | ---------------------------------------------------------------------------------------- |
| `substitutions` | | A table of substitutions to be made to the path. |
| `fish_style_pwd_dir_length` | `0` | The number of characters to use when applying fish shell pwd path logic. |
| `use_logical_path` | `true` | Displays the logical path provided by the shell (`PWD`) instead of the path from the OS. |
`substitutions` allows you to define arbitrary replacements for literal strings that occur in the path, for example long network prefixes or development directories (i.e. Java). Note that this will disable the fish style PWD.
```toml
[directory.substitutions]
"/Volumes/network/path" = "/net"
"src/com/long/java/path" = "mypath"
```
`fish_style_pwd_dir_length` interacts with the standard truncation options in a way that can be surprising at first: if it's non-zero, the components of the path that would normally be truncated are instead displayed with that many characters. For example, the path `/built/this/city/on/rock/and/roll`, which would normally be displayed as as `rock/and/roll`, would be displayed as `/b/t/c/o/rock/and/roll` with `fish_style_pwd_dir_length = 1`--the path components that would normally be removed are displayed with a single character. For `fish_style_pwd_dir_length = 2`, it would be `/bu/th/ci/on/rock/and/roll`.
</details>
@ -950,6 +960,32 @@ truncation_length = 4
truncation_symbol = ""
```
## Nim
The `nim` module shows the currently installed version of Nim. The module will be shown if any of the following conditions are met:
- The current directory contains a `nim.cfg` file
- The current directory contains a file with the `.nim` extension
- The current directory contains a file with the `.nims` extension
- The current directory contains a file with the `.nimble` extension
### Options
| Variable | Default | Description |
| ---------- | --------------- | ----------------------------------------------------- |
| `symbol` | `"👑 "` | The symbol used before displaying the version of Nim. |
| `style` | `"bold yellow"` | The style for the module. |
| `disabled` | `false` | Disables the `nim` module. |
### Example
```toml
# ~/.config/starship.toml
[nim]
style = "yellow"
symbol = "🎣 "
```
## Nix-shell
The `nix_shell` module shows the nix-shell environment. The module will be shown when inside a nix-shell environment.
@ -1241,11 +1277,12 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y
| Variable | Default | Description |
| ----------------- | --------------- | ------------------------------------------------------------------------------------------------------------------- |
| `use_12hr` | `false` | Enables 12 hour formatting |
| `use_12hr` | `false` | Enables 12 hour formatting. |
| `format` | see below | The [chrono format string](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) used to format the time. |
| `style` | `"bold yellow"` | The style for the module time |
| `style` | `"bold yellow"` | The style for the module time. |
| `utc_time_offset` | `"local"` | Sets the UTC offset to use. Range from -24 < x < 24. Allows floats to accommodate 30/45 minute timezone offsets. |
| `disabled` | `true` | Disables the `time` module. |
| `time_range` | `"-"` | Sets the time range during which the module will be shown. Times must be specified in 24-hours format |
If `use_12hr` is `true`, then `format` defaults to `"%r"`. Otherwise, it defaults to `"%T"`. Manually setting `format` will override the `use_12hr` setting.
@ -1258,6 +1295,7 @@ If `use_12hr` is `true`, then `format` defaults to `"%r"`. Otherwise, it default
disabled = false
format = "🕙[ %T ]"
utc_time_offset = "-5"
time_range = "10:00:00-14:00:00"
```
## Username
@ -1339,7 +1377,7 @@ The order in which custom modules are shown can be individually set by setting `
| ------------- | ------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| `command` | | The command whose output should be printed. |
| `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` | | The path to the shell to use to execute the command. If unset, it will fallback to STARSHIP_SHELL and then to "sh". |
| `shell` | | [See below](#custom-command-shell) |
| `description` | `"<custom module>"` | The description of the module that is shown when running `starship explain`. |
| `files` | `[]` | The files that will be searched in the working directory for a match. |
| `directories` | `[]` | The directories that will be searched in the working directory for a match. |
@ -1350,6 +1388,32 @@ The order in which custom modules are shown can be individually set by setting `
| `suffix` | `""` | Suffix to display immediately after the command output. |
| `disabled` | `false` | Disables this `custom` module. |
#### Custom command shell
`shell` accepts a non-empty list of strings, where:
- The first string is the path to the shell to use to execute the command.
- Other following arguments are passed to the shell.
If unset, it will fallback to STARSHIP_SHELL and then to "sh" on Linux, and "cmd /C" on Windows.
If `shell` is not given or only contains one element and Starship detects PowerShell will be used, the following arguments will automatically be added: `-NoProfile -Command -`. This behavior can be avoided by explicitly passing arguments to the shell, e.g.
```toml
shell = ["pwsh", "-Command", "-"]
```
::: warning Make sure your custom shell configuration exits gracefully
If you set a custom command, make sure that the default Shell used by starship will properly execute the command with a graceful exit (via the `shell` option).
For example, PowerShell requires the `-Command` parameter to execute a one liner. Omitting this parameter might throw starship into a recursive loop where the shell might try to load a full profile environment with starship itself again and hence re-execute the custom command, getting into a never ending loop.
Parameters similar to `-NoProfile` in PowerShell are recommended for other shells as well to avoid extra loading time of a custom profile on every starship invocation.
Automatic detection of shells and proper parameters addition are currently implemented, but it's possible that not all shells are covered. [Please open an issue](https://github.com/starship/starship/issues/new/choose) with shell details and starship configuration if you hit such scenario.
:::
### Example
```toml
@ -1360,6 +1424,12 @@ command = "echo foo" # shows output of command
files = ["foo"] # can specify filters
when = """ test "$HOME" == "$PWD" """
prefix = " transcending "
[custom.time]
command = "time /T"
files = ["*.pst"]
prefix = "transcending "
shell = ["pwsh.exe", "-NoProfile", "-Command", "-"]
```
## PureScript

View file

@ -56,6 +56,9 @@ symbol = " "
[memory_usage]
symbol = " "
[nim]
symbol = " "
[nix_shell]
symbol = " "

View file

@ -113,6 +113,7 @@ prompt_order = [
"haskell",
"java",
"julia",
"nim",
"nodejs",
"ocaml",
"php",
@ -376,9 +377,18 @@ For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, an
| Variable | Default | Description |
| --------------------------- | ------- | ---------------------------------------------------------------------------------------- |
| `substitutions` | | A table of substitutions to be made to the path. |
| `fish_style_pwd_dir_length` | `0` | The number of characters to use when applying fish shell pwd path logic. |
| `use_logical_path` | `true` | Displays the logical path provided by the shell (`PWD`) instead of the path from the OS. |
`substitutions` allows you to define arbitrary replacements for literal strings that occur in the path, for example long network prefixes or development directories (i.e. Java). Note that this will disable the fish style PWD.
```toml
[directory.substitutions]
"/Volumes/network/path" = "/net"
"src/com/long/java/path" = "mypath"
```
`fish_style_pwd_dir_length` interacts with the standard truncation options in a way that can be surprising at first: if it's non-zero, the components of the path that would normally be truncated are instead displayed with that many characters. For example, the path `/built/this/city/on/rock/and/roll`, which would normally be displayed as as `rock/and/roll`, would be displayed as `/b/t/c/o/rock/and/roll` with `fish_style_pwd_dir_length = 1`--the path components that would normally be removed are displayed with a single character. For `fish_style_pwd_dir_length = 2`, it would be `/bu/th/ci/on/rock/and/roll`.
</details>
@ -950,6 +960,32 @@ truncation_length = 4
truncation_symbol = ""
```
## Nim
The `nim` module shows the currently installed version of Nim. The module will be shown if any of the following conditions are met:
- The current directory contains a `nim.cfg` file
- The current directory contains a file with the `.nim` extension
- The current directory contains a file with the `.nims` extension
- The current directory contains a file with the `.nimble` extension
### Options
| Variable | Default | Description |
| ---------- | --------------- | ----------------------------------------------------- |
| `symbol` | `"👑 "` | The symbol used before displaying the version of Nim. |
| `style` | `"bold yellow"` | The style for the module. |
| `disabled` | `false` | Disables the `nim` module. |
### Example
```toml
# ~/.config/starship.toml
[nim]
style = "yellow"
symbol = "🎣 "
```
## Nix-shell
The `nix_shell` module shows the nix-shell environment. The module will be shown when inside a nix-shell environment.
@ -1241,11 +1277,12 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y
| Variable | Default | Description |
| ----------------- | --------------- | ------------------------------------------------------------------------------------------------------------------- |
| `use_12hr` | `false` | Enables 12 hour formatting |
| `use_12hr` | `false` | Enables 12 hour formatting. |
| `format` | see below | The [chrono format string](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) used to format the time. |
| `style` | `"bold yellow"` | The style for the module time |
| `style` | `"bold yellow"` | The style for the module time. |
| `utc_time_offset` | `"local"` | Sets the UTC offset to use. Range from -24 < x < 24. Allows floats to accommodate 30/45 minute timezone offsets. |
| `disabled` | `true` | Disables the `time` module. |
| `time_range` | `"-"` | Sets the time range during which the module will be shown. Times must be specified in 24-hours format |
If `use_12hr` is `true`, then `format` defaults to `"%r"`. Otherwise, it defaults to `"%T"`. Manually setting `format` will override the `use_12hr` setting.
@ -1258,6 +1295,7 @@ If `use_12hr` is `true`, then `format` defaults to `"%r"`. Otherwise, it default
disabled = false
format = "🕙[ %T ]"
utc_time_offset = "-5"
time_range = "10:00:00-14:00:00"
```
## Username
@ -1339,7 +1377,7 @@ The order in which custom modules are shown can be individually set by setting `
| ------------- | ------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| `command` | | The command whose output should be printed. |
| `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` | | The path to the shell to use to execute the command. If unset, it will fallback to STARSHIP_SHELL and then to "sh". |
| `shell` | | [See below](#custom-command-shell) |
| `description` | `"<custom module>"` | The description of the module that is shown when running `starship explain`. |
| `files` | `[]` | The files that will be searched in the working directory for a match. |
| `directories` | `[]` | The directories that will be searched in the working directory for a match. |
@ -1350,6 +1388,32 @@ The order in which custom modules are shown can be individually set by setting `
| `suffix` | `""` | Suffix to display immediately after the command output. |
| `disabled` | `false` | Disables this `custom` module. |
#### Custom command shell
`shell` accepts a non-empty list of strings, where:
- The first string is the path to the shell to use to execute the command.
- Other following arguments are passed to the shell.
If unset, it will fallback to STARSHIP_SHELL and then to "sh" on Linux, and "cmd /C" on Windows.
If `shell` is not given or only contains one element and Starship detects PowerShell will be used, the following arguments will automatically be added: `-NoProfile -Command -`. This behavior can be avoided by explicitly passing arguments to the shell, e.g.
```toml
shell = ["pwsh", "-Command", "-"]
```
::: warning Make sure your custom shell configuration exits gracefully
If you set a custom command, make sure that the default Shell used by starship will properly execute the command with a graceful exit (via the `shell` option).
For example, PowerShell requires the `-Command` parameter to execute a one liner. Omitting this parameter might throw starship into a recursive loop where the shell might try to load a full profile environment with starship itself again and hence re-execute the custom command, getting into a never ending loop.
Parameters similar to `-NoProfile` in PowerShell are recommended for other shells as well to avoid extra loading time of a custom profile on every starship invocation.
Automatic detection of shells and proper parameters addition are currently implemented, but it's possible that not all shells are covered. [Please open an issue](https://github.com/starship/starship/issues/new/choose) with shell details and starship configuration if you hit such scenario.
:::
### Example
```toml
@ -1360,6 +1424,12 @@ command = "echo foo" # shows output of command
files = ["foo"] # can specify filters
when = """ test "$HOME" == "$PWD" """
prefix = " transcending "
[custom.time]
command = "time /T"
files = ["*.pst"]
prefix = "transcending "
shell = ["pwsh.exe", "-NoProfile", "-Command", "-"]
```
## PureScript

View file

@ -56,6 +56,9 @@ symbol = " "
[memory_usage]
symbol = " "
[nim]
symbol = " "
[nix_shell]
symbol = " "

View file

@ -113,6 +113,7 @@ prompt_order = [
"haskell",
"java",
"julia",
"nim",
"nodejs",
"ocaml",
"php",
@ -374,12 +375,21 @@ style = "bold blue"
<details>
<summary>Этот модуль имеет несколько расширенных опций конфигурации, которые контролируют отображение каталога.</summary>
| Переменная | По умолчанию | Описание |
| --------------------------- | ------------ | --------------------------------------------------------------------------------- |
| `fish_style_pwd_dir_length` | `0` | Количество символов, используемых при использовании логики создания пути из fish. |
| `use_logical_path` | `true` | Отображает логический путь от оболочки (`PWD`) вместо пути от ОС. |
| Переменная | По умолчанию | Описание |
| --------------------------- | ------------ | ---------------------------------------------------------------------------------------- |
| `substitutions` | | A table of substitutions to be made to the path. |
| `fish_style_pwd_dir_length` | `0` | The number of characters to use when applying fish shell pwd path logic. |
| `use_logical_path` | `true` | Displays the logical path provided by the shell (`PWD`) instead of the path from the OS. |
`fish_style_pwd_dir_length` взаимодействует со стандартными параметрами усечения, которые могут сначала показаться странными: если он не равен нулю, элементы пути, который обычно усекается, вместо этого отображаются с указанным количеством символов. For example, the path `/built/this/city/on/rock/and/roll`, which would normally be displayed as as `rock/and/roll`, would be displayed as `/b/t/c/o/rock/and/roll` with `fish_style_pwd_dir_length = 1`--the path components that would normally be removed are displayed with a single character. For `fish_style_pwd_dir_length = 2`, it would be `/bu/th/ci/on/rock/and/roll`.
`substitutions` allows you to define arbitrary replacements for literal strings that occur in the path, for example long network prefixes or development directories (i.e. Java). Note that this will disable the fish style PWD.
```toml
[directory.substitutions]
"/Volumes/network/path" = "/net"
"src/com/long/java/path" = "mypath"
```
`fish_style_pwd_dir_length` interacts with the standard truncation options in a way that can be surprising at first: if it's non-zero, the components of the path that would normally be truncated are instead displayed with that many characters. For example, the path `/built/this/city/on/rock/and/roll`, which would normally be displayed as as `rock/and/roll`, would be displayed as `/b/t/c/o/rock/and/roll` with `fish_style_pwd_dir_length = 1`--the path components that would normally be removed are displayed with a single character. For `fish_style_pwd_dir_length = 2`, it would be `/bu/th/ci/on/rock/and/roll`.
</details>
@ -394,7 +404,7 @@ truncation_length = 8
## Контекст Docker
Модуль `docker_context` показывает текущий активный [контекст Docker](https://docs.docker.com/engine/context/working-with-contexts/), если он не установлен как `default`.
The `docker_context` module shows the currently active [Docker context](https://docs.docker.com/engine/context/working-with-contexts/) if it's not set to `default`.
### Опции
@ -416,11 +426,11 @@ symbol = "🐋 "
## Dotnet
Модуль `dotnet` показывает соответствующую версию .NET Core SDK для текущего каталога. Если SDK был закреплен в текущей директории, будет показана закрепленная версия. В противном случае модуль отображает последнюю установленную версию SDK.
The `dotnet` module shows the relevant version of the .NET Core SDK for the current directory. If the SDK has been pinned in the current directory, the pinned version is shown. Otherwise the module shows the latest installed version of the SDK.
Этот модуль будет показан только, когда один из следующих файлов присутствует в текущей директории: `global.json`, `project.json`, `*.sln`, `*.csproj`, `*.fsproj`, `*.xproj`. Также, для правильного использования, нужны инструменты командной строки .NET Core.
This module will only be shown in your prompt when one of the following files are present in the current directory: `global.json`, `project.json`, `*.sln`, `*.csproj`, `*.fsproj`, `*.xproj`. You'll also need the .NET Core command-line tools installed in order to use it correctly.
Внутренне этот модуль использует свой собственный механизм определения версий. Обычно он в два раза быстрее, чем `dotnet --version`, но он может показывать неправильную версию, если ваш .NET проект имеет необычный формат каталога. Если точность важнее, чем скорость, вы можете отключить механизм опцией `heuristic = false` в настройках модуля.
Internally, this module uses its own mechanism for version detection. Typically it is twice as fast as running `dotnet --version`, but it may show an incorrect version if your .NET project has an unusual directory layout. If accuracy is more important than speed, you can disable the mechanism by setting `heuristic = false` in the module options.
### Опции
@ -444,7 +454,7 @@ heuristic = false
## Elixir
Модуль `elixir` показывает установленную версию Elixir и Erlang/OTP. Модуль будет показан, если любое из следующих условий соблюдено:
The `elixir` module shows the currently installed version of Elixir and Erlang/OTP. Модуль будет показан, если любое из следующих условий соблюдено:
- Текущий каталог содержит файл `mix.exs`.
@ -467,7 +477,7 @@ symbol = "🔮 "
## Elm
Модуль `elm` показывает установленную версию Elm. Модуль будет показан, если любое из следующих условий соблюдено:
The `elm` module shows the currently installed version of Elm. Модуль будет показан, если любое из следующих условий соблюдено:
- Текущий каталог содержит файл `elm.json`
- Текущий каталог содержит файл `elm-package.json`
@ -495,7 +505,7 @@ symbol = " "
## Переменная Окружения
Модуль `env_var` отображает текущее значение выбранной переменной окружения. Модуль будет показан только в том случае, если любое из следующих условий соблюдено:
The `env_var` module displays the current value of a selected environment variable. The module will be shown only if any of the following conditions are met:
- Опция `variable` соответствует существующей переменной среды
- Опция `variable` не определена, но определена опция `default`
@ -548,7 +558,7 @@ symbol = "e "
## Ветвь Git
Модуль `git_branch` показывает активную ветку репозитория в вашем текущей директории.
The `git_branch` module shows the active branch of the repo in your current directory.
### Опции
@ -573,7 +583,7 @@ truncation_symbol = ""
## Коммит Git
Модуль `git_commit` показывает хэш текущего коммита репозитория в вашем текущем каталоге.
The `git_commit` module shows the current commit hash of the repo in your current directory.
### Опции
@ -597,7 +607,7 @@ commit_hash_length = 4
## Состояние Git
Модуль `git_state` будет отображаться в директориях, являющимися частью репозитория git, и там, где выполняется операция, такие как: _REBASING_, _BISECTING_, и т. д. Если есть информация о прогрессе (например, REBASING 3/10), эта информация также будет показана.
The `git_state` module will show in directories which are part of a git repository, and where there is an operation in progress, such as: _REBASING_, _BISECTING_, etc. If there is progress information (e.g., REBASING 3/10), that information will be shown too.
### Опции
@ -626,7 +636,7 @@ cherry_pick = "🍒 PICKING"
## Статус Git
Модуль `git_status` отображает символы, представляющие состояние репозитория в вашей текущей директории.
The `git_status` module shows symbols representing the state of the repo in your current directory.
### Опции
@ -685,7 +695,7 @@ deleted = "🗑"
## Golang
Модуль `golang` показывает установленную версию Golang. Модуль будет показан, если любое из следующих условий соблюдено:
The `golang` module shows the currently installed version of Golang. Модуль будет показан, если любое из следующих условий соблюдено:
- Текущий каталог содержит файл `go.mod`
- Текущий каталог содержит файл `go.sum`
@ -714,7 +724,7 @@ symbol = "🏎💨 "
```
## Haskell
Модуль `haskell` показывает установленную версию Haskell Stack. Модуль будет показан, если любое из следующих условий соблюдено:
The `haskell` module shows the currently installed version of Haskell Stack version. Модуль будет показан, если любое из следующих условий соблюдено:
- Текущий каталог содержит файл `stack.yaml`
@ -738,7 +748,7 @@ symbol = " "
## Имя хоста
Модуль `hostname` отображает имя системы (хоста).
The `hostname` module shows the system hostname.
### Опции
@ -766,7 +776,7 @@ disabled = false
## Java
Модуль `java` показывает установленную версию Java. Модуль будет показан, если любое из следующих условий соблюдено:
The `java` module shows the currently installed version of Java. Модуль будет показан, если любое из следующих условий соблюдено:
- The current directory contains a `pom.xml`, `build.gradle.kts`, `build.sbt` or `.java-version` file
- The current directory contains a file with the `.java`, `.class`, `.gradle` or `.jar` extension
@ -790,7 +800,7 @@ symbol = "🌟 "
## Задачи
Модуль `jobs` отображает текущее количество запущенных работ. Модуль будет показан только если работы выполняются в фоне. Модуль покажет количество запущенных задач при наличии более чем 1 задачи, или больше, чем значение конфигурации `threshold`, если оно существует.
The `jobs` module shows the current number of jobs running. The module will be shown only if there are background jobs running. The module will show the number of jobs running if there is more than 1 job, or more than the `threshold` config value, if it exists.
### Опции
@ -837,11 +847,11 @@ symbol = "∴ "
```
## Kubernetes
Отображает текущее контекстное имя Kubernetes и, если применено, пространство имён из файла kubeconfig. Пространство имен дожно быть задано в файле kubeconfig, это делается через `kubectl config set-context starship-cluster --namespace astronaut`. Если переменная окружения `$KUBECONFIG` задана, модуль будет использовать его значение, в противном случае будет использовать `~/.kube/config`.
Displays the current Kubernetes context name and, if set, the namespace from the kubeconfig file. The namespace needs to be set in the kubeconfig file, this can be done via `kubectl config set-context starship-cluster --namespace astronaut`. If the `$KUBECONFIG` env var is set the module will use that if not it will use the `~/.kube/config`.
::: tip
::: tip Подсказка
По умолчанию этот модуль отключен. Чтобы включить его, установите `disabled` на `false` в файле конфигурации.
This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
:::
@ -869,7 +879,7 @@ disabled = false
## Перевод Строки
Модуль `line_break` разделяет командную строку на две строки.
The `line_break` module separates the prompt into two lines.
### Опции
@ -888,13 +898,13 @@ disabled = true
## Использование памяти
Модуль `memory_usage` отображает текущую системную память и использование подкачки.
The `memory_usage` module shows current system memory and swap usage.
По умолчанию использование подкачки отображается, если общая сумма подкачки системы не равна нулю.
By default the swap usage is displayed if the total system swap is non-zero.
::: tip
::: tip Подсказка
По умолчанию этот модуль отключен. Чтобы включить его, установите `disabled` на `false` в файле конфигурации.
This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
:::
@ -927,7 +937,7 @@ style = "bold dimmed green"
## Ветка Mercurial
Модуль `hg_branch` показывает активную ветку репозитория в вашем текущем каталоге.
The `hg_branch` module shows the active branch of the repo in your current directory.
### Опции
@ -950,20 +960,46 @@ truncation_length = 4
truncation_symbol = ""
```
## Nim
The `nim` module shows the currently installed version of Nim. Модуль будет показан, если любое из следующих условий соблюдено:
- The current directory contains a `nim.cfg` file
- The current directory contains a file with the `.nim` extension
- The current directory contains a file with the `.nims` extension
- The current directory contains a file with the `.nimble` extension
### Опции
| Переменная | По умолчанию | Описание |
| ---------- | --------------- | ----------------------------------------------------- |
| `symbol` | `"👑 "` | The symbol used before displaying the version of Nim. |
| `style` | `"bold yellow"` | Стиль модуля. |
| `disabled` | `false` | Disables the `nim` module. |
### Пример
```toml
# ~/.config/starship.toml
[nim]
style = "yellow"
symbol = "🎣 "
```
## Nix-shell
Модуль `nix_shell` показывает окружение nix-shell. Модуль будет показываться внутри среды nix-shell.
The `nix_shell` module shows the nix-shell environment. The module will be shown when inside a nix-shell environment.
### Опции
| Переменная | По умолчанию | Описание |
| ------------ | ------------- | ------------------------------------------------- |
| `use_name` | `false` | Отображать имя nix-shell. |
| `impure_msg` | `"impure"` | Настроить сообщение "impure". |
| `pure_msg` | `"pure"` | Настройте сообщение "pure". |
| `use_name` | `false` | Display the name of the nix-shell. |
| `impure_msg` | `"impure"` | Customize the "impure" msg. |
| `pure_msg` | `"pure"` | Customize the "pure" msg. |
| `symbol` | `"❄️ "` | The symbol used before displaying the shell name. |
| `style` | `"bold blue"` | Стиль модуля. |
| `disabled` | `false` | Отключает модуль `nix_shell`. |
| `disabled` | `false` | Disables the `nix_shell` module. |
### Пример
@ -980,20 +1016,20 @@ symbol = "☃️ "
## NodeJS
Модуль `nodejs` показывает установленную версию NodeJS. Модуль будет показан, если любое из следующих условий соблюдено:
The `nodejs` module shows the currently installed version of NodeJS. Модуль будет показан, если любое из следующих условий соблюдено:
- Текущий каталог содержит файл `package.json`
- The current directory contains a `package.json` file
- The current directory contains a `.node-version` file
- Текущий каталог содержит каталог `node_modules`
- Текущий каталог содержит файл с расширением `.js`
- The current directory contains a `node_modules` directory
- The current directory contains a file with the `.js` extension
### Опции
| Переменная | По умолчанию | Описание |
| ---------- | -------------- | ------------------------------------------------------ |
| `symbol` | `"⬢ "` | Символ, используемый перед отображением версии NodeJS. |
| `style` | `"bold green"` | Стиль модуля. |
| `disabled` | `false` | Отключает модуль `nodejs`. |
| Переменная | По умолчанию | Описание |
| ---------- | -------------- | -------------------------------------------------------- |
| `symbol` | `"⬢ "` | The symbol used before displaying the version of NodeJS. |
| `style` | `"bold green"` | Стиль модуля. |
| `disabled` | `false` | Disables the `nodejs` module. |
### Пример
@ -1004,15 +1040,15 @@ symbol = "☃️ "
symbol = "🤖 "
```
## Версия пакета
## Package Version
Модуль `package` отображается, когда текущий каталог является репозиторием для пакета и показывает его текущую версию. The module currently supports `npm`, `cargo`, `poetry`, `composer`, `gradle`, `julia` and `mix` packages.
The `package` module is shown when the current directory is the repository for a package, and shows its current version. The module currently supports `npm`, `cargo`, `poetry`, `composer`, `gradle`, `julia` and `mix` packages.
- **npm** Версия пакета `npm` из файла `package.json` в текущем каталоге
- **cargo** Версия пакета `cargo` из файла `Cargo.toml` в текущем каталоге
- **poetry** Версия пакета `poetry` из файла `pyproject.toml` в текущем каталоге
- **composer** Версия пакета `composer` из `composer.json` в текущем каталоге
- **gradle** Версия пакета `gradle` извлечена из `build.gradle`
- **npm** The `npm` package version is extracted from the `package.json` present in the current directory
- **cargo** The `cargo` package version is extracted from the `Cargo.toml` present in the current directory
- **poetry** The `poetry` package version is extracted from the `pyproject.toml` present in the current directory
- **composer** The `composer` package version is extracted from the `composer.json` present in the current directory
- **gradle** The `gradle` package version is extracted from the `build.gradle` present
- **julia** - The package version is extracted from the `Project.toml` present
- **mix** - The `mix` package version is extracted from the `mix.exs` present
@ -1020,12 +1056,12 @@ symbol = "🤖 "
### Опции
| Переменная | По умолчанию | Описание |
| ----------------- | ------------ | --------------------------------------------------------- |
| `symbol` | `"📦 "` | Символ, используемый перед отображением версии пакета. |
| `style` | `"bold 208"` | Стиль модуля. |
| `display_private` | `false` | Enable displaying version for packages marked as private. |
| `disabled` | `false` | Отключает модуль `package`. |
| Переменная | По умолчанию | Описание |
| ----------------- | ------------ | ---------------------------------------------------------- |
| `symbol` | `"📦 "` | The symbol used before displaying the version the package. |
| `style` | `"bold 208"` | Стиль модуля. |
| `display_private` | `false` | Enable displaying version for packages marked as private. |
| `disabled` | `false` | Disables the `package` module. |
### Пример
@ -1066,19 +1102,19 @@ symbol = "🐪 "
## PHP
Модуль `php` показывает установленную версию PHP. Модуль будет показан, если любое из следующих условий соблюдено:
The `php` module shows the currently installed version of PHP. Модуль будет показан, если любое из следующих условий соблюдено:
- Текущий каталог содержит файл `composer.json`
- Текущий каталог содержит файл `.php-version`
- Текущий каталог содержит файл `.php`
- The current directory contains a `composer.json` file
- The current directory contains a `.php-version` file
- The current directory contains a `.php` file
### Опции
| Переменная | По умолчанию | Описание |
| ---------- | ------------ | --------------------------------------------------- |
| `symbol` | `"🐘 "` | Символ, используемый перед отображением версии PHP. |
| `style` | `"bold 147"` | Стиль модуля. |
| `disabled` | `false` | Отключает модуль `php`. |
| Переменная | По умолчанию | Описание |
| ---------- | ------------ | ----------------------------------------------------- |
| `symbol` | `"🐘 "` | The symbol used before displaying the version of PHP. |
| `style` | `"bold 147"` | Стиль модуля. |
| `disabled` | `false` | Disables the `php` module. |
### Пример
@ -1097,26 +1133,26 @@ If `pyenv_version_name` is set to `true`, it will display the pyenv version name
Модуль будет показан, если любое из следующих условий соблюдено:
- Текущий каталог содержит файл `.python-version`
- Текущий каталог содержит файл `requirements.txt`
- Текущий каталог содержит файл `pyproject.toml`
- The current directory contains a `.python-version` file
- The current directory contains a `requirements.txt` file
- The current directory contains a `pyproject.toml` file
- The current directory contains a file with the `.py` extension (and `scan_for_pyfiles` is true)
- Текущий каталог содержит файл `Pipfile`
- Текущий каталог содержит файл `tox.ini`
- Текущий каталог содержит файл `setup.py`
- The current directory contains a `Pipfile` file
- The current directory contains a `tox.ini` file
- The current directory contains a `setup.py` file
- The current directory contains a `__init__.py` file
- Виртуальная среда в данный момент активирована
- A virtual environment is currently activated
### Опции
| Переменная | По умолчанию | Описание |
| -------------------- | --------------- | ------------------------------------------------------------------------------------- |
| `symbol` | `"🐍 "` | Символ перед отображением текущей версии Python. |
| `pyenv_version_name` | `false` | Использовать pyenv для получения версии Python |
| `pyenv_prefix` | `"pyenv "` | Префикс перед отображением версии pyenv (отображение по умолчанию `pyenv MY_VERSION`) |
| `scan_for_pyfiles` | `true` | If false, Python files in the current directory will not show this module. |
| `style` | `"bold yellow"` | Стиль модуля. |
| `disabled` | `false` | Disables the `python` module. |
| Переменная | По умолчанию | Описание |
| -------------------- | --------------- | --------------------------------------------------------------------------- |
| `symbol` | `"🐍 "` | The symbol used before displaying the version of Python. |
| `pyenv_version_name` | `false` | Use pyenv to get Python version |
| `pyenv_prefix` | `"pyenv "` | Prefix before pyenv version display (default display is `pyenv MY_VERSION`) |
| `scan_for_pyfiles` | `true` | If false, Python files in the current directory will not show this module. |
| `style` | `"bold yellow"` | Стиль модуля. |
| `disabled` | `false` | Disables the `python` module. |
### Пример
@ -1131,19 +1167,19 @@ pyenv_prefix = "foo "
## Ruby
Модуль `ruby` показывает установленную версию Ruby. Модуль будет показан, если любое из следующих условий соблюдено:
The `ruby` module shows the currently installed version of Ruby. Модуль будет показан, если любое из следующих условий соблюдено:
- Текущий каталог содержит файл `Gemfile`
- Текущий каталог содержит файл `.ruby-version`
- Текущий каталог содержит файл `.rb`
- The current directory contains a `Gemfile` file
- The current directory contains a `.ruby-version` file
- The current directory contains a `.rb` file
### Опции
| Переменная | По умолчанию | Описание |
| ---------- | ------------ | ---------------------------------------------------- |
| `symbol` | `"💎 "` | Символ, используемый перед отображением версии Ruby. |
| `style` | `"bold red"` | Стиль модуля. |
| `disabled` | `false` | Отключает модуль `ruby`. |
| Переменная | По умолчанию | Описание |
| ---------- | ------------ | ------------------------------------------------------ |
| `symbol` | `"💎 "` | The symbol used before displaying the version of Ruby. |
| `style` | `"bold red"` | Стиль модуля. |
| `disabled` | `false` | Disables the `ruby` module. |
### Пример
@ -1156,18 +1192,18 @@ symbol = "🔺 "
## Rust
Модуль `rust` показывает установленную версию Rust. Модуль будет показан, если любое из следующих условий соблюдено:
The `rust` module shows the currently installed version of Rust. Модуль будет показан, если любое из следующих условий соблюдено:
- Текущий каталог содержит файл `Cargo.toml`
- Текущий каталог содержит файл с расширением `.rs`
- The current directory contains a `Cargo.toml` file
- The current directory contains a file with the `.rs` extension
### Опции
| Переменная | По умолчанию | Описание |
| ---------- | ------------ | ---------------------------------------------------- |
| `symbol` | `"🦀 "` | Символ, используемый перед отображением версии Rust. |
| `style` | `"bold red"` | Стиль модуля. |
| `disabled` | `false` | Отключает модуль `rust`. |
| Переменная | По умолчанию | Описание |
| ---------- | ------------ | ------------------------------------------------------ |
| `symbol` | `"🦀 "` | The symbol used before displaying the version of Rust. |
| `style` | `"bold red"` | Стиль модуля. |
| `disabled` | `false` | Disables the `rust` module. |
### Пример
@ -1180,18 +1216,18 @@ symbol = "⚙️ "
## Singularity
Модуль `singularity` показывает текущий образ singularity, если внутри контейнера и `$SINGULARITY_NAME` установлена.
The `singularity` module shows the current singularity image, if inside a container and `$SINGULARITY_NAME` is set.
### Опции
| Переменная | По умолчанию | Описание |
| ---------- | -------------------- | -------------------------------------------------- |
| `label` | `""` | Префикс перед отображением имени образа. |
| `prefix` | `"["` | Префикс для отображения сразу перед именем образа. |
| `suffix` | `"]"` | Суффикс, отображаемый сразу после имени образа. |
| `symbol` | `""` | Символ, используемый перед именем образа. |
| `style` | `"bold dimmed blue"` | Стиль модуля. |
| `disabled` | `false` | Disables the `singularity` module. |
| Переменная | По умолчанию | Описание |
| ---------- | -------------------- | ------------------------------------------------ |
| `label` | `""` | Prefix before the image name display. |
| `prefix` | `"["` | Prefix to display immediately before image name. |
| `suffix` | `"]"` | Suffix to display immediately after image name. |
| `symbol` | `""` | The symbol used before the image name. |
| `style` | `"bold dimmed blue"` | Стиль модуля. |
| `disabled` | `false` | Disables the `singularity` module. |
### Пример
@ -1204,19 +1240,19 @@ symbol = "📦 "
## Terraform
Модуль `terraform` показывает выбранную рабочую область и версию terraform. По умолчанию, версия terraform не показана, так как это медленно на текущих версиях terraform, при использовании большого количества плагинов. Модуль будет показан, если любое из следующих условий соблюдено:
The `terraform` module shows the currently selected terraform workspace and version. By default the terraform version is not shown, since this is slow on current versions of terraform when a lot of plugins are in use. Модуль будет показан, если любое из следующих условий соблюдено:
- Текущий каталог содержит папку `.terraform`
- Текущий каталог содержит файл с расширением `.tf`
- The current directory contains a `.terraform` folder
- Current directory contains a file with the `.tf` extension
### Опции
| Переменная | По умолчанию | Описание |
| -------------- | ------------ | --------------------------------------------------------------------------- |
| `symbol` | `"💠 "` | Символ, используемый перед отображением рабочего пространства terraform. |
| `show_version` | `false` | Показать версию terraform. Очень медленно на больших рабочих пространствах. |
| `style` | `"bold 105"` | Стиль модуля. |
| `disabled` | `false` | Отключает модуль `terraform`. |
| Переменная | По умолчанию | Описание |
| -------------- | ------------ | ----------------------------------------------------------- |
| `symbol` | `"💠 "` | The symbol used before displaying the terraform workspace. |
| `show_version` | `false` | Shows the terraform version. Very slow on large workspaces. |
| `style` | `"bold 105"` | Стиль модуля. |
| `disabled` | `false` | Disables the `terraform` module. |
### Пример
@ -1227,27 +1263,28 @@ symbol = "📦 "
symbol = "🏎💨 "
```
## Время
## Time
Модуль `time` показывает текущее **локальное** время. Значение конфигурации `format` используется пакетом [`chrono`](https://crates.io/crates/chrono) для контроля того, как отображается время. Ознакомьтесь с [документацией chrono strftime](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html), чтобы увидеть доступные параметры.
The `time` module shows the current **local** time. The `format` configuration value is used by the [`chrono`](https://crates.io/crates/chrono) crate to control how the time is displayed. Take a look [at the chrono strftime docs](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) to see what options are available.
::: tip
::: tip Подсказка
По умолчанию этот модуль отключен. Чтобы включить его, установите `disabled` на `false` в файле конфигурации.
This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
:::
### Опции
| Переменная | По умолчанию | Описание |
| ----------------- | --------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `use_12hr` | `false` | Включить 12-часовое форматирование |
| `format` | см. ниже | [Строка формата chrono](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html), используемая для форматирования времени. |
| `style` | `"bold yellow"` | Стиль модуля времени |
| `utc_time_offset` | `"local"` | Устанавливает смещение UTC. Диапазон -24 < x < 24. Разрешает числам с плавающей точкой встраивать 30/45-минутное смещение временной зоны. |
| `disabled` | `true` | Отключает модуль `time`. |
| Переменная | По умолчанию | Описание |
| ----------------- | --------------- | ------------------------------------------------------------------------------------------------------------------- |
| `use_12hr` | `false` | Enables 12 hour formatting. |
| `format` | see below | The [chrono format string](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) used to format the time. |
| `style` | `"bold yellow"` | The style for the module time. |
| `utc_time_offset` | `"local"` | Sets the UTC offset to use. Range from -24 < x < 24. Allows floats to accommodate 30/45 minute timezone offsets. |
| `disabled` | `true` | Disables the `time` module. |
| `time_range` | `"-"` | Sets the time range during which the module will be shown. Times must be specified in 24-hours format |
Если `use_12hr` равно `true`, то `format` по умолчанию равно `"%r"`. Иначе по умолчанию используется `"%T"`. Установка `format` вручную переопределит параметр `use_12hr`.
If `use_12hr` is `true`, then `format` defaults to `"%r"`. Otherwise, it defaults to `"%T"`. Manually setting `format` will override the `use_12hr` setting.
### Пример
@ -1258,25 +1295,26 @@ symbol = "🏎💨 "
disabled = false
format = "🕙[ %T ]"
utc_time_offset = "-5"
time_range = "10:00:00-14:00:00"
```
## Имя пользователя
## Username
Модуль `username` показывает имя текущего пользователя. Модуль будет показан, если любое из следующих условий соблюдено:
The `username` module shows active user's username. Модуль будет показан, если любое из следующих условий соблюдено:
- Текущий пользователь - root
- Текущий пользователь отличается от залогиненного
- Пользователь подключен к SSH-сессии
- Переменная `show_always` равна true
- The current user is root
- The current user isn't the same as the one that is logged in
- The user is currently connected as an SSH session
- The variable `show_always` is set to true
### Опции
| Переменная | По умолчанию | Описание |
| ------------- | --------------- | ------------------------------------------------------- |
| `style_root` | `"bold red"` | Стиль, используемый для пользователя root. |
| `style_user` | `"bold yellow"` | Стиль, используемый для всех пользователей, кроме root. |
| `show_always` | `false` | Всегда показывать модуль `username`. |
| `disabled` | `false` | Отключает модуль `username`. |
| Переменная | По умолчанию | Описание |
| ------------- | --------------- | ------------------------------------- |
| `style_root` | `"bold red"` | The style used when the user is root. |
| `style_user` | `"bold yellow"` | The style used for non-root users. |
| `show_always` | `false` | Always shows the `username` module. |
| `disabled` | `false` | Disables the `username` module. |
### Пример
@ -1321,13 +1359,13 @@ These modules will be shown if any of the following conditions are met:
- The current directory contains a file whose extension is in `extensions`
- The `when` command returns 0
::: tip
::: tip Подсказка
Multiple custom modules can be defined by using a `.`.
:::
::: tip
::: tip Подсказка
The order in which custom modules are shown can be individually set by setting `custom.foo` in `prompt_order`. By default, the `custom` module will simply show all custom modules in the order they were defined.
@ -1339,8 +1377,8 @@ The order in which custom modules are shown can be individually set by setting `
| ------------- | ------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| `command` | | The command whose output should be printed. |
| `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` | | The path to the shell to use to execute the command. If unset, it will fallback to STARSHIP_SHELL and then to "sh". |
| `описание` | `"<custom module>"` | The description of the module that is shown when running `starship explain`. |
| `shell` | | [See below](#custom-command-shell) |
| `description` | `"<custom module>"` | The description of the module that is shown when running `starship explain`. |
| `files` | `[]` | The files that will be searched in the working directory for a match. |
| `directories` | `[]` | The directories that will be searched in the working directory for a match. |
| `extensions` | `[]` | The extensions that will be searched in the working directory for a match. |
@ -1350,6 +1388,32 @@ The order in which custom modules are shown can be individually set by setting `
| `suffix` | `""` | Suffix to display immediately after the command output. |
| `disabled` | `false` | Disables this `custom` module. |
#### Custom command shell
`shell` accepts a non-empty list of strings, where:
- The first string is the path to the shell to use to execute the command.
- Other following arguments are passed to the shell.
If unset, it will fallback to STARSHIP_SHELL and then to "sh" on Linux, and "cmd /C" on Windows.
If `shell` is not given or only contains one element and Starship detects PowerShell will be used, the following arguments will automatically be added: `-NoProfile -Command -`. This behavior can be avoided by explicitly passing arguments to the shell, e.g.
```toml
shell = ["pwsh", "-Command", "-"]
```
::: warning Make sure your custom shell configuration exits gracefully
If you set a custom command, make sure that the default Shell used by starship will properly execute the command with a graceful exit (via the `shell` option).
For example, PowerShell requires the `-Command` parameter to execute a one liner. Omitting this parameter might throw starship into a recursive loop where the shell might try to load a full profile environment with starship itself again and hence re-execute the custom command, getting into a never ending loop.
Parameters similar to `-NoProfile` in PowerShell are recommended for other shells as well to avoid extra loading time of a custom profile on every starship invocation.
Automatic detection of shells and proper parameters addition are currently implemented, but it's possible that not all shells are covered. [Please open an issue](https://github.com/starship/starship/issues/new/choose) with shell details and starship configuration if you hit such scenario.
:::
### Пример
```toml
@ -1360,6 +1424,12 @@ command = "echo foo" # shows output of command
files = ["foo"] # can specify filters
when = """ test "$HOME" == "$PWD" """
prefix = " transcending "
[custom.time]
command = "time /T"
files = ["*.pst"]
prefix = "transcending "
shell = ["pwsh.exe", "-NoProfile", "-Command", "-"]
```
## PureScript

View file

@ -56,6 +56,9 @@ symbol = " "
[memory_usage]
symbol = " "
[nim]
symbol = " "
[nix_shell]
symbol = " "

View file

@ -113,6 +113,7 @@ prompt_order = [
"haskell",
"java",
"julia",
"nim",
"nodejs",
"ocaml",
"php",
@ -374,10 +375,19 @@ style = "bold blue"
<details>
<summary>此组件有几个高级配置选项来控制当前目录路径的显示方式。</summary>
| 字段 | 默认值 | 描述 |
| --------------------------- | ------ | ------------------------------------- |
| `fish_style_pwd_dir_length` | `0` | 使用 fish shell 当前目录路径逻辑时每个省略目录名使用的字符数。 |
| `use_logical_path` | `true` | 显示由 shell 提供的逻辑路径(`PWD`)而不是 OS 提供的路径。 |
| 字段 | 默认值 | 描述 |
| --------------------------- | ------ | ---------------------------------------------------------------------------------------- |
| `substitutions` | | A table of substitutions to be made to the path. |
| `fish_style_pwd_dir_length` | `0` | The number of characters to use when applying fish shell pwd path logic. |
| `use_logical_path` | `true` | Displays the logical path provided by the shell (`PWD`) instead of the path from the OS. |
`substitutions` allows you to define arbitrary replacements for literal strings that occur in the path, for example long network prefixes or development directories (i.e. Java). Note that this will disable the fish style PWD.
```toml
[directory.substitutions]
"/Volumes/network/path" = "/net"
"src/com/long/java/path" = "mypath"
```
`fish_style_pwd_dir_length` interacts with the standard truncation options in a way that can be surprising at first: if it's non-zero, the components of the path that would normally be truncated are instead displayed with that many characters. For example, the path `/built/this/city/on/rock/and/roll`, which would normally be displayed as as `rock/and/roll`, would be displayed as `/b/t/c/o/rock/and/roll` with `fish_style_pwd_dir_length = 1`--the path components that would normally be removed are displayed with a single character. For `fish_style_pwd_dir_length = 2`, it would be `/bu/th/ci/on/rock/and/roll`.
@ -416,11 +426,11 @@ symbol = "🐋 "
## Dotnet
`dotnet` 模块显示与当前目录下使用的 .NET Core SDK 相关联的版本。 如果当前目录已被绑定了一个版本的 SDK则显示被帮定的版本。 否则此组件将显示最新安装的 SDK 版本。
The `dotnet` module shows the relevant version of the .NET Core SDK for the current directory. If the SDK has been pinned in the current directory, the pinned version is shown. Otherwise the module shows the latest installed version of the SDK.
此组件只会在以下文件之一出现在当前目录中时显示:`global.json``project.json``*.sln``*.csproj``*.fsproj``*.xproj`。 为了正确使用此组件,您还需要安装 .NET Core 命令行工具。
This module will only be shown in your prompt when one of the following files are present in the current directory: `global.json`, `project.json`, `*.sln`, `*.csproj`, `*.fsproj`, `*.xproj`. You'll also need the .NET Core command-line tools installed in order to use it correctly.
在内部,此组件使用自己的版本检测机制。 一般来说此组件是直接执行 `dotnet --version` 的两倍快,但当你的 .NET 项目使用了不常见的目录布局时此组件可能显示一个错误的版本。 如果相比于速度您更需要正确的版本号,您可以在组件设置中设置 `heuristic = false` 来禁用该机制。
Internally, this module uses its own mechanism for version detection. Typically it is twice as fast as running `dotnet --version`, but it may show an incorrect version if your .NET project has an unusual directory layout. If accuracy is more important than speed, you can disable the mechanism by setting `heuristic = false` in the module options.
### 配置项
@ -444,7 +454,7 @@ heuristic = false
## Elixir
The `elixir` module shows the currently installed version of Elixir and Erlang/OTP. 此组件将在符合以下任意条件时显示:
The `elixir` module shows the currently installed version of Elixir and Erlang/OTP. 此组件将在符合以下任意条件之一时显示:
- 当前目录包含一个 `mix.exs` 文件.
@ -495,7 +505,7 @@ symbol = " "
## Environment Variable
`env_var` 组件显示选定的环境变量的当前值。 此组件只有满足以下条件之一时才会被显示:
The `env_var` module displays the current value of a selected environment variable. The module will be shown only if any of the following conditions are met:
- 设置的 `variable` 是一个已存在的环境变量
- 未定义 `variable`,但定义了 `default`
@ -548,7 +558,7 @@ symbol = "e "
## Git Branch
`git_branch` 组件显示当前目录的 git 仓库的活动分支。
The `git_branch` module shows the active branch of the repo in your current directory.
### 配置项
@ -573,7 +583,7 @@ truncation_symbol = ""
## Git Commit
`git_commit` 组件显示当前目录的 git 仓库的当前提交的哈希值。
The `git_commit` module shows the current commit hash of the repo in your current directory.
### 配置项
@ -597,7 +607,7 @@ commit_hash_length = 4
## Git State
`git_state` 组件会显示当前目录在哪个 git 仓库中以及正在进行的操作例如_REBASING__BISECTING_ 等。 进度信息(例如 REBASING 3/10如果存在则也会被显示。
The `git_state` module will show in directories which are part of a git repository, and where there is an operation in progress, such as: _REBASING_, _BISECTING_, etc. If there is progress information (e.g., REBASING 3/10), that information will be shown too.
### 配置项
@ -626,7 +636,7 @@ cherry_pick = "🍒 PICKING"
## Git Status
`git_status`组件通过相应的符号显示您当前目录中 git 仓库的状态。
The `git_status` module shows symbols representing the state of the repo in your current directory.
### 配置项
@ -685,7 +695,7 @@ deleted = "🗑"
## Golang
`golang` 组件显示当前安装的 Golang 版本。 此组件将在符合以下任意条件之一时显示:
The `golang` module shows the currently installed version of Golang. 此组件将在符合以下任意条件之一时显示:
- 当前目录包含 `go.mod` 文件
- 当前目录包含 `go.sum` 文件
@ -714,7 +724,7 @@ symbol = "🏎💨 "
```
## Haskell
`haskell` 组件显示当前安装的 Haskell Stack 版本。 此组件将在符合以下任意条件之一时显示:
The `haskell` module shows the currently installed version of Haskell Stack version. 此组件将在符合以下任意条件之一时显示:
- 当前目录包含 `stack.yaml` 文件
@ -738,7 +748,7 @@ symbol = " "
## Hostname
`hostname` 组件显示系统主机名。
The `hostname` module shows the system hostname.
### 配置项
@ -766,7 +776,7 @@ disabled = false
## Java
`java` 组件显示当前安装的 Java 版本。 此组件将在符合以下任意条件之一时显示:
The `java` module shows the currently installed version of Java. 此组件将在符合以下任意条件之一时显示:
- The current directory contains a `pom.xml`, `build.gradle.kts`, `build.sbt` or `.java-version` file
- 当前目录包含一个扩展名为 `.java``.class``.gradle` 或 `.jar` 的文件
@ -790,7 +800,7 @@ symbol = "🌟 "
## Jobs
`jobs` 组件显示当前正在运行的任务数量。 仅当有后台任务运行时,此组件才会显示。 如果有超过 1 个作业,模块将显示正在运行的作业数量,如果配置了 `threshold` 字段,则使用它作为显示作业数量的下限。
The `jobs` module shows the current number of jobs running. The module will be shown only if there are background jobs running. The module will show the number of jobs running if there is more than 1 job, or more than the `threshold` config value, if it exists.
### 配置项
@ -837,11 +847,11 @@ symbol = "∴ "
```
## Kubernetes
显示当前的 Kubernetes 上下文名以及,如果有相关设置,则显示来自 kubeconig 文件的命名空间。 命名空间需要在 kubeconfig 文件中设置,这可以通过 `kubectl config set-context starship-cluster --namespace astronaut` 完成。 如果设置了环境变量 `$KUBECONFIG`,此组件将使用该值,否则会使用 `~/.kube/config`
Displays the current Kubernetes context name and, if set, the namespace from the kubeconfig file. The namespace needs to be set in the kubeconfig file, this can be done via `kubectl config set-context starship-cluster --namespace astronaut`. If the `$KUBECONFIG` env var is set the module will use that if not it will use the `~/.kube/config`.
::: tip
此组件默认被禁用。 若要启用此组件,请在配置文件中设置 `disable` 字段为 `false`
This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
:::
@ -869,7 +879,7 @@ disabled = false
## Line Break
`line_break` 组件将提示分隔为两行。
The `line_break` module separates the prompt into two lines.
### 配置项
@ -888,13 +898,13 @@ disabled = true
## Memory Usage
`memory_usage` 组件显示当前系统内存和交换区使用情况。
The `memory_usage` module shows current system memory and swap usage.
默认情况下,如果系统交换区使用不为 0则会显示交换区使用情况。
By default the swap usage is displayed if the total system swap is non-zero.
::: tip
此组件默认被禁用。 若要启用此组件,请在配置文件中设置 `disable` 字段为 `false`
This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
:::
@ -927,7 +937,7 @@ style = "bold dimmed green"
## Mercurial Branch
`hg_branch` 组件显示当前目录的 hg 仓库的活动分支。
The `hg_branch` module shows the active branch of the repo in your current directory.
### 配置项
@ -950,20 +960,46 @@ truncation_length = 4
truncation_symbol = ""
```
## Nim
The `nim` module shows the currently installed version of Nim. 此组件将在符合以下任意条件之一时显示:
- The current directory contains a `nim.cfg` file
- The current directory contains a file with the `.nim` extension
- The current directory contains a file with the `.nims` extension
- The current directory contains a file with the `.nimble` extension
### 配置项
| 字段 | 默认值 | 描述 |
| ---------- | --------------- | ----------------------------------------------------- |
| `symbol` | `"👑 "` | The symbol used before displaying the version of Nim. |
| `style` | `"bold yellow"` | 此组件的样式。 |
| `disabled` | `false` | Disables the `nim` module. |
### 示例
```toml
# ~/.config/starship.toml
[nim]
style = "yellow"
symbol = "🎣 "
```
## Nix-shell
`nix_shell` 组件显示 nix-shell 环境。 当处于一个 nix-shell 环境中时,此组件会被显示。
The `nix_shell` module shows the nix-shell environment. The module will be shown when inside a nix-shell environment.
### 配置项
| 字段 | 默认值 | 描述 |
| ------------ | ------------- | ------------------------------------------------- |
| `use_name` | `false` | 显示 nix-shell 的名称。 |
| `impure_msg` | `"impure"` | 自定义“impure”消息。 |
| `pure_msg` | `"pure"` | 自定义“pure”消息。 |
| `use_name` | `false` | Display the name of the nix-shell. |
| `impure_msg` | `"impure"` | Customize the "impure" msg. |
| `pure_msg` | `"pure"` | Customize the "pure" msg. |
| `symbol` | `"❄️ "` | The symbol used before displaying the shell name. |
| `style` | `"bold blue"` | 此组件的样式。 |
| `disabled` | `false` | 禁用 `nix_shell` 组件。 |
| `disabled` | `false` | Disables the `nix_shell` module. |
### 示例
@ -980,20 +1016,20 @@ symbol = "☃️ "
## NodeJS
`nodejs` 组件显示当前安装的 NodeJS 版本。 此组件将在符合以下任意条件之一时显示:
The `nodejs` module shows the currently installed version of NodeJS. 此组件将在符合以下任意条件之一时显示:
- 当前目录包含 `package.json` 文件
- The current directory contains a `package.json` file
- The current directory contains a `.node-version` file
- 当前目录包含 `node_modules` 目录
- 当前目录包含一个使用 `.js` 扩展名的文件
- The current directory contains a `node_modules` directory
- The current directory contains a file with the `.js` extension
### 配置项
| 字段 | 默认值 | 描述 |
| ---------- | -------------- | -------------------------- |
| `symbol` | `"⬢ "` | 这个字段的内容会显示在当前 NodeJS 版本之前。 |
| `style` | `"bold green"` | 此组件的样式。 |
| `disabled` | `false` | 禁用 `nodejs` 组件。 |
| 字段 | 默认值 | 描述 |
| ---------- | -------------- | -------------------------------------------------------- |
| `symbol` | `"⬢ "` | The symbol used before displaying the version of NodeJS. |
| `style` | `"bold green"` | 此组件的样式。 |
| `disabled` | `false` | Disables the `nodejs` module. |
### 示例
@ -1006,12 +1042,12 @@ symbol = "🤖 "
## Package Version
当前目录是软件包的代码仓库时,将显示 `package` 组件,并显示软件包当前版本。 The module currently supports `npm`, `cargo`, `poetry`, `composer`, `gradle`, `julia` and `mix` packages.
The `package` module is shown when the current directory is the repository for a package, and shows its current version. The module currently supports `npm`, `cargo`, `poetry`, `composer`, `gradle`, `julia` and `mix` packages.
- **npm** —— `npm` 软件包版本从当前目录下的 `package.json` 中得到
- **cargo** —— `cargo` 软件包的版本从当前目录下的 `Cargo.toml` 中得到
- **poetry** —— `poetry` 软件包版本从当前目录下的 `pyproject.toml` 中得到
- **composer** —— `composer` 软件包版本从当前目录下的 `composer.json` 中得到
- **npm** The `npm` package version is extracted from the `package.json` present in the current directory
- **cargo** The `cargo` package version is extracted from the `Cargo.toml` present in the current directory
- **poetry** The `poetry` package version is extracted from the `pyproject.toml` present in the current directory
- **composer** The `composer` package version is extracted from the `composer.json` present in the current directory
- **gradle** The `gradle` package version is extracted from the `build.gradle` present
- **julia** - The package version is extracted from the `Project.toml` present
- **mix** - The `mix` package version is extracted from the `mix.exs` present
@ -1020,12 +1056,12 @@ symbol = "🤖 "
### 配置项
| 字段 | 默认值 | 描述 |
| ----------------- | ------------ | --------------------------------------------------------- |
| `symbol` | `"📦 "` | 这个字段的内容会显示在当前软件包版本之前。 |
| `style` | `"bold 208"` | 此组件的样式。 |
| `display_private` | `false` | Enable displaying version for packages marked as private. |
| `disabled` | `false` | 禁用 `package` 组件。 |
| 字段 | 默认值 | 描述 |
| ----------------- | ------------ | ---------------------------------------------------------- |
| `symbol` | `"📦 "` | The symbol used before displaying the version the package. |
| `style` | `"bold 208"` | 此组件的样式。 |
| `display_private` | `false` | Enable displaying version for packages marked as private. |
| `disabled` | `false` | Disables the `package` module. |
### 示例
@ -1066,19 +1102,19 @@ symbol = "🐪 "
## PHP
`php` 组件显示当前安装的 PHP 版本。 此组件将在符合以下任意条件时显示:
The `php` module shows the currently installed version of PHP. 此组件将在符合以下任意条件之一时显示:
- 当前目录包含一个 `composer.json` 文件
- The current directory contains a `composer.json` file
- The current directory contains a `.php-version` file
- 当前目录包含一个 `.php` 文件
- The current directory contains a `.php` file
### 配置项
| 字段 | 默认值 | 描述 |
| ---------- | ------------ | ----------------------- |
| `symbol` | `"🐘 "` | 这个字段的内容会显示在当前 PHP 版本之前。 |
| `style` | `"bold 147"` | 此组件的样式。 |
| `disabled` | `false` | 禁用 `php` 组件。 |
| 字段 | 默认值 | 描述 |
| ---------- | ------------ | ----------------------------------------------------- |
| `symbol` | `"🐘 "` | The symbol used before displaying the version of PHP. |
| `style` | `"bold 147"` | 此组件的样式。 |
| `disabled` | `false` | Disables the `php` module. |
### 示例
@ -1097,26 +1133,26 @@ If `pyenv_version_name` is set to `true`, it will display the pyenv version name
此组件将在符合以下任意条件之一时显示:
- 当前目录包含 `.python-version` 文件
- 当前目录包含 `requirements.txt` 文件
- 当前目录包含 `pyproject.toml` 文件
- The current directory contains a `.python-version` file
- The current directory contains a `requirements.txt` file
- The current directory contains a `pyproject.toml` file
- The current directory contains a file with the `.py` extension (and `scan_for_pyfiles` is true)
- 当前目录包含 `Pipfile` 文件
- 当前目录包含一个 `tox.ini` 文件
- 当前目录包含一个 `setup.py` 文件
- The current directory contains a `Pipfile` file
- The current directory contains a `tox.ini` file
- The current directory contains a `setup.py` file
- The current directory contains a `__init__.py` file
- 当前处于一个活跃的 python 虚拟环境中
- A virtual environment is currently activated
### 配置项
| 字段 | 默认值 | 描述 |
| -------------------- | --------------- | -------------------------------------------------------------------------- |
| `symbol` | `"🐍 "` | 这个字段的内容会显示在当前 Python 版本之前。 |
| `pyenv_version_name` | `false` | 使用 pyenv 获取 Python 版本 |
| `pyenv_prefix` | `"pyenv "` | 在 pyenv 版本前显示的前缀(默认显示 `pyenv MY_VERSION` |
| `scan_for_pyfiles` | `true` | If false, Python files in the current directory will not show this module. |
| `style` | `"bold yellow"` | 此组件的样式。 |
| `disabled` | `false` | 禁用 `python` 组件。 |
| 字段 | 默认值 | 描述 |
| -------------------- | --------------- | --------------------------------------------------------------------------- |
| `symbol` | `"🐍 "` | The symbol used before displaying the version of Python. |
| `pyenv_version_name` | `false` | Use pyenv to get Python version |
| `pyenv_prefix` | `"pyenv "` | Prefix before pyenv version display (default display is `pyenv MY_VERSION`) |
| `scan_for_pyfiles` | `true` | If false, Python files in the current directory will not show this module. |
| `style` | `"bold yellow"` | 此组件的样式。 |
| `disabled` | `false` | Disables the `python` module. |
### 示例
@ -1131,11 +1167,11 @@ pyenv_prefix = "foo "
## Ruby
`ruby` 组件显示当前安装的 Ruby 版本。 此组件将在符合以下任意条件之一时显示:
The `ruby` module shows the currently installed version of Ruby. 此组件将在符合以下任意条件之一时显示:
- 当前目录包含 `Gemfile` 文件
- The current directory contains a `Gemfile` file
- The current directory contains a `.ruby-version` file
- 当前目录包含 `.rb` 文件
- The current directory contains a `.rb` file
### 配置项
@ -1143,7 +1179,7 @@ pyenv_prefix = "foo "
| ---------- | ------------ | ------------------------------------------------------ |
| `symbol` | `"💎 "` | The symbol used before displaying the version of Ruby. |
| `style` | `"bold red"` | 此组件的样式。 |
| `disabled` | `false` | 禁用 `ruby` 组件。 |
| `disabled` | `false` | Disables the `ruby` module. |
### 示例
@ -1156,18 +1192,18 @@ symbol = "🔺 "
## Rust
`rust` 组件显示当前安装的 Rust 版本。 此组件将在符合以下任意条件之一时显示:
The `rust` module shows the currently installed version of Rust. 此组件将在符合以下任意条件之一时显示:
- 当前目录包含 `Cargo.toml` 文件
- 当前目录包含一个使用 `.rs` 扩展名的文件
- The current directory contains a `Cargo.toml` file
- The current directory contains a file with the `.rs` extension
### 配置项
| 字段 | 默认值 | 描述 |
| ---------- | ------------ | ------------------------ |
| `symbol` | `"🦀 "` | 这个字段的内容会显示在当前 Rust 版本之前。 |
| `style` | `"bold red"` | 此组件的样式。 |
| `disabled` | `false` | 禁用 `rust` 组件。 |
| 字段 | 默认值 | 描述 |
| ---------- | ------------ | ------------------------------------------------------ |
| `symbol` | `"🦀 "` | The symbol used before displaying the version of Rust. |
| `style` | `"bold red"` | 此组件的样式。 |
| `disabled` | `false` | Disables the `rust` module. |
### 示例
@ -1204,19 +1240,19 @@ symbol = "📦 "
## Terraform
`terraform` 组件显示当前选定的 terraform 工作区和版本。 默认情况下不会显示 terraform 版本,因为当使用大量插件时,当前版本 terraform 查询版本号很慢。 此组件将在符合以下任意条件之一时显示:
The `terraform` module shows the currently selected terraform workspace and version. By default the terraform version is not shown, since this is slow on current versions of terraform when a lot of plugins are in use. 此组件将在符合以下任意条件之一时显示:
- 当前目录包含 `.terraform` 目录
- 当前目录包含一个使用 `.tf` 扩展名的文件
- The current directory contains a `.terraform` folder
- Current directory contains a file with the `.tf` extension
### 配置项
| 字段 | 默认值 | 描述 |
| -------------- | ------------ | -------------------------------- |
| `symbol` | `"💠 "` | 这个字段的内容会显示在当前 terraform 工作区之前。 |
| `show_version` | `false` | 显示 terraform 版本信息。 在大型工作空间中非常缓慢。 |
| `style` | `"bold 105"` | 此组件的样式。 |
| `disabled` | `false` | 禁用 `terraform` 组件。 |
| 字段 | 默认值 | 描述 |
| -------------- | ------------ | ----------------------------------------------------------- |
| `symbol` | `"💠 "` | The symbol used before displaying the terraform workspace. |
| `show_version` | `false` | Shows the terraform version. Very slow on large workspaces. |
| `style` | `"bold 105"` | 此组件的样式。 |
| `disabled` | `false` | Disables the `terraform` module. |
### 示例
@ -1229,25 +1265,26 @@ symbol = "🏎💨 "
## Time
`time` 组件显示当前的 **本地** 时间。 `format` 字段值会提供给 [`chrono`](https://crates.io/crates/chrono) crate 用来控制时间显示方式。 请参阅 [chrono strftime 文档](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) 以了解可用格式选项。
The `time` module shows the current **local** time. The `format` configuration value is used by the [`chrono`](https://crates.io/crates/chrono) crate to control how the time is displayed. Take a look [at the chrono strftime docs](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) to see what options are available.
::: tip
此组件默认被禁用。 若要启用此组件,请在配置文件中设置 `disable` 字段为 `false`
This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
:::
### 配置项
| 字段 | 默认值 | 描述 |
| ----------------- | --------------- | ----------------------------------------------------------------------------------------- |
| `use_12hr` | `false` | 启用 12 小时格式 |
| `format` | 见下文解释 | 用来格式化时间显示的 [chrono 格式字符串](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) |
| `style` | `"bold yellow"` | 显示时间的样式。 |
| `utc_time_offset` | `"local"` | 设置所用 UTC 偏移量。 范围是 -24 < x < 24 允许使用浮点数来得到 30/45 分钟的时区偏移 |
| `disabled` | `true` | 禁用 `time` 组件。 |
| 字段 | 默认值 | 描述 |
| ----------------- | --------------- | ------------------------------------------------------------------------------------------------------------------- |
| `use_12hr` | `false` | Enables 12 hour formatting. |
| `format` | see below | The [chrono format string](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) used to format the time. |
| `style` | `"bold yellow"` | The style for the module time. |
| `utc_time_offset` | `"local"` | Sets the UTC offset to use. Range from -24 < x < 24. Allows floats to accommodate 30/45 minute timezone offsets. |
| `disabled` | `true` | Disables the `time` module. |
| `time_range` | `"-"` | Sets the time range during which the module will be shown. Times must be specified in 24-hours format |
如果 `use_12hr``true`,则`format` 默认值为 `"%r"`。 否则,其默认值为 `"%T"`。 手动设置 `format` 将使 `use_12hr` 被忽略。
If `use_12hr` is `true`, then `format` defaults to `"%r"`. Otherwise, it defaults to `"%T"`. Manually setting `format` will override the `use_12hr` setting.
### 示例
@ -1258,25 +1295,26 @@ symbol = "🏎💨 "
disabled = false
format = "🕙[ %T ]"
utc_time_offset = "-5"
time_range = "10:00:00-14:00:00"
```
## Username
`username` 组件显示当前活跃的用户名。 此组件将在符合以下任意条件之一时显示:
The `username` module shows active user's username. 此组件将在符合以下任意条件之一时显示:
- 当前用户是 root
- 当前用户与登录用户不相同
- 用户正通过 SSH 会话连接访问
- 字段 `show_always` 被设置为 true
- The current user is root
- The current user isn't the same as the one that is logged in
- The user is currently connected as an SSH session
- The variable `show_always` is set to true
### 配置项
| 字段 | 默认值 | 描述 |
| ------------- | --------------- | ------------------- |
| `style_root` | `"bold red"` | 当前用户为 root 时使用的样式。 |
| `style_user` | `"bold yellow"` | 非 root 用户使用的样式。 |
| `show_always` | `false` | 总是显示 `username` 组件。 |
| `disabled` | `false` | 禁用 `username` 组件。 |
| 字段 | 默认值 | 描述 |
| ------------- | --------------- | ------------------------------------- |
| `style_root` | `"bold red"` | The style used when the user is root. |
| `style_user` | `"bold yellow"` | The style used for non-root users. |
| `show_always` | `false` | Always shows the `username` module. |
| `disabled` | `false` | Disables the `username` module. |
### 示例
@ -1339,8 +1377,8 @@ The order in which custom modules are shown can be individually set by setting `
| ------------- | ------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| `command` | | The command whose output should be printed. |
| `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` | | The path to the shell to use to execute the command. If unset, it will fallback to STARSHIP_SHELL and then to "sh". |
| `描述` | `"<custom module>"` | The description of the module that is shown when running `starship explain`. |
| `shell` | | [See below](#custom-command-shell) |
| `description` | `"<custom module>"` | The description of the module that is shown when running `starship explain`. |
| `files` | `[]` | The files that will be searched in the working directory for a match. |
| `directories` | `[]` | The directories that will be searched in the working directory for a match. |
| `extensions` | `[]` | The extensions that will be searched in the working directory for a match. |
@ -1350,6 +1388,32 @@ The order in which custom modules are shown can be individually set by setting `
| `suffix` | `""` | Suffix to display immediately after the command output. |
| `disabled` | `false` | Disables this `custom` module. |
#### Custom command shell
`shell` accepts a non-empty list of strings, where:
- The first string is the path to the shell to use to execute the command.
- Other following arguments are passed to the shell.
If unset, it will fallback to STARSHIP_SHELL and then to "sh" on Linux, and "cmd /C" on Windows.
If `shell` is not given or only contains one element and Starship detects PowerShell will be used, the following arguments will automatically be added: `-NoProfile -Command -`. This behavior can be avoided by explicitly passing arguments to the shell, e.g.
```toml
shell = ["pwsh", "-Command", "-"]
```
::: warning Make sure your custom shell configuration exits gracefully
If you set a custom command, make sure that the default Shell used by starship will properly execute the command with a graceful exit (via the `shell` option).
For example, PowerShell requires the `-Command` parameter to execute a one liner. Omitting this parameter might throw starship into a recursive loop where the shell might try to load a full profile environment with starship itself again and hence re-execute the custom command, getting into a never ending loop.
Parameters similar to `-NoProfile` in PowerShell are recommended for other shells as well to avoid extra loading time of a custom profile on every starship invocation.
Automatic detection of shells and proper parameters addition are currently implemented, but it's possible that not all shells are covered. [Please open an issue](https://github.com/starship/starship/issues/new/choose) with shell details and starship configuration if you hit such scenario.
:::
### 示例
```toml
@ -1360,11 +1424,17 @@ command = "echo foo" # shows output of command
files = ["foo"] # can specify filters
when = """ test "$HOME" == "$PWD" """
prefix = " transcending "
[custom.time]
command = "time /T"
files = ["*.pst"]
prefix = "transcending "
shell = ["pwsh.exe", "-NoProfile", "-Command", "-"]
```
## PureScript
The `purescript` module shows the currently installed version of PureScript version. 此组件只有满足以下条件之一时才会被显示:
The `purescript` module shows the currently installed version of PureScript version. 此组件将在符合以下任意条件之一时显示:
- The current directory contains a `spago.dhall` file
- The current directory contains a \*.purs files

View file

@ -56,6 +56,9 @@ symbol = " "
[memory_usage]
symbol = " "
[nim]
symbol = " "
[nix_shell]
symbol = " "

View file

@ -113,6 +113,7 @@ prompt_order = [
"haskell",
"java",
"julia",
"nim",
"nodejs",
"ocaml",
"php",
@ -374,10 +375,19 @@ style = "bold blue"
<details>
<summary>這個模組有些進階設定選項可以控制顯示資料夾。</summary>
| 變數 | 預設 | 說明 |
| --------------------------- | ------ | ------------------------------------ |
| `fish_style_pwd_dir_length` | `0` | 當使用 fish shell 的 pwd 路徑邏輯時使用的字元數量。 |
| `use_logical_path` | `true` | 顯示 shell (`PWD`) 提供的邏輯路徑,而不是 OS 的路徑。 |
| 變數 | 預設 | 說明 |
| --------------------------- | ------ | ---------------------------------------------------------------------------------------- |
| `substitutions` | | A table of substitutions to be made to the path. |
| `fish_style_pwd_dir_length` | `0` | The number of characters to use when applying fish shell pwd path logic. |
| `use_logical_path` | `true` | Displays the logical path provided by the shell (`PWD`) instead of the path from the OS. |
`substitutions` allows you to define arbitrary replacements for literal strings that occur in the path, for example long network prefixes or development directories (i.e. Java). Note that this will disable the fish style PWD.
```toml
[directory.substitutions]
"/Volumes/network/path" = "/net"
"src/com/long/java/path" = "mypath"
```
`fish_style_pwd_dir_length` interacts with the standard truncation options in a way that can be surprising at first: if it's non-zero, the components of the path that would normally be truncated are instead displayed with that many characters. For example, the path `/built/this/city/on/rock/and/roll`, which would normally be displayed as as `rock/and/roll`, would be displayed as `/b/t/c/o/rock/and/roll` with `fish_style_pwd_dir_length = 1`--the path components that would normally be removed are displayed with a single character. For `fish_style_pwd_dir_length = 2`, it would be `/bu/th/ci/on/rock/and/roll`.
@ -416,11 +426,11 @@ symbol = "🐋 "
## Dotnet
`dotnet` 模組顯示現在資料夾使用的 .NET Core SDK 的版本。 如果這個資料夾已經選定一個 SDK則顯示這個 SDK 的版本。 如果沒有的話,則顯示最新安裝的 SDK 版本。
The `dotnet` module shows the relevant version of the .NET Core SDK for the current directory. If the SDK has been pinned in the current directory, the pinned version is shown. Otherwise the module shows the latest installed version of the SDK.
這個模組只會在下列檔案出現在你的現在資料夾中時,顯示在你的提示字元:`global.json`、`project.json`、`*.sln`、`*.csproj`、`*.fsproj`、`*.xproj`。 你也會需要安裝 .NET Core 文字命令工具來正確使用這個模組。
This module will only be shown in your prompt when one of the following files are present in the current directory: `global.json`, `project.json`, `*.sln`, `*.csproj`, `*.fsproj`, `*.xproj`. You'll also need the .NET Core command-line tools installed in order to use it correctly.
這個模組內部是使用它自己的機制來偵測版本。 一般來說這個模組有 `dotnet --version` 的兩倍快,但是它可能會在你的 .NET 專案有不尋常的資料夾結構時顯示不正確的版本。 如果精確度比速度更重要的話,你可以藉由設定模組中的 `heuristic = false` 選項來停用這個功能。
Internally, this module uses its own mechanism for version detection. Typically it is twice as fast as running `dotnet --version`, but it may show an incorrect version if your .NET project has an unusual directory layout. If accuracy is more important than speed, you can disable the mechanism by setting `heuristic = false` in the module options.
### 選項
@ -495,7 +505,7 @@ symbol = " "
## 環境變數
`env_var`模組顯示一個選擇的環境變數的現在數值。 這個模組只在下列條件其中之一達到時顯示:
The `env_var` module displays the current value of a selected environment variable. The module will be shown only if any of the following conditions are met:
- `variable` 設定選項符合一個存在的環境變數。
- 沒有設定 `variable` 選項,但是有設定 `default` 選項。
@ -548,7 +558,7 @@ symbol = "e "
## Git 分支
`git_branch` 模組顯示現在的資料夾中使用中的儲存庫的分支。
The `git_branch` module shows the active branch of the repo in your current directory.
### 選項
@ -597,7 +607,7 @@ commit_hash_length = 4
## Git State
`git_state` 模組會顯示在 git 儲存庫中的資料夾內以及會在有作業正在進行時顯示像是_REBASING_、_BISECTING_ 等等。 如果有進展的資訊 (像是 REBASING 3/10),也會一併顯示出來。
The `git_state` module will show in directories which are part of a git repository, and where there is an operation in progress, such as: _REBASING_, _BISECTING_, etc. If there is progress information (e.g., REBASING 3/10), that information will be shown too.
### 選項
@ -626,7 +636,7 @@ cherry_pick = "🍒 PICKING"
## Git Status
`git_status` 模組顯示用來表示現在資料夾之中儲存庫狀態的符號。
The `git_status` module shows symbols representing the state of the repo in your current directory.
### 選項
@ -685,7 +695,7 @@ deleted = "🗑"
## Golang
`golang` 模組顯示現在安裝的 Golang 版本。 這個模組在下列其中一個條件達成時顯示:
The `golang` module shows the currently installed version of Golang. 這個模組在下列其中一個條件達成時顯示:
- 現在資料夾中含有一個 `go.mod` 檔案
- 現在資料夾中含有一個 `go.sum` 檔案
@ -738,7 +748,7 @@ symbol = " "
## 主機名稱
`hostname` 模組顯示系統的主機名稱。
The `hostname` module shows the system hostname.
### 選項
@ -766,7 +776,7 @@ disabled = false
## Java
`java` 模組顯示現在安裝的 Java 版本。 這個模組在下列其中一個條件達成時顯示:
The `java` module shows the currently installed version of Java. 這個模組在下列其中一個條件達成時顯示:
- The current directory contains a `pom.xml`, `build.gradle.kts`, `build.sbt` or `.java-version` file
- The current directory contains a file with the `.java`, `.class`, `.gradle` or `.jar` extension
@ -790,7 +800,7 @@ symbol = "🌟 "
## 工作
`jobs` 模組顯示現在正在執行中的工作。 這個模組只會在有背景工作正在執行時顯示。 這個模組會在工作數量超過一個,或者有設定 `threshold` 時且數量超過設定值時,顯示工作的數量。
The `jobs` module shows the current number of jobs running. The module will be shown only if there are background jobs running. The module will show the number of jobs running if there is more than 1 job, or more than the `threshold` config value, if it exists.
### 選項
@ -837,11 +847,11 @@ symbol = "∴ "
```
## Kubernetes
顯示現在 Kubernetes 主體名稱以及從 kubeconfig 檔案來的名稱空間 (如果有設定的話)。 The namespace needs to be set in the kubeconfig file, this can be done via `kubectl config set-context starship-cluster --namespace astronaut`. 如果有設定 `$KUBECONFIG` 環境變數,這個模組就會使用設定值;如果沒有,它就會使用 `~/.kube/config`
Displays the current Kubernetes context name and, if set, the namespace from the kubeconfig file. The namespace needs to be set in the kubeconfig file, this can be done via `kubectl config set-context starship-cluster --namespace astronaut`. If the `$KUBECONFIG` env var is set the module will use that if not it will use the `~/.kube/config`.
::: tip
這個模組預設是停用的。 想要啟用它的話,請在設定檔中將 `disabled` 設定為 `false`
This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
:::
@ -869,7 +879,7 @@ disabled = false
## 換行
`line_break` 模組將提示字元分成兩行。
The `line_break` module separates the prompt into two lines.
### 選項
@ -888,13 +898,13 @@ disabled = true
## 記憶體使用量
`memory_usage` 模組顯示現在系統記憶體與 swap 的使用量。
The `memory_usage` module shows current system memory and swap usage.
預設 swap 使用量會在系統總 swap 使用量不為 0 時顯示出來。
By default the swap usage is displayed if the total system swap is non-zero.
::: tip
這個模組預設是停用的。 想要啟用它的話,請在設定檔中將 `disabled` 設定為 `false`
This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
:::
@ -950,20 +960,46 @@ truncation_length = 4
truncation_symbol = ""
```
## Nim
The `nim` module shows the currently installed version of Nim. 這個模組在下列其中一個條件達成時顯示:
- The current directory contains a `nim.cfg` file
- The current directory contains a file with the `.nim` extension
- The current directory contains a file with the `.nims` extension
- The current directory contains a file with the `.nimble` extension
### 選項
| 變數 | 預設 | 說明 |
| ---------- | --------------- | ----------------------------------------------------- |
| `symbol` | `"👑 "` | The symbol used before displaying the version of Nim. |
| `style` | `"bold yellow"` | 這個模組的風格。 |
| `disabled` | `false` | Disables the `nim` module. |
### 範例
```toml
# ~/.config/starship.toml
[nim]
style = "yellow"
symbol = "🎣 "
```
## Nix-shell
`nix_shell` 模組顯示 nix-shell 環境。 這個模組會在 nix-shell 環境中顯示。
The `nix_shell` module shows the nix-shell environment. The module will be shown when inside a nix-shell environment.
### 選項
| 變數 | 預設 | 說明 |
| ------------ | ------------- | ------------------------------------------------- |
| `use_name` | `false` | 顯示 nix-shell 的名稱。 |
| `impure_msg` | `"impure"` | 自定義「impure」訊息。 |
| `pure_msg` | `"pure"` | 自定義「pure」訊息。 |
| `use_name` | `false` | Display the name of the nix-shell. |
| `impure_msg` | `"impure"` | Customize the "impure" msg. |
| `pure_msg` | `"pure"` | Customize the "pure" msg. |
| `symbol` | `"❄️ "` | The symbol used before displaying the shell name. |
| `style` | `"bold blue"` | 這個模組的風格。 |
| `disabled` | `false` | 停用 `nix_shell` 模組。 |
| `disabled` | `false` | Disables the `nix_shell` module. |
### 範例
@ -980,20 +1016,20 @@ symbol = "☃️ "
## NodeJS
`nodejs` 模組顯示現在安裝的 NodeJS 版本。 這個模組在下列其中一個條件達成時顯示:
The `nodejs` module shows the currently installed version of NodeJS. 這個模組在下列其中一個條件達成時顯示:
- 現在資料夾中包含一個 `package.json` 檔案
- The current directory contains a `package.json` file
- The current directory contains a `.node-version` file
- 現在資料夾中包含一個 `node_modules` 資料夾
- 現在資料夾中包含一個檔案具有 `.js` 副檔名
- The current directory contains a `node_modules` directory
- The current directory contains a file with the `.js` extension
### 選項
| 變數 | 預設 | 說明 |
| ---------- | -------------- | -------------------- |
| `symbol` | `"⬢ "` | 在顯示 NodeJS 版本之前用的符號。 |
| `style` | `"bold green"` | 這個模組的風格。 |
| `disabled` | `false` | 停用 `nodejs` 模組。 |
| 變數 | 預設 | 說明 |
| ---------- | -------------- | -------------------------------------------------------- |
| `symbol` | `"⬢ "` | The symbol used before displaying the version of NodeJS. |
| `style` | `"bold green"` | 這個模組的風格。 |
| `disabled` | `false` | Disables the `nodejs` module. |
### 範例
@ -1004,13 +1040,13 @@ symbol = "☃️ "
symbol = "🤖 "
```
## 套件版本
## Package Version
The `package` 模組在現在資料夾是一個套件的儲藏庫時出現,並顯示他的現在版本。 The module currently supports `npm`, `cargo`, `poetry`, `composer`, `gradle`, `julia` and `mix` packages.
The `package` module is shown when the current directory is the repository for a package, and shows its current version. The module currently supports `npm`, `cargo`, `poetry`, `composer`, `gradle`, `julia` and `mix` packages.
- **npm** `npm` 套件的版本是從現在資料夾中的 `package.json` 之中擷取出來的
- **cargo** `cargo` 套件的版本是從現在資料夾中的 `Cargo.toml` 之中擷取出來的
- **poetry** `poetry` 套件的版本是從現在資料夾中的 `pyproject.toml` 之中擷取出來的
- **npm** The `npm` package version is extracted from the `package.json` present in the current directory
- **cargo** The `cargo` package version is extracted from the `Cargo.toml` present in the current directory
- **poetry** The `poetry` package version is extracted from the `pyproject.toml` present in the current directory
- **composer** The `composer` package version is extracted from the `composer.json` present in the current directory
- **gradle** The `gradle` package version is extracted from the `build.gradle` present
- **julia** - The package version is extracted from the `Project.toml` present
@ -1020,12 +1056,12 @@ The `package` 模組在現在資料夾是一個套件的儲藏庫時出現,並
### 選項
| 變數 | 預設 | 說明 |
| ----------------- | ------------ | --------------------------------------------------------- |
| `symbol` | `"📦 "` | 顯示在套件的版本之前的符號。 |
| `style` | `"bold 208"` | 這個模組的風格。 |
| `display_private` | `false` | Enable displaying version for packages marked as private. |
| `disabled` | `false` | 停用 `package` 模組。 |
| 變數 | 預設 | 說明 |
| ----------------- | ------------ | ---------------------------------------------------------- |
| `symbol` | `"📦 "` | The symbol used before displaying the version the package. |
| `style` | `"bold 208"` | 這個模組的風格。 |
| `display_private` | `false` | Enable displaying version for packages marked as private. |
| `disabled` | `false` | Disables the `package` module. |
### 範例
@ -1068,7 +1104,7 @@ symbol = "🐪 "
The `php` module shows the currently installed version of PHP. 這個模組在下列其中一個條件達成時顯示:
- 現在資料夾中包含一個 `composer.json` 檔案
- The current directory contains a `composer.json` file
- The current directory contains a `.php-version` file
- The current directory contains a `.php` file
@ -1097,26 +1133,26 @@ If `pyenv_version_name` is set to `true`, it will display the pyenv version name
這個模組在下列其中一個條件達成時顯示:
- 目前資料夾中有一個 `.python-version` 檔案
- 目前資料夾中有一個 `requirements.txt` 檔案
- 目前資料夾中有一個 `pyproject.toml` 檔案
- The current directory contains a `.python-version` file
- The current directory contains a `requirements.txt` file
- The current directory contains a `pyproject.toml` file
- The current directory contains a file with the `.py` extension (and `scan_for_pyfiles` is true)
- 目前資料夾中有一個 `Pipfile` 檔案
- 目前資料夾中有一個 `tox.ini` 檔案
- 現在資料夾中包含一個 `setup.py` 檔案
- The current directory contains a `Pipfile` file
- The current directory contains a `tox.ini` file
- The current directory contains a `setup.py` file
- The current directory contains a `__init__.py` file
- A virtual environment is currently activated
### 選項
| 變數 | 預設 | 說明 |
| -------------------- | --------------- | -------------------------------------------------------------------------- |
| `symbol` | `"🐍 "` | 顯示在 Python 版本之前的符號。 |
| `pyenv_version_name` | `false` | 使用 pyenv 取得 Python 的版本。 |
| `pyenv_prefix` | `"pyenv "` | 顯示在 pyenv 版本之前的前綴 (預設顯示是 `pyenv MY_VERSION`)。 |
| `scan_for_pyfiles` | `true` | If false, Python files in the current directory will not show this module. |
| `style` | `"bold yellow"` | 這個模組的風格。 |
| `disabled` | `false` | 停用 `python` 模組。 |
| 變數 | 預設 | 說明 |
| -------------------- | --------------- | --------------------------------------------------------------------------- |
| `symbol` | `"🐍 "` | The symbol used before displaying the version of Python. |
| `pyenv_version_name` | `false` | Use pyenv to get Python version |
| `pyenv_prefix` | `"pyenv "` | Prefix before pyenv version display (default display is `pyenv MY_VERSION`) |
| `scan_for_pyfiles` | `true` | If false, Python files in the current directory will not show this module. |
| `style` | `"bold yellow"` | 這個模組的風格。 |
| `disabled` | `false` | Disables the `python` module. |
### 範例
@ -1131,19 +1167,19 @@ pyenv_prefix = "foo "
## Ruby
`ruby` 模組顯示現在安裝的 Ruby 版本。 這個模組在下列其中一個條件達成時顯示:
The `ruby` module shows the currently installed version of Ruby. 這個模組在下列其中一個條件達成時顯示:
- 目前資料夾中有一個 `Gemfile` 檔案
- The current directory contains a `Gemfile` file
- The current directory contains a `.ruby-version` file
- 目前資料夾中有一個 `.rb` 檔案
- The current directory contains a `.rb` file
### 選項
| 變數 | 預設 | 說明 |
| ---------- | ------------ | ----------------- |
| `symbol` | `"💎 "` | 顯示在 Ruby 版本之前的符號。 |
| `style` | `"bold red"` | 這個模組的風格。 |
| `disabled` | `false` | 停用 `ruby` 模組。 |
| 變數 | 預設 | 說明 |
| ---------- | ------------ | ------------------------------------------------------ |
| `symbol` | `"💎 "` | The symbol used before displaying the version of Ruby. |
| `style` | `"bold red"` | 這個模組的風格。 |
| `disabled` | `false` | Disables the `ruby` module. |
### 範例
@ -1156,18 +1192,18 @@ symbol = "🔺 "
## Rust
`rust` 模組顯示現在安裝的 Rust 版本。 這個模組在下列其中一個條件達成時顯示:
The `rust` module shows the currently installed version of Rust. 這個模組在下列其中一個條件達成時顯示:
- 目前資料夾中有一個 `Cargo.toml` 檔案
- 現在資料夾中包含一個檔案具有 `.rs` 副檔名
- The current directory contains a `Cargo.toml` file
- The current directory contains a file with the `.rs` extension
### 選項
| 變數 | 預設 | 說明 |
| ---------- | ------------ | ----------------- |
| `symbol` | `"🦀 "` | 顯示在 Rust 版本之前的符號。 |
| `style` | `"bold red"` | 這個模組的風格。 |
| `disabled` | `false` | 停用 `rust` 模組。 |
| 變數 | 預設 | 說明 |
| ---------- | ------------ | ------------------------------------------------------ |
| `symbol` | `"🦀 "` | The symbol used before displaying the version of Rust. |
| `style` | `"bold red"` | 這個模組的風格。 |
| `disabled` | `false` | Disables the `rust` module. |
### 範例
@ -1227,27 +1263,28 @@ The `terraform` module shows the currently selected terraform workspace and vers
symbol = "🏎💨 "
```
## 時間
## Time
`time` 模組顯示目前的**當地**時間. `format` 設定值被 [`chrono`](https://crates.io/crates/chrono) crate 用來控制時間如何顯示。 請看 [chrono 的 strftime 文件](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html)來了解有那些選項可以使用。
The `time` module shows the current **local** time. The `format` configuration value is used by the [`chrono`](https://crates.io/crates/chrono) crate to control how the time is displayed. Take a look [at the chrono strftime docs](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) to see what options are available.
::: tip
這個模組預設是停用的。 想要啟用它的話,請在設定檔中將 `disabled` 設定為 `false`
This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
:::
### 選項
| 變數 | 預設 | 說明 |
| ----------------- | --------------- | -------------------------------------------------------------------------------------- |
| `use_12hr` | `false` | 啟用 12 小時格式。 |
| `format` | 請看下列 | 用來顯示時間的 [chrono 格式字串](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html)。 |
| `style` | `"bold yellow"` | 這個模組的時間的風格。 |
| `utc_time_offset` | `"local"` | 設定相對於 UTC 的時差。 範圍 -24 < x < 24 允許使用浮點數來表示 30/45 分鐘時差的時區 |
| `disabled` | `true` | 停用 `time` 模組。 |
| 變數 | 預設 | 說明 |
| ----------------- | --------------- | ------------------------------------------------------------------------------------------------------------------- |
| `use_12hr` | `false` | Enables 12 hour formatting. |
| `format` | see below | The [chrono format string](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) used to format the time. |
| `style` | `"bold yellow"` | The style for the module time. |
| `utc_time_offset` | `"local"` | Sets the UTC offset to use. Range from -24 < x < 24. Allows floats to accommodate 30/45 minute timezone offsets. |
| `disabled` | `true` | Disables the `time` module. |
| `time_range` | `"-"` | Sets the time range during which the module will be shown. Times must be specified in 24-hours format |
如果 `use_12hr``true` 的話,`format` 會被預設為 `"%r"`。 不然的話,它會被預設為 `"%T"`。 手動設定 `format` 的設定值會覆寫 `use_12hr` 的設定。
If `use_12hr` is `true`, then `format` defaults to `"%r"`. Otherwise, it defaults to `"%T"`. Manually setting `format` will override the `use_12hr` setting.
### 範例
@ -1258,25 +1295,26 @@ symbol = "🏎💨 "
disabled = false
format = "🕙[ %T ]"
utc_time_offset = "-5"
time_range = "10:00:00-14:00:00"
```
## 使用者名稱
## Username
`username` 模組顯示現在使用中的使用者名稱。 這個模組在下列其中一個條件達成時顯示:
The `username` module shows active user's username. 這個模組在下列其中一個條件達成時顯示:
- 目前使用者為 root
- 目前使用者並非登入時的使用者
- 使用者透過 SSH session 進行連線
- 變數 `show_always` 被設為 true
- The current user is root
- The current user isn't the same as the one that is logged in
- The user is currently connected as an SSH session
- The variable `show_always` is set to true
### 選項
| 變數 | 預設 | 說明 |
| ------------- | --------------- | ------------------- |
| `style_root` | `"bold red"` | 使用者為 root 時使用的風格。 |
| `style_user` | `"bold yellow"` | 非 root 使用者時使用的風格。 |
| `show_always` | `false` | 總是顯示 `username` 模組。 |
| `disabled` | `false` | 停用 `username` 模組。 |
| 變數 | 預設 | 說明 |
| ------------- | --------------- | ------------------------------------- |
| `style_root` | `"bold red"` | The style used when the user is root. |
| `style_user` | `"bold yellow"` | The style used for non-root users. |
| `show_always` | `false` | Always shows the `username` module. |
| `disabled` | `false` | Disables the `username` module. |
### 範例
@ -1339,8 +1377,8 @@ The order in which custom modules are shown can be individually set by setting `
| ------------- | ------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| `command` | | The command whose output should be printed. |
| `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` | | The path to the shell to use to execute the command. If unset, it will fallback to STARSHIP_SHELL and then to "sh". |
| `說明` | `"<custom module>"` | The description of the module that is shown when running `starship explain`. |
| `shell` | | [See below](#custom-command-shell) |
| `description` | `"<custom module>"` | The description of the module that is shown when running `starship explain`. |
| `files` | `[]` | The files that will be searched in the working directory for a match. |
| `directories` | `[]` | The directories that will be searched in the working directory for a match. |
| `extensions` | `[]` | The extensions that will be searched in the working directory for a match. |
@ -1350,6 +1388,32 @@ The order in which custom modules are shown can be individually set by setting `
| `suffix` | `""` | Suffix to display immediately after the command output. |
| `disabled` | `false` | Disables this `custom` module. |
#### Custom command shell
`shell` accepts a non-empty list of strings, where:
- The first string is the path to the shell to use to execute the command.
- Other following arguments are passed to the shell.
If unset, it will fallback to STARSHIP_SHELL and then to "sh" on Linux, and "cmd /C" on Windows.
If `shell` is not given or only contains one element and Starship detects PowerShell will be used, the following arguments will automatically be added: `-NoProfile -Command -`. This behavior can be avoided by explicitly passing arguments to the shell, e.g.
```toml
shell = ["pwsh", "-Command", "-"]
```
::: warning Make sure your custom shell configuration exits gracefully
If you set a custom command, make sure that the default Shell used by starship will properly execute the command with a graceful exit (via the `shell` option).
For example, PowerShell requires the `-Command` parameter to execute a one liner. Omitting this parameter might throw starship into a recursive loop where the shell might try to load a full profile environment with starship itself again and hence re-execute the custom command, getting into a never ending loop.
Parameters similar to `-NoProfile` in PowerShell are recommended for other shells as well to avoid extra loading time of a custom profile on every starship invocation.
Automatic detection of shells and proper parameters addition are currently implemented, but it's possible that not all shells are covered. [Please open an issue](https://github.com/starship/starship/issues/new/choose) with shell details and starship configuration if you hit such scenario.
:::
### 範例
```toml
@ -1360,6 +1424,12 @@ command = "echo foo" # shows output of command
files = ["foo"] # can specify filters
when = """ test "$HOME" == "$PWD" """
prefix = " transcending "
[custom.time]
command = "time /T"
files = ["*.pst"]
prefix = "transcending "
shell = ["pwsh.exe", "-NoProfile", "-Command", "-"]
```
## PureScript

View file

@ -56,6 +56,9 @@ symbol = " "
[memory_usage]
symbol = " "
[nim]
symbol = " "
[nix_shell]
symbol = " "