docs(i18n): new Crowdin updates (#3218)

This commit is contained in:
Matan Kushner 2021-12-21 00:05:59 +03:00 committed by GitHub
parent 006fbf0dd5
commit 5de3f18bce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
81 changed files with 7644 additions and 6256 deletions

File diff suppressed because it is too large Load Diff

View File

@ -157,7 +157,7 @@
**Note**: due to the proliferation of different platforms, only a subset of supported platforms are shown below. Can't see yours? Have a look at the [extra platform instructions](https://starship.rs/installing/). **Note**: due to the proliferation of different platforms, only a subset of supported platforms are shown below. Can't see yours? Have a look at the [extra platform instructions](https://starship.rs/installing/).
1. Install the **starship** binary: 1. تثبيت **starship**:
#### تثبيت أحدث إصدار #### تثبيت أحدث إصدار
@ -306,7 +306,7 @@
## 💭 مستوحاة من قبل ## 💭 مستوحاة من قبل
Please check out these previous works that helped inspire the creation of starship. 🙏 يرجى التحقق من هذه الأعمال السابقة التي ساعدت على إنشاء starship. 🙏
- **[denysdovhan/spaceship-prompt](https://github.com/denysdovhan/spaceship-prompt)** - A ZSH prompt for astronauts. - **[denysdovhan/spaceship-prompt](https://github.com/denysdovhan/spaceship-prompt)** - A ZSH prompt for astronauts.

View File

@ -223,6 +223,9 @@ format = '\[[$symbol($version)]($style)\]'
[scala] [scala]
format = '\[[$symbol($version)]($style)\]' format = '\[[$symbol($version)]($style)\]'
[sudo]
format = '\[[as $symbol]\]
[swift] [swift]
format = '\[[$symbol($version)]($style)\]' format = '\[[$symbol($version)]($style)\]'
@ -371,6 +374,9 @@ symbol = "rs "
[scala] [scala]
symbol = "scala " symbol = "scala "
[sudo]
symbol = "sudo "
[swift] [swift]
symbol = "swift " symbol = "swift "
``` ```

View File

@ -143,7 +143,7 @@ description: 'Starship: یەکێ لە promptـە سوکەڵە، خێرا، و ب
#### Nushell #### Nushell
::: warning This will change in the future. Only nu version v0.33 or higher is supported. ::: Add the following to your nu config file. You can check the location of this file by running `config path` in nu. ::: warning This will change in the future. تەنها وەشانی v0.33 یان بەرزتری nu پشتگیریکراوە. ::: Add the following to your nu config file. ئەتوانی شوێنی ئەم پەڕگەیە بپشکنی بە جێبەجێکردنی `config path` لە nu دا.
```toml ```toml
startup = [ startup = [
@ -157,7 +157,7 @@ description: 'Starship: یەکێ لە promptـە سوکەڵە، خێرا، و ب
#### Xonsh #### Xonsh
Add the following to the end of `~/.xonshrc`: ئەمەی دێت زیادبکە بۆ کۆتایی پەڕگەی `~/.xonshrc`:
```sh ```sh
# ~/.xonshrc # ~/.xonshrc

View File

@ -132,7 +132,7 @@ Style strings are a list of words, separated by whitespace. The words are not ca
- `<color>` - `<color>`
- `هیچ` - `هیچ`
where `<color>` is a color specifier (discussed below). `fg:<color>` and `<color>` currently do the same thing, though this may change in the future. `inverted` swaps the background and foreground colors. The order of words in the string does not matter. کە `<color>` دیاریکەری ڕەنگێکە (لە ژێرەوە باسکراوە). `fg:<color>` و `<color>` لە ئێستادا هەمان شت ئەکەن، بەڵام ئەمە ڕەنگە لە داهاتووا بگۆڕێت. `inverted` ڕەنگی پاشبنەما و پێشبنەما ئەگۆڕێتەوە. ڕیزبەندی ووشەکان لە زنجیرەکەدا گرنگ نییە.
The `none` token overrides all other tokens in a string if it is not part of a `bg:` specifier, so that e.g. `fg:red none fg:blue` will still create a string with no styling. `bg:none` sets the background to the default color so `fg:red bg:none` is equivalent to `red` or `fg:red` and `bg:green fg:red bg:none` is also equivalent to `fg:red` or `red`. It may become an error to use `none` in conjunction with other tokens in the future. The `none` token overrides all other tokens in a string if it is not part of a `bg:` specifier, so that e.g. `fg:red none fg:blue` will still create a string with no styling. `bg:none` sets the background to the default color so `fg:red bg:none` is equivalent to `red` or `fg:red` and `bg:green fg:red bg:none` is also equivalent to `fg:red` or `red`. It may become an error to use `none` in conjunction with other tokens in the future.

File diff suppressed because it is too large Load Diff

View File

@ -302,7 +302,7 @@
## 💭 ئیلهامبەخشەکان ## 💭 ئیلهامبەخشەکان
Please check out these previous works that helped inspire the creation of starship. 🙏 تکایە ئەم کارە کۆنانە سەیربکەوە کە ئیلهامی دروستکردنی starship دا. 🙏
- **[denysdovhan/spaceship-prompt](https://github.com/denysdovhan/spaceship-prompt)** - یەکێ لە promptـەکانی ZSH بۆ ئاسمانەوانان. - **[denysdovhan/spaceship-prompt](https://github.com/denysdovhan/spaceship-prompt)** - یەکێ لە promptـەکانی ZSH بۆ ئاسمانەوانان.
@ -312,9 +312,9 @@ Please check out these previous works that helped inspire the creation of starsh
<p align="center"> <p align="center">
<br> <br>
<img width="100" src="https://raw.githubusercontent.com/starship/starship/master/media/icon.png" alt="Starship rocket icon"> <img width="100" src="https://raw.githubusercontent.com/starship/starship/master/media/icon.png" alt="ئایکۆنی مووشەکی Starship">
</p> </p>
## 📝 مۆڵەتنامە ## 📝 مۆڵەتنامە
Copyright © 2019-present, [Starship Contributors](https://github.com/starship/starship/graphs/contributors).<br /> This project is [ISC](https://github.com/starship/starship/blob/master/LICENSE) licensed. هەموو مافێکی پارێزراوە © 2019-ئێستا، [بەژداریکەرانی Starship](https://github.com/starship/starship/graphs/contributors). <br />ئەم پڕۆژەیە لە ژێر مۆڵەتنامەی [ISC](https://github.com/starship/starship/blob/master/LICENSE)ـە.

View File

@ -223,6 +223,9 @@ format = '\[[$symbol($version)]($style)\]'
[scala] [scala]
format = '\[[$symbol($version)]($style)\]' format = '\[[$symbol($version)]($style)\]'
[sudo]
format = '\[[as $symbol]\]
[swift] [swift]
format = '\[[$symbol($version)]($style)\]' format = '\[[$symbol($version)]($style)\]'
@ -371,6 +374,9 @@ symbol = "rs "
[scala] [scala]
symbol = "scala " symbol = "scala "
[sudo]
symbol = "sudo "
[swift] [swift]
symbol = "swift " symbol = "swift "
``` ```

View File

@ -43,27 +43,27 @@ function Invoke-Starship-PreCommand {
} }
``` ```
## Change Window Title ## Fenstertitel anpassen
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`. Some shell prompts will automatically change the window title for you (e.g. to reflect your working directory). Fish ist standardmäßig so konfiguriert. Starship ändert standardmäßig den Fenstertitel nicht, aber es ist sehr einfach die Funktion zu `bash` oder `zsh` hinzuzufügen.
First, define a window title change function (identical in bash and zsh): Zuerst wird eine Funktion definiert um den Fenstertitel zu ändern ( für bash und zsh ist die Funktion identisch):
```bash ```bash
function set_win_title(){ function set_win_title(){
echo -ne "\033]0; YOUR_WINDOW_TITLE_HERE \007" echo -ne "\033]0; DEIN_FENSTERTITEL_HIER \007"
} }
``` ```
You can use variables to customize this title (`$USER`, `$HOSTNAME`, and `$PWD` are popular choices). Sie können Variablen verwenden, um diesen Titel anzupassen (`$USER`, `$HOSTNAME`, `$PWD`).
In `bash`, set this function to be the precmd starship function: Für `bash` muss die Funktion als "precmd starship"-Funktion gesetzt werden:
```bash ```bash
starship_precmd_user_func="set_win_title" starship_precmd_user_func="set_win_title"
``` ```
In `zsh`, add this to the `precmd_functions` array: Füge dies in `Zsh` zum `precmd_functions`-Array hinzu:
```bash ```bash
precmd_functions+=(set_win_title) precmd_functions+=(set_win_title)
@ -71,7 +71,7 @@ precmd_functions+=(set_win_title)
If you like the result, add these lines to your shell configuration file (`~/.bashrc` or `~/.zshrc`) to make it permanent. If you like the result, add these lines to your shell configuration file (`~/.bashrc` or `~/.zshrc`) to make it permanent.
For example, if you want to display your current directory in your terminal tab title, add the following snippet to your `~/.bashrc` or `~/.zshrc`: Zum Beispiel, wenn sie ihr aktuelles Verzeichnis als Terminal Title anzeigen wollen, fügen Sie folgenden Code-Schnipsel zu ihrer `~/.bashrc` oder `~/.zshrc` hinzu:
```bash ```bash
function set_win_title(){ function set_win_title(){
@ -120,7 +120,7 @@ Produces a prompt like the following:
## Style-Strings ## Style-Strings
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-String sind Wortlisten, getrennt durch Leerzeichen. Die Wörter haben keine Groß- und Kleinschreibung (z.B. `bold` und `BoLd` werden als dieselbe Zeichenkette betrachtet). Jedes Wort kann eines der folgenden sein:
- `bold` - `bold`
- `italic` - `italic`
@ -132,14 +132,14 @@ Style strings are a list of words, separated by whitespace. The words are not ca
- `<color>` - `<color>`
- `none` - `none`
where `<color>` is a color specifier (discussed below). `fg:<color>` and `<color>` currently do the same thing, though this may change in the future. `inverted` swaps the background and foreground colors. The order of words in the string does not matter. wobei `<color>` eine Farbspezifikation ist (siehe unten). `fg:<color>` and `<color>` currently do the same thing, though this may change in the future. `inverted` swaps the background and foreground colors. Die Reihenfolge der Wörter in der Liste spielt keine Rolle.
The `none` token overrides all other tokens in a string if it is not part of a `bg:` specifier, so that e.g. `fg:red none fg:blue` will still create a string with no styling. `bg:none` sets the background to the default color so `fg:red bg:none` is equivalent to `red` or `fg:red` and `bg:green fg:red bg:none` is also equivalent to `fg:red` or `red`. It may become an error to use `none` in conjunction with other tokens in the future. The `none` token overrides all other tokens in a string if it is not part of a `bg:` specifier, so that e.g. `fg:red none fg:blue` will still create a string with no styling. `bg:none` sets the background to the default color so `fg:red bg:none` is equivalent to `red` or `fg:red` and `bg:green fg:red bg:none` is also equivalent to `fg:red` or `red`. In der Zukunft könnte die Unterstützung von `none` in Verbindung mit anderen Tokens fallen gelassen werden.
A color specifier can be one of the following: Eine Farbspezifikation kann wie folgt aussehen:
- Einer der Standardfarben der Konsole: `black`, `red`, `green`, `blue`, `yellow`, `purple`, `cyan`, `white`. Optional kann ein `bright-` vorangestellt werden um die helle Version zu erhalten (z.B. `bright-white`). - Einer der Standardfarben der Konsole: `black`, `red`, `green`, `blue`, `yellow`, `purple`, `cyan`, `white`. Optional kann ein `bright-` vorangestellt werden um die helle Version zu erhalten (z.B. `bright-white`).
- Eine `#` gefolgt von einer sechsstelligen Hexadezimalnummer. Dies ergibt einen [RGB hex Farbcode](https://www.w3schools.com/colors/colors_hexadecimal.asp). - Eine `#` gefolgt von einer sechsstelligen Hexadezimalnummer. Dies ergibt einen [RGB hex Farbcode](https://www.w3schools.com/colors/colors_hexadecimal.asp).
- Eine Zahl zwischen 0-255. Dies ergibt einen [8-bit ANSI-Farbcode](https://i.stack.imgur.com/KTSQa.png). - Eine Zahl zwischen 0-255. Dies ergibt einen [8-bit ANSI-Farbcode](https://i.stack.imgur.com/KTSQa.png).
If multiple colors are specified for foreground/background, the last one in the string will take priority. Wenn mehrere Farben für Vordergrund oder Hintergrund angegeben werden, hat die letzte Farbe der Zeichenkette Priorität.

File diff suppressed because it is too large Load Diff

View File

@ -88,13 +88,13 @@ starship bug-report
## Why don't I see a glyph symbol in my prompt? ## Why don't I see a glyph symbol in my prompt?
The most common cause of this is system misconfiguration. Some Linux distros in particular do not come with font support out-of-the-box. You need to ensure that: The most common cause of this is system misconfiguration. Some Linux distros in particular do not come with font support out-of-the-box. Sie müssen sicherstellen, dass:
- Your locale is set to a UTF-8 value, like `de_DE.UTF-8` or `ja_JP.UTF-8`. Wenn `LC_ALL` kein UTF-8-Wert ist, [müssen Sie ihn ändern](https://www.tecmint.com/set-system-locales-in-linux/). - Your locale is set to a UTF-8 value, like `de_DE.UTF-8` or `ja_JP.UTF-8`. Wenn `LC_ALL` kein UTF-8-Wert ist, [müssen Sie ihn ändern](https://www.tecmint.com/set-system-locales-in-linux/).
- You have an emoji font installed. Most systems come with an emoji font by default, but some (notably Arch Linux) do not. You can usually install one through your system's package manager--[noto emoji](https://www.google.com/get/noto/help/emoji/) is a popular choice. - You have an emoji font installed. Most systems come with an emoji font by default, but some (notably Arch Linux) do not. You can usually install one through your system's package manager--[noto emoji](https://www.google.com/get/noto/help/emoji/) is a popular choice.
- You are using a [Nerd Font](https://www.nerdfonts.com/). - You are using a [Nerd Font](https://www.nerdfonts.com/).
To test your system, run the following commands in a terminal: Um Ihr System zu testen, führen Sie folgende Befehle in einem Terminal aus:
```sh ```sh
echo -e "\xf0\x9f\x90\x8d" echo -e "\xf0\x9f\x90\x8d"
@ -103,20 +103,20 @@ echo -e "\xee\x82\xa0"
The first line should produce a [snake emoji](https://emojipedia.org/snake/), while the second should produce a [powerline branch symbol (e0a0)](https://github.com/ryanoasis/powerline-extra-symbols#glyphs). The first line should produce a [snake emoji](https://emojipedia.org/snake/), while the second should produce a [powerline branch symbol (e0a0)](https://github.com/ryanoasis/powerline-extra-symbols#glyphs).
If either symbol fails to display correctly, your system is still misconfigured. Unfortunately, getting font configuration correct is sometimes difficult. Users on the Discord may be able to help. If both symbols display correctly, but you still don't see them in starship, [file a bug report!](https://github.com/starship/starship/issues/new/choose) If either symbol fails to display correctly, your system is still misconfigured. Unfortunately, getting font configuration correct is sometimes difficult. Benutzer auf dem Discord können vielleicht helfen. If both symbols display correctly, but you still don't see them in starship, [file a bug report!](https://github.com/starship/starship/issues/new/choose)
## How do I uninstall Starship? ## Wie deinstalliere ich Starship?
Starship is just as easy to uninstall as it is to install in the first place. Starship ist genauso einfach zu deinstallieren wie zu installieren.
1. Remove any lines in your shell config (e.g. `~/.bashrc`) used to initialize Starship. 1. Remove any lines in your shell config (e.g. `~/.bashrc`) used to initialize Starship.
1. Löschen Sie die Starship-Binary. 1. Löschen Sie die Starship-Binary.
If Starship was installed using a package manager, please refer to their docs for uninstallation instructions. If Starship was installed using a package manager, please refer to their docs for uninstallation instructions.
If Starship was installed using the install script, the following command will delete the binary: Wenn Starship mit Hilfe des Installationsscripts installiert wurde, entfernt der folgende Befehl Starship:
```sh ```sh
# Locate and delete the starship binary # Starship binary suchen und löschen
sh -c 'rm "$(which starship)"' sh -c 'rm "$(which starship)"'
``` ```

View File

@ -306,7 +306,7 @@ Falls du an Starship mitwirken willst, wirf bitte einen Blick auf den [Leitfaden
## 💭 Inspiriert durch ## 💭 Inspiriert durch
Please check out these previous works that helped inspire the creation of starship. 🙏 Checkt bitte diese älteren Projekte, die das Entstehen von Starhip inspiriert haben. 🙏
- **[denysdovhan/spaceship-prompt](https://github.com/denysdovhan/spaceship-prompt)** - Ein ZSH-Prompt für Astronauten. - **[denysdovhan/spaceship-prompt](https://github.com/denysdovhan/spaceship-prompt)** - Ein ZSH-Prompt für Astronauten.
@ -316,9 +316,9 @@ Please check out these previous works that helped inspire the creation of starsh
<p align="center"> <p align="center">
<br> <br>
<img width="100" src="https://raw.githubusercontent.com/starship/starship/master/media/icon.png" alt="Starship rocket icon"> <img width="100" src="https://raw.githubusercontent.com/starship/starship/master/media/icon.png" alt="Starship Raketen Icon">
</p> </p>
## 📝 Lizenz ## 📝 Lizenz
Copyright © 2019-present, [Starship Contributors](https://github.com/starship/starship/graphs/contributors).<br /> This project is [ISC](https://github.com/starship/starship/blob/master/LICENSE) licensed. Copyright © 2019-present, [Starship Contributors](https://github.com/starship/starship/graphs/contributors).<br /> Unter der [ISC](https://github.com/starship/starship/blob/master/LICENSE) Lizens.

View File

@ -47,7 +47,7 @@ emerge app-shells/starship
## [Nix](https://nixos.wiki/wiki/Nix) ## [Nix](https://nixos.wiki/wiki/Nix)
### Getting the Binary ### Das Binary holen
#### Imperativ #### Imperativ
@ -57,7 +57,7 @@ nix-env -iA nixos.starship
#### Deklarativ, Einzel-Benutzer, über [home-manager](https://github.com/nix-community/home-manager) #### Deklarativ, Einzel-Benutzer, über [home-manager](https://github.com/nix-community/home-manager)
Enable the `programs.starship` module in your `home.nix` file, and add your settings Aktivieren Sie das Modul `programs.starship` in Ihrer `home.nix`-Datei und fügen Sie Ihre Einstellungen hinzu
```nix ```nix
{ {
@ -79,7 +79,7 @@ Enable the `programs.starship` module in your `home.nix` file, and add your sett
} }
``` ```
then run und führen Sie dann folgendes aus
```sh ```sh
home-manager switch home-manager switch
@ -87,7 +87,7 @@ home-manager switch
#### Deklarativ, systemweit, mit NixOS #### Deklarativ, systemweit, mit NixOS
Add `pkgs.starship` to `environment.systemPackages` in your `configuration.nix`, then run Fügen Sie `pkgs.starship` zu `environment.systemPackages` in Ihrer `configuration.nix` hinzu, und führen Sie folgendes aus
```sh ```sh
sudo nixos-rebuild switch sudo nixos-rebuild switch

View File

@ -223,6 +223,9 @@ format = '\[[$symbol($version)]($style)\]'
[scala] [scala]
format = '\[[$symbol($version)]($style)\]' format = '\[[$symbol($version)]($style)\]'
[sudo]
format = '\[[as $symbol]\]
[swift] [swift]
format = '\[[$symbol($version)]($style)\]' format = '\[[$symbol($version)]($style)\]'
@ -371,6 +374,9 @@ symbol = "rs "
[scala] [scala]
symbol = "scala " symbol = "scala "
[sudo]
symbol = "sudo "
[swift] [swift]
symbol = "swift " symbol = "swift "
``` ```

File diff suppressed because it is too large Load Diff

View File

@ -60,9 +60,9 @@ sh -c "$(curl -fsSL https://starship.rs/install.sh)" -- --platform unknown-linux
Starship executes different commands to get information to display in the prompt, for example the version of a program or the current git status. To make sure starship doesn't hang while trying to execute these commands we set a time limit, if a command takes longer than this limit starship will stop the execution of the command and output the above warning, this is expected behaviour. This time limit is configurable using the [`command_timeout` key](/config/#prompt) so if you want you can increase the time limit. You can also follow the debugging steps below to see which command is being slow and see if you can optimise it. Finally you can set the `STARSHIP_LOG` env var to `error` to hide these warnings. Starship executes different commands to get information to display in the prompt, for example the version of a program or the current git status. To make sure starship doesn't hang while trying to execute these commands we set a time limit, if a command takes longer than this limit starship will stop the execution of the command and output the above warning, this is expected behaviour. This time limit is configurable using the [`command_timeout` key](/config/#prompt) so if you want you can increase the time limit. You can also follow the debugging steps below to see which command is being slow and see if you can optimise it. Finally you can set the `STARSHIP_LOG` env var to `error` to hide these warnings.
## I see symbols I don't understand or expect, what do they mean? ## Veo símbolos que no entiendo ni espero, ¿qué significan?
If you see symbols that you don't recognise you can use `starship explain` to explain the currently showing modules. Si ves símbolos que no reconoces, puedes usar `starship explain` para explicar los módulos que se muestran actualmente.
## Starship is doing something unexpected, how can I debug it? ## Starship is doing something unexpected, how can I debug it?
@ -86,37 +86,37 @@ Finally if you find a bug you can use the `bug-report` command to create a Githu
reporte de error starship reporte de error starship
``` ```
## Why don't I see a glyph symbol in my prompt? ## ¿Por qué no veo un símbolo de glifo en mi prompt?
The most common cause of this is system misconfiguration. Some Linux distros in particular do not come with font support out-of-the-box. You need to ensure that: La causa más común de esto es la mala configuración del sistema. Algunas distribuciones de Linux en particular no vienen con soporte de fuentes listos para usarse. Tienes que garantizar que:
- Tu configuración regional está establecida con un valor UTF-8, como `de_DE.UTF-8` o `ja_JP.UTF-8`. Si `LC_ALL` no es un valor UTF-8, [necesitarás cambiarlo](https://www.tecmint.com/set-system-locales-in-linux/). - Tu configuración regional está establecida con un valor UTF-8, como `de_DE.UTF-8` o `ja_JP.UTF-8`. Si `LC_ALL` no es un valor UTF-8, [necesitarás cambiarlo](https://www.tecmint.com/set-system-locales-in-linux/).
- Tienes una fuente emoji instalada. La mayoría de los sistemas vienen con una fuente emoji por defecto, pero algunos (notablemente Arch Linux) no. Generalmente puedes instalar uno a través del gestor de paquetes del sistema --[noto emoji](https://www.google.com/get/noto/help/emoji/) es una elección popular. - Tienes una fuente emoji instalada. La mayoría de los sistemas vienen con una fuente emoji por defecto, pero algunos (notablemente Arch Linux) no. Generalmente puedes instalar uno a través del gestor de paquetes del sistema --[noto emoji](https://www.google.com/get/noto/help/emoji/) es una elección popular.
- Estás usando un [Nerd Font](https://www.nerdfonts.com/). - Estás usando un [Nerd Font](https://www.nerdfonts.com/).
To test your system, run the following commands in a terminal: Para probar tu sistema, ejecua los siguientes comandos en un terminal:
```sh ```sh
echo -e "\xf0\x9f\x90\x8d" echo -e "\xf0\x9f\x90\x8d"
echo -e "\xee\x82\xa0" echo -e "\xee\x82\xa0"
``` ```
The first line should produce a [snake emoji](https://emojipedia.org/snake/), while the second should produce a [powerline branch symbol (e0a0)](https://github.com/ryanoasis/powerline-extra-symbols#glyphs). La primera línea debe producir un [emoji snake](https://emojipedia.org/snake/), mientras que la segunda debe producir un [símbolo de rama de Powerline(e0a0)](https://github.com/ryanoasis/powerline-extra-symbols#glyphs).
If either symbol fails to display correctly, your system is still misconfigured. Unfortunately, getting font configuration correct is sometimes difficult. Users on the Discord may be able to help. If both symbols display correctly, but you still don't see them in starship, [file a bug report!](https://github.com/starship/starship/issues/new/choose) Si cualquiera de los dos símbolos no se puede mostrar correctamente, su sistema todavía está mal configurado. Desafortunadamente, obtener la configuración correcta de las fuentes es a veces difícil. Los usuarios en el Discord pueden ayudar. Si ambos símbolos se muestran correctamente, pero todavía no los ves en Starship, [¡envía un informe de error!](https://github.com/starship/starship/issues/new/choose)
## How do I uninstall Starship? ## ¿Cómo puedo desinstalar Starship?
Starship is just as easy to uninstall as it is to install in the first place. Starship es tan fácil de desinstalar como de instalar en primer lugar.
1. Elimina cualquier línea de tu configuración de intérprete de comandos (por ejemplo, `~/.bashrc`) usada para inicializar Starship. 1. Elimina cualquier línea de tu configuración de intérprete de comandos (por ejemplo, `~/.bashrc`) usada para inicializar Starship.
1. Elimina el binario de Starship. 1. Elimina el binario de Starship.
If Starship was installed using a package manager, please refer to their docs for uninstallation instructions. Si Starship fue instalado usando un gestor de paquetes, por favor refiérete a sus documentos para instrucciones de desinstalación.
If Starship was installed using the install script, the following command will delete the binary: Si Starship fue instalado usando el guión de instalación, el siguiente comando eliminará el binario:
```sh ```sh
# Locate and delete the starship binary # Localiza y elimina el binario de starship
sh -c 'rm "$(which starship)"' sh -c 'rm "$(which starship)"'
``` ```

View File

@ -223,6 +223,9 @@ format = '\[[$symbol($version)]($style)\]'
[scala] [scala]
format = '\[[$symbol($version)]($style)\]' format = '\[[$symbol($version)]($style)\]'
[sudo]
format = '\[[as $symbol]\]
[swift] [swift]
format = '\[[$symbol($version)]($style)\]' format = '\[[$symbol($version)]($style)\]'
@ -371,6 +374,9 @@ symbol = "rs "
[scala] [scala]
symbol = "scala " symbol = "scala "
[sudo]
symbol = "sudo "
[swift] [swift]
symbol = "swift " symbol = "swift "
``` ```

View File

@ -43,35 +43,35 @@ function Invoke-Starship-PreCommand {
} }
``` ```
## Change Window Title ## Modifier le titre des fenêtres
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`. Certaines commandes du shell changeront automatiquement le titre de la fenêtre (par exemple, pour refléter votre répertoire de travail). Fish le fait même par défaut. Starship ne le fait pas, mais il est assez simple d'ajouter cette fonctionnalité à `bash` ou `zsh`.
First, define a window title change function (identical in bash and zsh): Tout d'abord, définissez une fonction de changement de titre de fenêtre (identique en bash et zsh) :
```bash ```bash
function set_win_title(){ function set_titre_fenetre(){
echo -ne "\033]0; YOUR_WINDOW_TITLE_HERE \007" echo -ne "\033]0; VOTRE_TITRE_ICI\007"
} }
``` ```
You can use variables to customize this title (`$USER`, `$HOSTNAME`, and `$PWD` are popular choices). Vous pouvez utiliser des variables pour personnaliser ce titre (`$USER`, `$HOSTNAME`, et `$PWD` sont des choix populaires).
In `bash`, set this function to be the precmd starship function: Dans `bash`, définissez cette fonction comme la fonction précommande Starship :
```bash ```bash
starship_precmd_user_func="set_win_title" starship_precmd_user_func="set_titre_fenetre"
``` ```
In `zsh`, add this to the `precmd_functions` array: Dans `zsh`, ajoutez ceci au tableau `precmd_functions` :
```bash ```bash
precmd_functions+=(set_win_title) precmd_functions+=(set_titre_fenetre)
``` ```
If you like the result, add these lines to your shell configuration file (`~/.bashrc` or `~/.zshrc`) to make it permanent. Si vous aimez le résultat, ajoutez ces lignes à votre fichier de configuration shell (`~/.bashrc` ou `~/.zshrc`) pour le rendre permanent.
For example, if you want to display your current directory in your terminal tab title, add the following snippet to your `~/.bashrc` or `~/.zshrc`: Par exemple, si vous voulez afficher votre répertoire actuel dans le titre de l'onglet de votre terminal, ajoutez le code suivant à votre `~/.bashrc` ou `~/.zshrc`:
```bash ```bash
function set_win_title(){ function set_win_title(){
@ -120,7 +120,7 @@ Produces a prompt like the following:
## Chaînes de style ## Chaînes de style
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: Les chaînes de style sont une liste de mots, séparés par des espaces blancs. Les mots ne sont pas sensibles à la casse (` bold ` et ` boLd ` sont considérés comme la même string). Chaque mot peut être l'un des suivants :
- `bold` - `bold`
- `italic` - `italic`
@ -132,14 +132,14 @@ Style strings are a list of words, separated by whitespace. The words are not ca
- `<couleur>` - `<couleur>`
- `none` - `none`
where `<color>` is a color specifier (discussed below). `fg:<color>` and `<color>` currently do the same thing, though this may change in the future. `inverted` swaps the background and foreground colors. The order of words in the string does not matter. `<color>` est un spécificateur de couleur (discuté ci-dessous). `fg:<color>` et `<color>` font actuellement la même chose, bien que cela puisse changer dans le futur. `inverted` permute les couleurs de fond et de premier plan. L'ordre des mots dans le string n'a pas d'importance.
The `none` token overrides all other tokens in a string if it is not part of a `bg:` specifier, so that e.g. `fg:red none fg:blue` will still create a string with no styling. `bg:none` sets the background to the default color so `fg:red bg:none` is equivalent to `red` or `fg:red` and `bg:green fg:red bg:none` is also equivalent to `fg:red` or `red`. It may become an error to use `none` in conjunction with other tokens in the future. La valeur `none` remplace toutes les autres valeurs si elle n'est pas incluse dans un spécificateur `bg:`, de sorte que par exemple `fg: red none fg:blue` créera une chaîne sans style. `bg:none` définit l'arrière plan sur la couleur par défaut, donc `fg:red bg:none` est équivalent à `red` ou `fg:red` et `bg:green fg:red bg:none` est aussi équivalent à `fg:red` ou `red`. Il peut devenir une erreur d'utiliser `none` en conjonction avec d'autres jetons dans le futur.
A color specifier can be one of the following: Un spécificateur de couleur peut être l'un des éléments suivants :
- Une des couleurs standard du terminal : `black`, `red`, `green`, `blue`, `yellow`, `purple`, `cyan`, `white`. Vous pouvez éventuellement les préfixer avec `bright-` pour obtenir la version lumineuse (par exemple `bright-white`). - Une des couleurs standard du terminal : `black`, `red`, `green`, `blue`, `yellow`, `purple`, `cyan`, `white`. Vous pouvez éventuellement les préfixer avec `bright-` pour obtenir la version lumineuse (par exemple `bright-white`).
- Un `#` suivi d'un nombre hexadécimal de six chiffres. Ceci spécifie un [ Code hexadécimal de couleur RVB ](https://www.w3schools.com/colors/colors_hexadecimal.asp). - Un `#` suivi d'un nombre hexadécimal de six chiffres. Ceci spécifie un [ Code hexadécimal de couleur RVB ](https://www.w3schools.com/colors/colors_hexadecimal.asp).
- Un nombre entre 0 et 255. Ceci spécifie un [code de couleur ANSI 8 bits](https://i.stack.imgur.com/KTSQa.png). - Un nombre entre 0 et 255. Ceci spécifie un [code de couleur 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. Si plusieurs couleurs sont spécifiées pour le premier plan/arrière-plan, la dernière dans le string prendra la priorité.

File diff suppressed because it is too large Load Diff

View File

@ -60,9 +60,9 @@ sh -c "$(curl -fsSL https://starship.rs/install.sh)" -- --platform unknown-linux
Starship executes different commands to get information to display in the prompt, for example the version of a program or the current git status. To make sure starship doesn't hang while trying to execute these commands we set a time limit, if a command takes longer than this limit starship will stop the execution of the command and output the above warning, this is expected behaviour. This time limit is configurable using the [`command_timeout` key](/config/#prompt) so if you want you can increase the time limit. You can also follow the debugging steps below to see which command is being slow and see if you can optimise it. Finally you can set the `STARSHIP_LOG` env var to `error` to hide these warnings. Starship executes different commands to get information to display in the prompt, for example the version of a program or the current git status. To make sure starship doesn't hang while trying to execute these commands we set a time limit, if a command takes longer than this limit starship will stop the execution of the command and output the above warning, this is expected behaviour. This time limit is configurable using the [`command_timeout` key](/config/#prompt) so if you want you can increase the time limit. You can also follow the debugging steps below to see which command is being slow and see if you can optimise it. Finally you can set the `STARSHIP_LOG` env var to `error` to hide these warnings.
## I see symbols I don't understand or expect, what do they mean? ## Je vois des symboles que je ne comprends pas et auxquels je ne m'attendais pas, que signifient-t-ils ?
If you see symbols that you don't recognise you can use `starship explain` to explain the currently showing modules. Si vous voyez des symboles que vous ne reconnaissez pas, vous pouvez utiliser `starship explain` pour obtenir des explications concernant les modules actuellement affichés.
## Starship is doing something unexpected, how can I debug it? ## Starship is doing something unexpected, how can I debug it?
@ -86,37 +86,37 @@ Finally if you find a bug you can use the `bug-report` command to create a Githu
starship bug-report starship bug-report
``` ```
## Why don't I see a glyph symbol in my prompt? ## Pourquoi ne vois-je pas de glyphe dans mon invite?
The most common cause of this is system misconfiguration. Some Linux distros in particular do not come with font support out-of-the-box. You need to ensure that: La cause la plus commune est la mauvaise configuration du système. Certaines distributions Linux ne sont pas équipées du support de police 'out of the box'. Vous devez vous assurer que:
- Votre locale est définie à une valeur UTF-8, comme `de_DE.UTF-8` ou `ja_JP.UTF-8`. Si `LC_ALL` n'est pas une valeur UTF-8, [vous aurez besoin de la modifier](https://www.tecmint.com/set-system-locales-in-linux/). - Votre locale est définie à une valeur UTF-8, comme `de_DE.UTF-8` ou `ja_JP.UTF-8`. Si `LC_ALL` n'est pas une valeur UTF-8, [vous aurez besoin de la modifier](https://www.tecmint.com/set-system-locales-in-linux/).
- Vous avez une police emoji installée. La plupart des systèmes sont fournis avec une police emoji par défaut, mais certains (notamment Arch Linux) ne le font pas. Vous pouvez habituellement en installer un par le biais du gestionnaire de paquets de votre système -[noto emoji](https://www.google.com/get/noto/help/emoji/) est un choix populaire. - Vous avez une police emoji installée. La plupart des systèmes sont fournis avec une police emoji par défaut, mais certains (notamment Arch Linux) ne le font pas. Vous pouvez habituellement en installer un par le biais du gestionnaire de paquets de votre système -[noto emoji](https://www.google.com/get/noto/help/emoji/) est un choix populaire.
- Vous utilisez une police [Nerd Font](https://www.nerdfonts.com/). - Vous utilisez une police [Nerd Font](https://www.nerdfonts.com/).
To test your system, run the following commands in a terminal: Pour tester votre système, exécutez les commandes suivantes dans un terminal :
```sh ```sh
echo -e "\xf0\x9f\x90\x8d" echo -e "\xf0\x9f\x90\x8d"
echo -e "\xee\x82\xa0" echo -e "\xee\x82\xa0"
``` ```
The first line should produce a [snake emoji](https://emojipedia.org/snake/), while the second should produce a [powerline branch symbol (e0a0)](https://github.com/ryanoasis/powerline-extra-symbols#glyphs). La première ligne doit produire un emoji [serpent](https://emojipedia.org/snake/), tandis que la seconde doit produire un symbole [de branche powerline (e0a0)](https://github.com/ryanoasis/powerline-extra-symbols#glyphs).
If either symbol fails to display correctly, your system is still misconfigured. Unfortunately, getting font configuration correct is sometimes difficult. Users on the Discord may be able to help. If both symbols display correctly, but you still don't see them in starship, [file a bug report!](https://github.com/starship/starship/issues/new/choose) Si l'un ou l'autre des symboles ne parvient pas à s'afficher correctement, votre système est toujours mal configuré. Malheureusement, il est parfois difficile d'obtenir une configuration correcte. Les utilisateurs sur Discord peuvent être en mesure d'aider. Si les deux symboles s'affichent correctement, mais vous ne les voyez toujours pas dans starship, [soumettez un rapport de bogue !](https://github.com/starship/starship/issues/new/choose)
## How do I uninstall Starship? ## Comment désinstaller Starship ?
Starship is just as easy to uninstall as it is to install in the first place. Starship est tout aussi facile à désinstaller que d'installer.
1. Supprimez les lignes de la configuration de votre shell (par exemple `~/.bashrc`) utilisées pour initialiser Starship. 1. Supprimez les lignes de la configuration de votre shell (par exemple `~/.bashrc`) utilisées pour initialiser Starship.
1. Supprimez l'exécutable de Starship. 1. Supprimez l'exécutable de Starship.
If Starship was installed using a package manager, please refer to their docs for uninstallation instructions. Si Starship a été installé à l'aide d'un gestionnaire de paquets, veuillez vous référer à leur documentation pour les instructions de désinstallation.
If Starship was installed using the install script, the following command will delete the binary: Si Starship a été installé en utilisant le script d'installation, la commande suivante supprimera l'exécutable :
```sh ```sh
# Locate and delete the starship binary # Trouver et supprimer l'exécutable starship
sh -c 'rm "$(which starship)"' sh -c 'rm "$(which starship)"'
``` ```

View File

@ -306,7 +306,7 @@ Si vous êtes intéressé pour aider et contribuer à Starship, veuillez jeter u
## 💭Inspiré par ## 💭Inspiré par
Please check out these previous works that helped inspire the creation of starship. 🙏 Jetez un œil aux précédents projets qui ont inspiré la création de starship. 🙏
- **[denysdovhan/spaceship-prompt](https://github.com/denysdovhan/spaceship-prompt)** - Une invite de commande ZSH pour les astronautes. - **[denysdovhan/spaceship-prompt](https://github.com/denysdovhan/spaceship-prompt)** - Une invite de commande ZSH pour les astronautes.
@ -316,9 +316,9 @@ Please check out these previous works that helped inspire the creation of starsh
<p align="center"> <p align="center">
<br> <br>
<img width="100" src="https://raw.githubusercontent.com/starship/starship/master/media/icon.png" alt="Starship rocket icon"> <img width="100" src="https://raw.githubusercontent.com/starship/starship/master/media/icon.png" alt="Icône de fusée de Starship">
</p> </p>
## 📝 License ## 📝 License
Copyright © 2019-present, [Starship Contributors](https://github.com/starship/starship/graphs/contributors).<br /> This project is [ISC](https://github.com/starship/starship/blob/master/LICENSE) licensed. Copyright © 2019-présent, [Contributeurs Starship](https://github.com/starship/starship/graphs/contributors).<br /> Ce projet est sous licence [ISC](https://github.com/starship/starship/blob/master/LICENSE).

View File

@ -47,7 +47,7 @@ emerge app-shells/starship
## [Nix](https://nixos.wiki/wiki/Nix) ## [Nix](https://nixos.wiki/wiki/Nix)
### Getting the Binary ### Obtention du binaire
#### Impératif #### Impératif
@ -57,14 +57,14 @@ nix-env -iA nixos.starship
#### Déclaration, utilisateur unique, via [home-manager](https://github.com/nix-community/home-manager) #### Déclaration, utilisateur unique, via [home-manager](https://github.com/nix-community/home-manager)
Enable the `programs.starship` module in your `home.nix` file, and add your settings Activez le module `programs.starship` dans votre fichier `home.nix`, et ajoutez vos paramètres
```nix ```nix
{ {
programs.starship = { programs.starship = {
enable = true; enable = true;
enableZshIntegration = true; enableZshIntegration = true;
# Configuration written to ~/.config/starship.toml # Configuration écrite dans ~/.config/starship.toml
settings = { settings = {
# add_newline = false; # add_newline = false;
@ -79,7 +79,7 @@ Enable the `programs.starship` module in your `home.nix` file, and add your sett
} }
``` ```
then run puis lancez
```sh ```sh
home-manager switch home-manager switch
@ -87,7 +87,7 @@ home-manager switch
#### Déclaration, au niveau du système, avec NixOS #### Déclaration, au niveau du système, avec NixOS
Add `pkgs.starship` to `environment.systemPackages` in your `configuration.nix`, then run Ajoutez `pkgs.starship` à `environment.systemPackages` dans votre `configuration.nix`, puis exécutez
```sh ```sh
sudo nixos-rebuild switch sudo nixos-rebuild switch

View File

@ -223,6 +223,9 @@ format = '\[[$symbol($version)]($style)\]'
[scala] [scala]
format = '\[[$symbol($version)]($style)\]' format = '\[[$symbol($version)]($style)\]'
[sudo]
format = '\[[as $symbol]\]
[swift] [swift]
format = '\[[$symbol($version)]($style)\]' format = '\[[$symbol($version)]($style)\]'
@ -371,6 +374,9 @@ symbol = "rs "
[scala] [scala]
symbol = "scala " symbol = "scala "
[sudo]
symbol = "sudo "
[swift] [swift]
symbol = "swift " symbol = "swift "
``` ```

View File

@ -43,35 +43,35 @@ function Invoke-Starship-PreCommand {
} }
``` ```
## Change Window Title ## Mengubah Judul Window
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`. Beberapa prompt shell dengan otomatis akan mengubah judul window-nya untukmu (mis. untuk merefleksikan direktori kerjamu). Fish bahkan mengaturnya sebagai bawaan. Starship tidak, tapi mudah saja untuk menambahkan fungsi tersebut ke dalam `bash` ataupun `zsh`.
First, define a window title change function (identical in bash and zsh): Pertama, buatlah fungsi untuk mengubah judul window (bekerja pada bash dan zsh):
```bash ```bash
function set_win_title(){ function set_win_title(){
echo -ne "\033]0; YOUR_WINDOW_TITLE_HERE \007" echo -ne "\033]0; JUDUL_WINDOW_MU \007"
} }
``` ```
You can use variables to customize this title (`$USER`, `$HOSTNAME`, and `$PWD` are popular choices). Kamu bisa menggunakan variabel untuk mengkustomisasi judulnya (`$USER`, `$HOSTNAME`, dan `$PWD` adalah opsi yang populer).
In `bash`, set this function to be the precmd starship function: Di dalam `bash`, atur fungsi berikut menjadi fungsi precmd untuk starship:
```bash ```bash
starship_precmd_user_func="set_win_title" starship_precmd_user_func="set_win_title"
``` ```
In `zsh`, add this to the `precmd_functions` array: Dalam `zsh`, pada array `precmd_functions`, tambahkan:
```bash ```bash
precmd_functions+=(set_win_title) precmd_functions+=(set_win_title)
``` ```
If you like the result, add these lines to your shell configuration file (`~/.bashrc` or `~/.zshrc`) to make it permanent. Kalau kamu suka hasilnya, tambahkan baris (`~/.bashrc` or `~/.zshrc`) ke dalam file konfigurasi shell milikmu untuk membuatnya permanen.
For example, if you want to display your current directory in your terminal tab title, add the following snippet to your `~/.bashrc` or `~/.zshrc`: Sebagai contoh, kalau kamu mau menampilkan lokasi direktori pada judul label terminalmu, tambahkan bagian berikut ke dalam `~/.bashrc` atau `~/.zshrc`:
```bash ```bash
function set_win_title(){ function set_win_title(){
@ -97,7 +97,7 @@ Some shells support a right prompt which renders on the same line as the input.
Note: The right prompt is a single line following the input location. To right align modules above the input line in a multi-line prompt, see the [fill module](/config/#fill). Note: The right prompt is a single line following the input location. To right align modules above the input line in a multi-line prompt, see the [fill module](/config/#fill).
`right_format` is currently supported for the following shells: elvish, fish, zsh. `right_format` saat ini hanya tersedia pada shell: elvish, fish, zsh.
### Contoh ### Contoh
@ -111,7 +111,7 @@ format = """$character"""
right_format = """$all""" right_format = """$all"""
``` ```
Produces a prompt like the following: Menghasilkan prompt seperti berikut:
``` ```
▶ starship on  rprompt [!] is 📦 v0.57.0 via 🦀 v1.54.0 took 17s ▶ starship on  rprompt [!] is 📦 v0.57.0 via 🦀 v1.54.0 took 17s
@ -120,7 +120,7 @@ Produces a prompt like the following:
## Menata String ## Menata String
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. Kumpulan katanya tidak bersifat case sensitive (mis. `tebal` dan `TeBaL` dianggap sebagai string yang sama). Tiap-tiap kata berikut adalah opsinya:
- `bold` - `bold`
- `italic` - `italic`
@ -132,14 +132,14 @@ Style strings are a list of words, separated by whitespace. The words are not ca
- `<color>` - `<color>`
- `none` - `none`
where `<color>` is a color specifier (discussed below). `fg:<color>` and `<color>` currently do the same thing, though this may change in the future. `inverted` swaps the background and foreground colors. The order of words in the string does not matter. yang mana `<color>` merupakan sebuah penentu warna (dibahas di bawah). `fg:<color>` dan `<color>` untuk saat ini memiliki fungsi yang sama, meskipun bisa berubah di kemudian hari. `inverted` menggantikan warna pada latar depan dan belakang. Urutan kata pada string tidak jadi masalah.
The `none` token overrides all other tokens in a string if it is not part of a `bg:` specifier, so that e.g. `fg:red none fg:blue` will still create a string with no styling. `bg:none` sets the background to the default color so `fg:red bg:none` is equivalent to `red` or `fg:red` and `bg:green fg:red bg:none` is also equivalent to `fg:red` or `red`. It may become an error to use `none` in conjunction with other tokens in the future. `none` bisa menimpa nilai token lainnya di dalam string jika Ia tidak termaksud dalam penentu warna pada `bg:` sebagai contoh, `fg:red none fg:blue` akan tetap menjadi string yang tidak memiliki penataan. `bg:none` menjadikan warna pada latar belakang sebagai warna bawaan. Jadi, nilai `fg:red bg:none` sama dengan `red` atau `fg:red` dan nilai `bg:green fg:red bg:none` juga sama dengan `fg:red` ataupun `red`. Mungkin akan jadi masalah untuk menggunakan `none` dengan token lainnya di kemudian hari.
A color specifier can be one of the following: Penentuan warna bisa dilakukan dengan salah satu cara berikut:
- Warna terminal pada umumnya terdiri dari: `black`, `red`, `green`, `blue`, `yellow`, `purple`, `cyan`, `white`. Untuk memperoleh varian warna yang lebih cerah, kamu dapat menggunakan token `bright-` (mis. `bright-white`). - Warna terminal pada umumnya terdiri dari: `black`, `red`, `green`, `blue`, `yellow`, `purple`, `cyan`, `white`. Untuk memperoleh varian warna yang lebih cerah, kamu dapat menggunakan token `bright-` (mis. `bright-white`).
- Menuliskannya dengan menggunakan `#` dan diikuti oleh enam digit angka hexadesimal. Spesifikasi [kode heksadesimal pada warna RGB](https://www.w3schools.com/colors/colors_hexadecimal.asp). - Menuliskannya dengan menggunakan `#` dan diikuti oleh enam digit angka hexadesimal. Spesifikasi [kode heksadesimal pada warna RGB](https://www.w3schools.com/colors/colors_hexadecimal.asp).
- Menggunakan bilangan antara 0-255. Spesifikasi [8-bit Kode Warna ANSI](https://i.stack.imgur.com/KTSQa.png). - Menggunakan bilangan antara 0-255. Spesifikasi [8-bit Kode Warna ANSI](https://i.stack.imgur.com/KTSQa.png).
If multiple colors are specified for foreground/background, the last one in the string will take priority. Jika warna yang dipakai pada latar depan/latar belakang banyak, maka warna yang terbaru pada string yang akan diprioritaskan.

File diff suppressed because it is too large Load Diff

View File

@ -223,6 +223,9 @@ format = '\[[$symbol($version)]($style)\]'
[scala] [scala]
format = '\[[$symbol($version)]($style)\]' format = '\[[$symbol($version)]($style)\]'
[sudo]
format = '\[[as $symbol]\]
[swift] [swift]
format = '\[[$symbol($version)]($style)\]' format = '\[[$symbol($version)]($style)\]'
@ -371,6 +374,9 @@ symbol = "rs "
[scala] [scala]
symbol = "scala " symbol = "scala "
[sudo]
symbol = "sudo "
[swift] [swift]
symbol = "swift " symbol = "swift "
``` ```

View File

@ -43,35 +43,35 @@ function Invoke-Starship-PreCommand {
} }
``` ```
## Change Window Title ## Cambia il titolo della finestra
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`. Alcune shell prompt cambieranno automaticamente il titolo della finestra (ad esempio per riflettere la directory di lavoro). Fish lo fa per impostazione predefinita. Starship non lo fa, ma è abbastanza semplice aggiungere questa funzionalità a `bash` o `zsh`.
First, define a window title change function (identical in bash and zsh): Innanzitutto, bisogna definire una funzione per il cambio del titolo della finestra (identica sia per bash che zsh):
```bash ```bash
function set_win_title(){ function set_win_title(){
echo -ne "\033]0; YOUR_WINDOW_TITLE_HERE \007" echo -ne "\033]0; IL_TUO_TITOLO_QUI \007"
} }
``` ```
You can use variables to customize this title (`$USER`, `$HOSTNAME`, and `$PWD` are popular choices). Puoi usare delle variabili per personalizzare questo titolo (`$USER`, `$HOSTNAME`, e `$PWD` sono le scelte più popolari).
In `bash`, set this function to be the precmd starship function: In `bash`, impostare questa funzione per essere la precmd Starship function:
```bash ```bash
starship_precmd_user_func="set_win_title" starship_precmd_user_func="set_win_title"
``` ```
In `zsh`, add this to the `precmd_functions` array: In `zsh`, aggiungi questo `precmd_functions` all'array:
```bash ```bash
precmd_functions+=(set_win_title) precmd_functions+=(set_win_title)
``` ```
If you like the result, add these lines to your shell configuration file (`~/.bashrc` or `~/.zshrc`) to make it permanent. Se ti piace il risultato, aggiungi queste righe al tuo file shell di configurazione (`~/.bashrc` o `~/.zshrc`) per renderlo permanente.
For example, if you want to display your current directory in your terminal tab title, add the following snippet to your `~/.bashrc` or `~/.zshrc`: Ad esempio, se desideri visualizzare la directory corrente nel titolo della scheda del terminale, aggiungi la seguente snippet al tuo `~/.bashrc` or `~/.zshrc`:
```bash ```bash
function set_win_title(){ function set_win_title(){
@ -120,7 +120,7 @@ Produces a prompt like the following:
## Stile delle Stringhe ## Stile delle Stringhe
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: Le stringhe di stile sono un elenco di parole, separate da spazi bianchi. Le parole non sono sensibili alle maiuscole (cioè `grassetto` e `BoLd` sono considerate la stessa stringa). Ogni parola può essere una delle seguenti:
- `bold` - `bold`
- `italic` - `italic`
@ -132,14 +132,14 @@ Style strings are a list of words, separated by whitespace. The words are not ca
- `<color>` - `<color>`
- `none` - `none`
where `<color>` is a color specifier (discussed below). `fg:<color>` and `<color>` currently do the same thing, though this may change in the future. `inverted` swaps the background and foreground colors. The order of words in the string does not matter. dove `<color>` è un colore specifico (discusso in seguito). `fg:<color>` e `<color>` attualmente fanno la stessa cosa, anche se questo potrebbe cambiare in futuro. `inverted` scambia lo sfondo e i colori in primo piano. L'ordine delle parole nella stringa non conta.
The `none` token overrides all other tokens in a string if it is not part of a `bg:` specifier, so that e.g. `fg:red none fg:blue` will still create a string with no styling. `bg:none` sets the background to the default color so `fg:red bg:none` is equivalent to `red` or `fg:red` and `bg:green fg:red bg:none` is also equivalent to `fg:red` or `red`. It may become an error to use `none` in conjunction with other tokens in the future. Il token `none` sovrascrive tutti gli altri token in una stringa se non fa parte di uno specificatore `bg:`, così ad esempio `fg:red none fg:blue` creerà una stringa senza stile. `bg:none` imposta come colore di sfondo quello predefinito così `fg:red bg:none` è equivalente a `red` o `fg:red` e `bg:green fg:red bg:none` è equivalente a `fg:red` o `red`. Potrà diventare un errore usare `none` in combinazione con altri token in futuro.
A color specifier can be one of the following: Uno colore specifico può essere uno di questi:
- Uno dei colori standard del terminale: `nero`, `rosso`, `verde`, `blu`, `giallo`, `viola`, `ciano`, `bianco`. Puoi eventualmente utilizzare il prefisso `bright-` per ottenere la versione luminosa (es. `bright-white`). - Uno dei colori standard del terminale: `nero`, `rosso`, `verde`, `blu`, `giallo`, `viola`, `ciano`, `bianco`. Puoi eventualmente utilizzare il prefisso `bright-` per ottenere la versione luminosa (es. `bright-white`).
- Un `#` seguito da un valore esadecimale a sei cifre. Questo specifica un [colore esagesimale in RGB](https://www.w3schools.com/colors/colors_hexadecimal.asp). - Un `#` seguito da un valore esadecimale a sei cifre. Questo specifica un [colore esagesimale in RGB](https://www.w3schools.com/colors/colors_hexadecimal.asp).
- Un numero compreso tra 0-255. Specifica un [codice colore ANSI a 8 bit](https://i.stack.imgur.com/KTSQa.png). - Un numero compreso tra 0-255. Specifica un [codice colore ANSI a 8 bit](https://i.stack.imgur.com/KTSQa.png).
If multiple colors are specified for foreground/background, the last one in the string will take priority. Se sono specificati più colori per il primo piano/sfondo, l'ultimo nella stringa avrà la priorità.

File diff suppressed because it is too large Load Diff

View File

@ -60,9 +60,9 @@ sh -c "$(curl -fsSL https://starship.rs/install.sh)" -- --platform unknown-linux
Starship executes different commands to get information to display in the prompt, for example the version of a program or the current git status. To make sure starship doesn't hang while trying to execute these commands we set a time limit, if a command takes longer than this limit starship will stop the execution of the command and output the above warning, this is expected behaviour. This time limit is configurable using the [`command_timeout` key](/config/#prompt) so if you want you can increase the time limit. You can also follow the debugging steps below to see which command is being slow and see if you can optimise it. Finally you can set the `STARSHIP_LOG` env var to `error` to hide these warnings. Starship executes different commands to get information to display in the prompt, for example the version of a program or the current git status. To make sure starship doesn't hang while trying to execute these commands we set a time limit, if a command takes longer than this limit starship will stop the execution of the command and output the above warning, this is expected behaviour. This time limit is configurable using the [`command_timeout` key](/config/#prompt) so if you want you can increase the time limit. You can also follow the debugging steps below to see which command is being slow and see if you can optimise it. Finally you can set the `STARSHIP_LOG` env var to `error` to hide these warnings.
## I see symbols I don't understand or expect, what do they mean? ## Vedo simboli che non capisco o mi aspetto, cosa significano?
If you see symbols that you don't recognise you can use `starship explain` to explain the currently showing modules. Se vedi simboli che non riconosci puoi usare `starship explain` per la spiegazione dei moduli correntemente mostrato.
## Starship is doing something unexpected, how can I debug it? ## Starship is doing something unexpected, how can I debug it?
@ -86,37 +86,37 @@ Finally if you find a bug you can use the `bug-report` command to create a Githu
starship bug-report starship bug-report
``` ```
## Why don't I see a glyph symbol in my prompt? ## Perché non vedo un simbolo di glifo nel mio prompt?
The most common cause of this is system misconfiguration. Some Linux distros in particular do not come with font support out-of-the-box. You need to ensure that: La causa più comune è la configurazione errata del sistema. Alcune distribuzioni Linux in particolare non vengono fornite con il supporto dei font come impostazione predefinita. È necessario assicurarsi che:
- In locale sia impostato un valore UTF-8, come `de_DE.UTF-8` o `ja_JP.UTF-8`. Se `LC_ALL` non è un valore UTF-8, [dovrai cambiarlo](https://www.tecmint.com/set-system-locales-in-linux/). - In locale sia impostato un valore UTF-8, come `de_DE.UTF-8` o `ja_JP.UTF-8`. Se `LC_ALL` non è un valore UTF-8, [dovrai cambiarlo](https://www.tecmint.com/set-system-locales-in-linux/).
- Hai un font emoji installato. La maggior parte dei sistemi ha un font emoji per impostazione predefinita, ma alcuni (in particolare Arch Linux) non lo fanno. Di solito puoi installarne uno attraverso il gestore dei pacchetti del tuo sistema-[noto emoji](https://www.google.com/get/noto/help/emoji/) è uno dei popolari. - Hai un font emoji installato. La maggior parte dei sistemi ha un font emoji per impostazione predefinita, ma alcuni (in particolare Arch Linux) non lo fanno. Di solito puoi installarne uno attraverso il gestore dei pacchetti del tuo sistema-[noto emoji](https://www.google.com/get/noto/help/emoji/) è uno dei popolari.
- Stai usando un [font Nerd](https://www.nerdfonts.com/). - Stai usando un [font Nerd](https://www.nerdfonts.com/).
To test your system, run the following commands in a terminal: Per testare il sistema, eseguire i seguenti comandi in un terminale:
```sh ```sh
echo -e "\xf0\x9f\x90\x8d" echo -e "\xf0\x9f\x90\x8d"
echo -e "\xee\x82\xa0" echo -e "\xee\x82\xa0"
``` ```
The first line should produce a [snake emoji](https://emojipedia.org/snake/), while the second should produce a [powerline branch symbol (e0a0)](https://github.com/ryanoasis/powerline-extra-symbols#glyphs). La prima riga dovrebbe riprodurre una [emoji di un serpente](https://emojipedia.org/snake/), mentre la seconda dovrebbe riprodurre il [simbolo powerline di ramo (e0a0)](https://github.com/ryanoasis/powerline-extra-symbols#glyphs).
If either symbol fails to display correctly, your system is still misconfigured. Unfortunately, getting font configuration correct is sometimes difficult. Users on the Discord may be able to help. If both symbols display correctly, but you still don't see them in starship, [file a bug report!](https://github.com/starship/starship/issues/new/choose) Se uno dei due simboli non viene visualizzato correttamente, il sistema è ancora mal configurato. Sfortunatamente, ottenere la configurazione dei caratteri corretta a volte è difficile. Gli utenti su Discord potrebbero essere in grado di aiutarti. Se entrambi i simboli vengono visualizzati correttamente, ma non li vedi ancora in starship, [segnala un bug!](https://github.com/starship/starship/issues/new/choose)
## How do I uninstall Starship? ## Come posso disinstallare Starship?
Starship is just as easy to uninstall as it is to install in the first place. Starship è altrettanto facile da disinstallare come lo è da installare.
1. Rimuovi qualsiasi riga utilizzata per inizializzare Starship nella configurazione della tua shell (ad es. `~/.bashrc`). 1. Rimuovi qualsiasi riga utilizzata per inizializzare Starship nella configurazione della tua shell (ad es. `~/.bashrc`).
1. Elimina il binario di Starship. 1. Elimina il binario di Starship.
If Starship was installed using a package manager, please refer to their docs for uninstallation instructions. Se Starship è stato installato utilizzando un gestore di pacchetti, fai riferimento alla documentazione per le istruzioni di disinstallazione.
If Starship was installed using the install script, the following command will delete the binary: Se Starship è stato installato utilizzando lo script di installazione, il seguente comando eliminerà il file binario:
```sh ```sh
# Locate and delete the starship binary # Individua ed elimina il binario di starship
sh -c 'rm "$(which starship)"' sh -c 'rm "$(which starship)"'
``` ```

View File

@ -306,7 +306,7 @@ Se sei interessato ad aiutare a contribuire a Starship, dai un'occhiata alla nos
## 💭 Ispirato Da ## 💭 Ispirato Da
Please check out these previous works that helped inspire the creation of starship. 🙏 Ti invito di controllare questi lavori precedenti che hanno contribuito a ispirare la creazione di Starship. 🙏
- **[denysdovhan/spaceship-prompt](https://github.com/denysdovhan/spaceship-prompt)** - Un prompt ZSH per astronauti. - **[denysdovhan/spaceship-prompt](https://github.com/denysdovhan/spaceship-prompt)** - Un prompt ZSH per astronauti.
@ -321,4 +321,4 @@ Please check out these previous works that helped inspire the creation of starsh
## 📝 Licenza ## 📝 Licenza
Copyright © 2019-present, [Starship Contributors](https://github.com/starship/starship/graphs/contributors).<br /> This project is [ISC](https://github.com/starship/starship/blob/master/LICENSE) licensed. Copyright © 2019-presente, [Starship Contributors](https://github.com/starship/starship/graphs/contributors).<br /> Questo progetto è sotto licenza [ISC](https://github.com/starship/starship/blob/master/LICENSE).

View File

@ -47,7 +47,7 @@ emerge app-shells/starship
## [Nix](https://nixos.wiki/wiki/Nix) ## [Nix](https://nixos.wiki/wiki/Nix)
### Getting the Binary ### Ottenere il Binario
#### Imperativo #### Imperativo
@ -57,7 +57,7 @@ nix-env -iA nixos.starship
#### Dichiarativo, singolo utente, tramite [home-manager](https://github.com/nix-community/home-manager) #### Dichiarativo, singolo utente, tramite [home-manager](https://github.com/nix-community/home-manager)
Enable the `programs.starship` module in your `home.nix` file, and add your settings Abilita il modulo `programs.starship` nel tuo file `home.nix` e aggiungi le tue impostazioni
```nix ```nix
{ {
@ -79,7 +79,7 @@ Enable the `programs.starship` module in your `home.nix` file, and add your sett
} }
``` ```
then run poi eseguire
```sh ```sh
home-manager switch home-manager switch
@ -87,7 +87,7 @@ home-manager switch
#### Dichiarativa, di sistema, con NixOS #### Dichiarativa, di sistema, con NixOS
Add `pkgs.starship` to `environment.systemPackages` in your `configuration.nix`, then run Aggiungi `pkgs.starship` a `environment.systemPackages` in `configuration.nix`, poi esegui
```sh ```sh
sudo nixos-rebuild switch sudo nixos-rebuild switch

View File

@ -223,6 +223,9 @@ format = '\[[$symbol($version)]($style)\]'
[scala] [scala]
format = '\[[$symbol($version)]($style)\]' format = '\[[$symbol($version)]($style)\]'
[sudo]
format = '\[[as $symbol]\]
[swift] [swift]
format = '\[[$symbol($version)]($style)\]' format = '\[[$symbol($version)]($style)\]'
@ -371,6 +374,9 @@ symbol = "rs "
[scala] [scala]
symbol = "scala " symbol = "scala "
[sudo]
symbol = "sudo "
[swift] [swift]
symbol = "swift " symbol = "swift "
``` ```

View File

@ -43,11 +43,11 @@ function Invoke-Starship-PreCommand {
} }
``` ```
## Change Window Title ## ウィンドウのタイトルの変更
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`. いくつかのシェルプロンプトはあなたのためにウィンドウのタイトルを自動的に変更します(例えば、カレントディレクトリを反映するために)。 特に Fish はデフォルトで変更を行います。 Starship はこれをしませんが、この機能を `bash``zsh` に追加することは簡単にできます。
First, define a window title change function (identical in bash and zsh): まず、ウィンドウのタイトルを変更する関数を定義してください( bash も zsh も同様に)
```bash ```bash
function set_win_title(){ function set_win_title(){
@ -55,23 +55,23 @@ function set_win_title(){
} }
``` ```
You can use variables to customize this title (`$USER`, `$HOSTNAME`, and `$PWD` are popular choices). タイトルをカスタマイズするために変数を利用することができます (`$USER` 、 `$HOSTNAME``$PWD` が一般的です)。
In `bash`, set this function to be the precmd starship function: `bash` では関数を starship の precmd 関数としてセットしてください。
```bash ```bash
starship_precmd_user_func="set_win_title" starship_precmd_user_func="set_win_title"
``` ```
In `zsh`, add this to the `precmd_functions` array: `zsh`では関数を `precmd_functions` の配列に追加してください。
```bash ```bash
precmd_functions+=(set_win_title) precmd_functions+=(set_win_title)
``` ```
If you like the result, add these lines to your shell configuration file (`~/.bashrc` or `~/.zshrc`) to make it permanent. もし結果に満足したら、永続化のためそれぞれの行をシェルの設定ファイル (`~/.bashrc` もしくは `~/.zshrc`) に追加してください。
For example, if you want to display your current directory in your terminal tab title, add the following snippet to your `~/.bashrc` or `~/.zshrc`: たとえば、現在のディレクトリをターミナルタブのタイトルに表示したい場合は、 `~/.bashrc`または`~/.zshrc`に以下のスニペットを追加します。
```bash ```bash
function set_win_title(){ function set_win_title(){
@ -120,7 +120,7 @@ right_format = """$all"""
## スタイルの設定 ## スタイルの設定
Style strings are a list of words, separated by whitespace. The words are not case sensitive (i.e. `bold` and `BoLd` are considered the same string). Each word can be one of the following: スタイル文字列は空白で区切られた単語のリストです。 大文字小文字を区別しません(例えば、 `bold` と`BoLd` は同じだとみなされます)。 それぞれ以下のいずれか一つが該当します。
- `bold` - `bold`
- `italic` - `italic`
@ -132,14 +132,14 @@ Style strings are a list of words, separated by whitespace. The words are not ca
- `<color>` - `<color>`
- `none` - `none`
where `<color>` is a color specifier (discussed below). `fg:<color>` and `<color>` currently do the same thing, though this may change in the future. `inverted` swaps the background and foreground colors. The order of words in the string does not matter. ここで、 `<color>` は色を指定します(以下で述べます)。 現在 `fg:<color>``<color>` は同様の動作ですが、将来変更される可能性があります。 `inverted` は背景と前景の色を交換します。 文字列中の単語の順序は関係ありません。
The `none` token overrides all other tokens in a string if it is not part of a `bg:` specifier, so that e.g. `fg:red none fg:blue` will still create a string with no styling. `bg:none` sets the background to the default color so `fg:red bg:none` is equivalent to `red` or `fg:red` and `bg:green fg:red bg:none` is also equivalent to `fg:red` or `red`. It may become an error to use `none` in conjunction with other tokens in the future. `none` トークンは、文字列中の`bg:` 指定子の一部でない場合、他のすべてのトークンをオーバーライドします。そのため、たとえば、`fg:red none fg:blue` と指定した場合、スタイルなしの文字列が作られます。 `bg:none` は背景色をデフォルトの色にセットするので、`fg:red bg:none` は `red``fg:red` と同じ意味になり、`bg:green fg:red bg:none` も `fg:red``red` と同じ意味になります。 将来 `none` を他の単語と一緒に使用することはエラーになるかもしれません。
A color specifier can be one of the following: 色は以下のいずれか1つを指定できます。
- 標準的なターミナルカラーの `black``red``green``blue``yellow``purple``cyan``white`。 必要に応じて、より明るい色を得るために `bright-` を前につけることができます。(例えば、 `bright-white` - 標準的なターミナルカラーの `black``red``green``blue``yellow``purple``cyan``white`。 必要に応じて、より明るい色を得るために `bright-` を前につけることができます。(例えば、 `bright-white`
- `#` に続く16進数。 [RGB の16進数カラーコード](https://www.w3schools.com/colors/colors_hexadecimal.asp)を表します。 - `#` に続く16進数。 [RGB の16進数カラーコード](https://www.w3schools.com/colors/colors_hexadecimal.asp)を表します。
- 0-255 までの間の数字。 [8-bit ANSI カラーコード](https://i.stack.imgur.com/KTSQa.png) を表します。 - 0-255 までの間の数字。 [8-bit ANSI カラーコード](https://i.stack.imgur.com/KTSQa.png) を表します。
If multiple colors are specified for foreground/background, the last one in the string will take priority. 複数の色が文字色/背景色に指定された際には、最後の指定が優先して選ばれます。

File diff suppressed because it is too large Load Diff

View File

@ -60,9 +60,9 @@ sh -c "$(curl -fsSL https://starship.rs/install.sh)" -- --platform unknown-linux
Starship executes different commands to get information to display in the prompt, for example the version of a program or the current git status. To make sure starship doesn't hang while trying to execute these commands we set a time limit, if a command takes longer than this limit starship will stop the execution of the command and output the above warning, this is expected behaviour. This time limit is configurable using the [`command_timeout` key](/config/#prompt) so if you want you can increase the time limit. You can also follow the debugging steps below to see which command is being slow and see if you can optimise it. Finally you can set the `STARSHIP_LOG` env var to `error` to hide these warnings. Starship executes different commands to get information to display in the prompt, for example the version of a program or the current git status. To make sure starship doesn't hang while trying to execute these commands we set a time limit, if a command takes longer than this limit starship will stop the execution of the command and output the above warning, this is expected behaviour. This time limit is configurable using the [`command_timeout` key](/config/#prompt) so if you want you can increase the time limit. You can also follow the debugging steps below to see which command is being slow and see if you can optimise it. Finally you can set the `STARSHIP_LOG` env var to `error` to hide these warnings.
## I see symbols I don't understand or expect, what do they mean? ## よくわからない記号を見つけました。これはどういった意味ですか?
If you see symbols that you don't recognise you can use `starship explain` to explain the currently showing modules. 不明な記号に遭遇した場合、`starship explain` を使用することで、現在表示しているモジュールの説明を見ることができます。
## Starship is doing something unexpected, how can I debug it? ## Starship is doing something unexpected, how can I debug it?
@ -86,37 +86,37 @@ Finally if you find a bug you can use the `bug-report` command to create a Githu
starship bug-report starship bug-report
``` ```
## Why don't I see a glyph symbol in my prompt? ## プロンプトにグリフ記号が表示されないのはなぜですか?
The most common cause of this is system misconfiguration. Some Linux distros in particular do not come with font support out-of-the-box. You need to ensure that: これの最も一般的な原因は、システムの設定ミスです。 いくつかのLinuxディストリビューション 特に、すぐに使用できるフォントサポートは付属していません。 次のことを確認する必要があります。
- ロケールが、`de_DE.UTF-8`や` ja_JP.UTF-8`などのUTF-8に設定されている。 `LC_ALL`がUTF-8でない場合、[変更する必要があります](https://www.tecmint.com/set-system-locales-in-linux/)。 - ロケールが、`de_DE.UTF-8`や` ja_JP.UTF-8`などのUTF-8に設定されている。 `LC_ALL`がUTF-8でない場合、[変更する必要があります](https://www.tecmint.com/set-system-locales-in-linux/)。
- 絵文字フォントがインストールされている。 ほとんどのシステムにはデフォルトで絵文字フォントが付属していますが、 一部 (特にArch Linux) はそうではありません。 通常、システムの パッケージマネージャーからインストールすることができます。--[noto emoji](https://www.google.com/get/noto/help/emoji/)は一般的な選択肢です。 - 絵文字フォントがインストールされている。 ほとんどのシステムにはデフォルトで絵文字フォントが付属していますが、 一部 (特にArch Linux) はそうではありません。 通常、システムの パッケージマネージャーからインストールすることができます。--[noto emoji](https://www.google.com/get/noto/help/emoji/)は一般的な選択肢です。
- [Nerd Font](https://www.nerdfonts.com/)を使用している。 - [Nerd Font](https://www.nerdfonts.com/)を使用している。
To test your system, run the following commands in a terminal: システムをテストするには、ターミナルで次のコマンドを実行します。
```sh ```sh
echo -e "\xf0\x9f\x90\x8d" echo -e "\xf0\x9f\x90\x8d"
echo -e "\xee\x82\xa0" echo -e "\xee\x82\xa0"
``` ```
The first line should produce a [snake emoji](https://emojipedia.org/snake/), while the second should produce a [powerline branch symbol (e0a0)](https://github.com/ryanoasis/powerline-extra-symbols#glyphs). 1行目は[snake emoji](https://emojipedia.org/snake/)を生成し、2行目は[powerline branch symbol (e0a0)](https://github.com/ryanoasis/powerline-extra-symbols#glyphs)を生成するはずです。
If either symbol fails to display correctly, your system is still misconfigured. Unfortunately, getting font configuration correct is sometimes difficult. Users on the Discord may be able to help. If both symbols display correctly, but you still don't see them in starship, [file a bug report!](https://github.com/starship/starship/issues/new/choose) いずれかのシンボルが正しく表示されない場合でも、システムの設定が間違っています。 残念ながら、フォント設定を正しくするのは難しい場合があります。 Discordのユーザーがお役に立てるかもしれません。 両方の記号が正しく表示されているにもかかわらず、まだStarshipに表示されていない場合は、[バグ報告をしてください!](https://github.com/starship/starship/issues/new/choose)
## How do I uninstall Starship? ## Starshipをアンインストールするにはどうすればいいですか?
Starship is just as easy to uninstall as it is to install in the first place. Starshipは、最初の場所にインストールするのと同じくらい簡単にアンインストールできます。
1. Starshipを初期化するために使用した、シェルの設定行を削除します (例:`~/.bashrc`)。 1. Starshipを初期化するために使用した、シェルの設定行を削除します (例:`~/.bashrc`)。
1. Starshipのバイナリを削除します。 1. Starshipのバイナリを削除します。
If Starship was installed using a package manager, please refer to their docs for uninstallation instructions. Starship がパッケージマネージャを使用してインストールされている場合は、アンインストール手順については、そのドキュメントを参照してください。
If Starship was installed using the install script, the following command will delete the binary: Starship をインストールスクリプトを使用してインストールした場合、次のコマンドでバイナリが削除されます。
```sh ```sh
# Locate and delete the starship binary # starshipバイナリを見つけて削除
sh -c 'rm "$(which starship)"' sh -c 'rm "$(which starship)"''
``` ```

View File

@ -306,7 +306,7 @@
## 💭影響を受けたプロダクト ## 💭影響を受けたプロダクト
Please check out these previous works that helped inspire the creation of starship. 🙏 よければStarship の作成に影響を与えた、これまでのプロジェクトをチェックしてください 🙏
- **[denysdovhan/spaceship-prompt](https://github.com/denysdovhan/spaceship-prompt)** - 宇宙飛行士のための ZSH プロンプト。 - **[denysdovhan/spaceship-prompt](https://github.com/denysdovhan/spaceship-prompt)** - 宇宙飛行士のための ZSH プロンプト。
@ -321,4 +321,4 @@ Please check out these previous works that helped inspire the creation of starsh
## 📝 ライセンス ## 📝 ライセンス
Copyright © 2019-present, [Starship Contributors](https://github.com/starship/starship/graphs/contributors).<br /> This project is [ISC](https://github.com/starship/starship/blob/master/LICENSE) licensed. Copyright © 2019-present, [Starship Contributors](https://github.com/starship/starship/graphs/contributors).<br /> このプロジェクトは [ISC](https://github.com/starship/starship/blob/master/LICENSE) でライセンスされています。

View File

@ -47,7 +47,7 @@ emerge app-shells/starship
## [Nix](https://nixos.wiki/wiki/Nix) ## [Nix](https://nixos.wiki/wiki/Nix)
### Getting the Binary ### バイナリの取得
#### Imperatively #### Imperatively
@ -57,14 +57,14 @@ nix-env -iA nixos.starship
#### Declarative, single user, via [home-manager](https://github.com/nix-community/home-manager) #### Declarative, single user, via [home-manager](https://github.com/nix-community/home-manager)
Enable the `programs.starship` module in your `home.nix` file, and add your settings `home.nix`ファイルで`programs.starship`を有効にして、設定を追加してください。
```nix ```nix
{ {
programs.starship = { programs.starship = {
enable = true; enable = true;
enableZshIntegration = true; enableZshIntegration = true;
# Configuration written to ~/.config/starship.toml # ~/.config/starship.toml に書き込まれる設定
settings = { settings = {
# add_newline = false; # add_newline = false;
@ -79,7 +79,7 @@ Enable the `programs.starship` module in your `home.nix` file, and add your sett
} }
``` ```
then run そして、次を実行してください
```sh ```sh
home-manager switch home-manager switch
@ -87,7 +87,7 @@ home-manager switch
#### Declarative, system-wide, with NixOS #### Declarative, system-wide, with NixOS
Add `pkgs.starship` to `environment.systemPackages` in your `configuration.nix`, then run `configuration.nix`で`environment.systemPackages`に`pkgs.starship`を追加して、次を実行してください
```sh ```sh
sudo nixos-rebuild switch sudo nixos-rebuild switch

View File

@ -223,6 +223,9 @@ format = '\[[$symbol($version)]($style)\]'
[scala] [scala]
format = '\[[$symbol($version)]($style)\]' format = '\[[$symbol($version)]($style)\]'
[sudo]
format = '\[[as $symbol]\]
[swift] [swift]
format = '\[[$symbol($version)]($style)\]' format = '\[[$symbol($version)]($style)\]'
@ -371,6 +374,9 @@ symbol = "rs "
[scala] [scala]
symbol = "scala " symbol = "scala "
[sudo]
symbol = "sudo "
[swift] [swift]
symbol = "swift " symbol = "swift "
``` ```

View File

@ -61,7 +61,7 @@ Format strings are the format that a module prints all its variables with. Most
#### Variable #### Variable
A variable contains a `$` symbol followed by the name of the variable. The name of a variable only contains letters, numbers and `_`. A variable contains a `$` symbol followed by the name of the variable. The name of a variable can only contain letters, numbers and `_`.
For example: For example:
@ -106,18 +106,11 @@ For example:
- `(some text)` will always show nothing since there are no variables wrapped in the braces. - `(some text)` will always show nothing since there are no variables wrapped in the braces.
- When `$all` is a shortcut for `\[$a$b\]`, `($all)` will show nothing only if `$a` and `$b` are both `None`. This works the same as `(\[$a$b\] )`. - When `$all` is a shortcut for `\[$a$b\]`, `($all)` will show nothing only if `$a` and `$b` are both `None`. This works the same as `(\[$a$b\] )`.
#### Escapable characters #### Special characters
The following symbols have special usage in a format string. If you want to print the following symbols, you have to escape them with a backslash (`\`). The following symbols have special usage in a format string and must be escaped: `$ \ [ ] ( )`.
- \$ Note that TOML has [both basic strings and literal strings](https://toml.io/en/v1.0.0#string). It is recommended to use a literal string (surrounded by single quotes) in your config. If you want to use a basic string (surrounded by double quotes), you must escape the backslash itself (i.e. use `\\`).
- \\
- [
- ]
- (
- )
Note that `toml` has [its own escape syntax](https://github.com/toml-lang/toml#user-content-string). It is recommended to use a literal string (`''`) in your config. If you want to use a basic string (`""`), pay attention to escape the backslash `\`.
For example, when you want to print a `$` symbol on a new line, the following configs for `format` are equivalent: For example, when you want to print a `$` symbol on a new line, the following configs for `format` are equivalent:
@ -231,9 +224,11 @@ $memory_usage\
$aws\ $aws\
$gcloud\ $gcloud\
$openstack\ $openstack\
$azure\
$env_var\ $env_var\
$crystal\ $crystal\
$custom\ $custom\
$sudo\
$cmd_duration\ $cmd_duration\
$line_break\ $line_break\
$jobs\ $jobs\
@ -325,6 +320,31 @@ style = "bold blue"
symbol = "🅰 " symbol = "🅰 "
``` ```
## Azure
The `azure` module shows the current Azure Subscription. This is based on showing the name of the default subscription, as defined in the `~/.azure/azureProfile.json` file.
### Options
| Variable | Default | Description |
| ---------- | ---------------------------------------- | ------------------------------------------ |
| `format` | `"on [$symbol($subscription)]($style) "` | The format for the Azure module to render. |
| `symbol` | `"ﴃ "` | The symbol used in the format. |
| `style` | `"blue bold"` | The style used in the format. |
| `disabled` | `true` | Disables the `azure` module. |
### Example
```toml
# ~/.config/starship.toml
[azure]
disabled = false
format = "on [$symbol($subscription)]($style) "
symbol = "ﴃ "
style = "blue bold"
```
## Battery ## Battery
The `battery` module shows how charged the device's battery is and its current charging status. The module is only visible when the device's battery is below 10%. The `battery` module shows how charged the device's battery is and its current charging status. The module is only visible when the device's battery is below 10%.
@ -2129,6 +2149,7 @@ The `package` module is shown when the current directory is the repository for a
- [**Meson**](https://mesonbuild.com/) - The `meson` package version is extracted from the `meson.build` present - [**Meson**](https://mesonbuild.com/) - The `meson` package version is extracted from the `meson.build` present
- [**Shards**](https://crystal-lang.org/reference/the_shards_command/index.html) - The `shards` package version is extracted from the `shard.yml` present - [**Shards**](https://crystal-lang.org/reference/the_shards_command/index.html) - The `shards` package version is extracted from the `shard.yml` present
- [**V**](https://vlang.io) - The `vlang` package version is extracted from the `v.mod` present - [**V**](https://vlang.io) - The `vlang` package version is extracted from the `v.mod` present
- [**SBT**](https://scala-sbt.org) - The `sbt` package version is extracted from the `build.sbt` present in the current directory
> ⚠️ The version being shown is that of the package whose source code is in your current directory, not your package manager. > ⚠️ The version being shown is that of the package whose source code is in your current directory, not your package manager.
@ -2809,6 +2830,56 @@ disabled = false
``` ```
## Sudo
The `sudo` module displays if sudo credentials are currently cached. The module will only be shown if credentials are cached.
::: tip
This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
:::
### Options
| Option | Default | Description |
| --------------- | ----------------------- | ------------------------------------------------------- |
| `format` | `[as $symbol]($style)"` | The format of the module |
| `symbol` | `"🧙 "` | The symbol displayed when credentials are cached |
| `style` | `"bold blue"` | The style for the module. |
| `allow_windows` | `false` | Since windows has no default sudo, default is disabled. |
| `disabled` | `true` | Disables the `sudo` module. |
### Variables
| Variable | Example | Description |
| --------- | ------- | ------------------------------------ |
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
### Example
```toml
# ~/.config/starship.toml
[sudo]
style = "bold green"
symbol = "👩‍💻 "
disabled = false
```
```toml
# On windows
# $HOME\.starship\config.toml
[sudo]
allow_windows = true
disabled = false
```
## Swift ## Swift
By default the `swift` module shows the currently installed version of [Swift](https://swift.org/). The module will be shown if any of the following conditions are met: By default the `swift` module shows the currently installed version of [Swift](https://swift.org/). The module will be shown if any of the following conditions are met:

View File

@ -316,7 +316,7 @@ Please check out these previous works that helped inspire the creation of starsh
<p align="center"> <p align="center">
<br> <br>
<img width="100" src="https://raw.githubusercontent.com/starship/starship/master/media/icon.png" alt="Starship rocket icon"> <img width="100" src="https://raw.githubusercontent.com/starship/starship/master/media/icon.png" alt="Starship 로켓 아이콘">
</p> </p>
## 📝라이선스 ## 📝라이선스

View File

@ -223,6 +223,9 @@ format = '\[[$symbol($version)]($style)\]'
[scala] [scala]
format = '\[[$symbol($version)]($style)\]' format = '\[[$symbol($version)]($style)\]'
[sudo]
format = '\[[as $symbol]\]
[swift] [swift]
format = '\[[$symbol($version)]($style)\]' format = '\[[$symbol($version)]($style)\]'
@ -371,6 +374,9 @@ symbol = "rs "
[scala] [scala]
symbol = "scala " symbol = "scala "
[sudo]
symbol = "sudo "
[swift] [swift]
symbol = "swift " symbol = "swift "
``` ```

View File

@ -61,7 +61,7 @@ Format strings are the format that a module prints all its variables with. Most
#### Variable #### Variable
A variable contains a `$` symbol followed by the name of the variable. The name of a variable only contains letters, numbers and `_`. A variable contains a `$` symbol followed by the name of the variable. The name of a variable can only contain letters, numbers and `_`.
For example: For example:
@ -106,18 +106,11 @@ For example:
- `(some text)` will always show nothing since there are no variables wrapped in the braces. - `(some text)` will always show nothing since there are no variables wrapped in the braces.
- When `$all` is a shortcut for `\[$a$b\]`, `($all)` will show nothing only if `$a` and `$b` are both `None`. This works the same as `(\[$a$b\] )`. - When `$all` is a shortcut for `\[$a$b\]`, `($all)` will show nothing only if `$a` and `$b` are both `None`. This works the same as `(\[$a$b\] )`.
#### Escapable characters #### Special characters
The following symbols have special usage in a format string. If you want to print the following symbols, you have to escape them with a backslash (`\`). The following symbols have special usage in a format string and must be escaped: `$ \ [ ] ( )`.
- \$ Note that TOML has [both basic strings and literal strings](https://toml.io/en/v1.0.0#string). It is recommended to use a literal string (surrounded by single quotes) in your config. If you want to use a basic string (surrounded by double quotes), you must escape the backslash itself (i.e. use `\\`).
- \\
- [
- ]
- (
- )
Note that `toml` has [its own escape syntax](https://github.com/toml-lang/toml#user-content-string). It is recommended to use a literal string (`''`) in your config. If you want to use a basic string (`""`), pay attention to escape the backslash `\`.
For example, when you want to print a `$` symbol on a new line, the following configs for `format` are equivalent: For example, when you want to print a `$` symbol on a new line, the following configs for `format` are equivalent:
@ -231,9 +224,11 @@ $memory_usage\
$aws\ $aws\
$gcloud\ $gcloud\
$openstack\ $openstack\
$azure\
$env_var\ $env_var\
$crystal\ $crystal\
$custom\ $custom\
$sudo\
$cmd_duration\ $cmd_duration\
$line_break\ $line_break\
$jobs\ $jobs\
@ -325,6 +320,31 @@ style = "bold blue"
symbol = "🅰 " symbol = "🅰 "
``` ```
## Azure
The `azure` module shows the current Azure Subscription. This is based on showing the name of the default subscription, as defined in the `~/.azure/azureProfile.json` file.
### Options
| Variable | Default | Description |
| ---------- | ---------------------------------------- | ------------------------------------------ |
| `format` | `"on [$symbol($subscription)]($style) "` | The format for the Azure module to render. |
| `symbol` | `"ﴃ "` | The symbol used in the format. |
| `style` | `"blue bold"` | The style used in the format. |
| `disabled` | `true` | Disables the `azure` module. |
### Example
```toml
# ~/.config/starship.toml
[azure]
disabled = false
format = "on [$symbol($subscription)]($style) "
symbol = "ﴃ "
style = "blue bold"
```
## Battery ## Battery
The `battery` module shows how charged the device's battery is and its current charging status. The module is only visible when the device's battery is below 10%. The `battery` module shows how charged the device's battery is and its current charging status. The module is only visible when the device's battery is below 10%.
@ -2129,6 +2149,7 @@ The `package` module is shown when the current directory is the repository for a
- [**Meson**](https://mesonbuild.com/) - The `meson` package version is extracted from the `meson.build` present - [**Meson**](https://mesonbuild.com/) - The `meson` package version is extracted from the `meson.build` present
- [**Shards**](https://crystal-lang.org/reference/the_shards_command/index.html) - The `shards` package version is extracted from the `shard.yml` present - [**Shards**](https://crystal-lang.org/reference/the_shards_command/index.html) - The `shards` package version is extracted from the `shard.yml` present
- [**V**](https://vlang.io) - The `vlang` package version is extracted from the `v.mod` present - [**V**](https://vlang.io) - The `vlang` package version is extracted from the `v.mod` present
- [**SBT**](https://scala-sbt.org) - The `sbt` package version is extracted from the `build.sbt` present in the current directory
> ⚠️ The version being shown is that of the package whose source code is in your current directory, not your package manager. > ⚠️ The version being shown is that of the package whose source code is in your current directory, not your package manager.
@ -2809,6 +2830,56 @@ disabled = false
``` ```
## Sudo
The `sudo` module displays if sudo credentials are currently cached. The module will only be shown if credentials are cached.
::: tip
This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
:::
### Options
| Option | Default | Description |
| --------------- | ----------------------- | ------------------------------------------------------- |
| `format` | `[as $symbol]($style)"` | The format of the module |
| `symbol` | `"🧙 "` | The symbol displayed when credentials are cached |
| `style` | `"bold blue"` | The style for the module. |
| `allow_windows` | `false` | Since windows has no default sudo, default is disabled. |
| `disabled` | `true` | Disables the `sudo` module. |
### Variables
| Variable | Example | Description |
| --------- | ------- | ------------------------------------ |
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
### Example
```toml
# ~/.config/starship.toml
[sudo]
style = "bold green"
symbol = "👩‍💻 "
disabled = false
```
```toml
# On windows
# $HOME\.starship\config.toml
[sudo]
allow_windows = true
disabled = false
```
## Swift ## Swift
By default the `swift` module shows the currently installed version of [Swift](https://swift.org/). The module will be shown if any of the following conditions are met: By default the `swift` module shows the currently installed version of [Swift](https://swift.org/). The module will be shown if any of the following conditions are met:

View File

@ -223,6 +223,9 @@ format = '\[[$symbol($version)]($style)\]'
[scala] [scala]
format = '\[[$symbol($version)]($style)\]' format = '\[[$symbol($version)]($style)\]'
[sudo]
format = '\[[as $symbol]\]
[swift] [swift]
format = '\[[$symbol($version)]($style)\]' format = '\[[$symbol($version)]($style)\]'
@ -371,6 +374,9 @@ symbol = "rs "
[scala] [scala]
symbol = "scala " symbol = "scala "
[sudo]
symbol = "sudo "
[swift] [swift]
symbol = "swift " symbol = "swift "
``` ```

View File

@ -61,7 +61,7 @@ Moduły wypisują swoje zmienne przy użyciu ciągów formatujących. Większoś
#### Zmienne #### Zmienne
Zmienna zawiera symbol `$`, po którym następuje nazwa zmiennej. Nazwa zmiennej zawiera tylko litery, cyfry i `_`. Zmienna zawiera symbol `$`, po którym następuje nazwa zmiennej. The name of a variable can only contain letters, numbers and `_`.
Na przykład: Na przykład:
@ -106,18 +106,11 @@ Na przykład:
- `(some text)` will always show nothing since there are no variables wrapped in the braces. - `(some text)` will always show nothing since there are no variables wrapped in the braces.
- When `$all` is a shortcut for `\[$a$b\]`, `($all)` will show nothing only if `$a` and `$b` are both `None`. This works the same as `(\[$a$b\] )`. - When `$all` is a shortcut for `\[$a$b\]`, `($all)` will show nothing only if `$a` and `$b` are both `None`. This works the same as `(\[$a$b\] )`.
#### Escapable characters #### Special characters
The following symbols have special usage in a format string. If you want to print the following symbols, you have to escape them with a backslash (`\`). The following symbols have special usage in a format string and must be escaped: `$ \ [ ] ( )`.
- \$ Note that TOML has [both basic strings and literal strings](https://toml.io/en/v1.0.0#string). It is recommended to use a literal string (surrounded by single quotes) in your config. If you want to use a basic string (surrounded by double quotes), you must escape the backslash itself (i.e. use `\\`).
- \\
- [
- ]
- (
- )
Note that `toml` has [its own escape syntax](https://github.com/toml-lang/toml#user-content-string). It is recommended to use a literal string (`''`) in your config. If you want to use a basic string (`""`), pay attention to escape the backslash `\`.
For example, when you want to print a `$` symbol on a new line, the following configs for `format` are equivalent: For example, when you want to print a `$` symbol on a new line, the following configs for `format` are equivalent:
@ -231,9 +224,11 @@ $memory_usage\
$aws\ $aws\
$gcloud\ $gcloud\
$openstack\ $openstack\
$azure\
$env_var\ $env_var\
$crystal\ $crystal\
$custom\ $custom\
$sudo\
$cmd_duration\ $cmd_duration\
$line_break\ $line_break\
$jobs\ $jobs\
@ -325,6 +320,31 @@ style = "bold blue"
symbol = "🅰 " symbol = "🅰 "
``` ```
## Azure
The `azure` module shows the current Azure Subscription. This is based on showing the name of the default subscription, as defined in the `~/.azure/azureProfile.json` file.
### Options
| Zmienne | Default | Description |
| ---------- | ---------------------------------------- | ------------------------------------------ |
| `format` | `"on [$symbol($subscription)]($style) "` | The format for the Azure module to render. |
| `symbol` | `"ﴃ "` | The symbol used in the format. |
| `style` | `"blue bold"` | The style used in the format. |
| `disabled` | `true` | Disables the `azure` module. |
### Example
```toml
# ~/.config/starship.toml
[azure]
disabled = false
format = "on [$symbol($subscription)]($style) "
symbol = "ﴃ "
style = "blue bold"
```
## Battery ## Battery
The `battery` module shows how charged the device's battery is and its current charging status. The module is only visible when the device's battery is below 10%. The `battery` module shows how charged the device's battery is and its current charging status. The module is only visible when the device's battery is below 10%.
@ -986,7 +1006,7 @@ default = "unknown user"
| Option | Default | Description | | Option | Default | Description |
| ---------- | ------------------------------ | ---------------------------------------------------------------------------- | | ---------- | ------------------------------ | ---------------------------------------------------------------------------- |
| `symbol` | `""` | The symbol used before displaying the variable value. | | `symbol` | `""` | The symbol used before displaying the variable value. |
| `zmienne` | | The environment variable to be displayed. | | `variable` | | The environment variable to be displayed. |
| `default` | | The default value to be displayed when the selected variable is not defined. | | `default` | | The default value to be displayed when the selected variable is not defined. |
| `format` | `"with [$env_value]($style) "` | The format for the module. | | `format` | `"with [$env_value]($style) "` | The format for the module. |
| `disabled` | `false` | Disables the `env_var` module. | | `disabled` | `false` | Disables the `env_var` module. |
@ -2129,6 +2149,7 @@ The `package` module is shown when the current directory is the repository for a
- [**Meson**](https://mesonbuild.com/) - The `meson` package version is extracted from the `meson.build` present - [**Meson**](https://mesonbuild.com/) - The `meson` package version is extracted from the `meson.build` present
- [**Shards**](https://crystal-lang.org/reference/the_shards_command/index.html) - The `shards` package version is extracted from the `shard.yml` present - [**Shards**](https://crystal-lang.org/reference/the_shards_command/index.html) - The `shards` package version is extracted from the `shard.yml` present
- [**V**](https://vlang.io) - The `vlang` package version is extracted from the `v.mod` present - [**V**](https://vlang.io) - The `vlang` package version is extracted from the `v.mod` present
- [**SBT**](https://scala-sbt.org) - The `sbt` package version is extracted from the `build.sbt` present in the current directory
> ⚠️ The version being shown is that of the package whose source code is in your current directory, not your package manager. > ⚠️ The version being shown is that of the package whose source code is in your current directory, not your package manager.
@ -2809,6 +2830,56 @@ disabled = false
``` ```
## Sudo
The `sudo` module displays if sudo credentials are currently cached. The module will only be shown if credentials are cached.
::: tip
This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
:::
### Options
| Option | Default | Description |
| --------------- | ----------------------- | ------------------------------------------------------- |
| `format` | `[as $symbol]($style)"` | The format of the module |
| `symbol` | `"🧙 "` | The symbol displayed when credentials are cached |
| `style` | `"bold blue"` | The style for the module. |
| `allow_windows` | `false` | Since windows has no default sudo, default is disabled. |
| `disabled` | `true` | Disables the `sudo` module. |
### Variables
| Zmienne | Example | Description |
| --------- | ------- | ------------------------------------ |
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
### Example
```toml
# ~/.config/starship.toml
[sudo]
style = "bold green"
symbol = "👩‍💻 "
disabled = false
```
```toml
# On windows
# $HOME\.starship\config.toml
[sudo]
allow_windows = true
disabled = false
```
## Swift ## Swift
By default the `swift` module shows the currently installed version of [Swift](https://swift.org/). The module will be shown if any of the following conditions are met: By default the `swift` module shows the currently installed version of [Swift](https://swift.org/). The module will be shown if any of the following conditions are met:

View File

@ -60,9 +60,9 @@ sh -c "$(curl -fsSL https://starship.rs/install.sh)" -- --platform unknown-linux
Starship executes different commands to get information to display in the prompt, for example the version of a program or the current git status. To make sure starship doesn't hang while trying to execute these commands we set a time limit, if a command takes longer than this limit starship will stop the execution of the command and output the above warning, this is expected behaviour. This time limit is configurable using the [`command_timeout` key](/config/#prompt) so if you want you can increase the time limit. You can also follow the debugging steps below to see which command is being slow and see if you can optimise it. Finally you can set the `STARSHIP_LOG` env var to `error` to hide these warnings. Starship executes different commands to get information to display in the prompt, for example the version of a program or the current git status. To make sure starship doesn't hang while trying to execute these commands we set a time limit, if a command takes longer than this limit starship will stop the execution of the command and output the above warning, this is expected behaviour. This time limit is configurable using the [`command_timeout` key](/config/#prompt) so if you want you can increase the time limit. You can also follow the debugging steps below to see which command is being slow and see if you can optimise it. Finally you can set the `STARSHIP_LOG` env var to `error` to hide these warnings.
## I see symbols I don't understand or expect, what do they mean? ## W wierszu poleceń zauważyłem symbole których się nie spodziewałem bądź nie rozumiem. Co one oznaczają?
If you see symbols that you don't recognise you can use `starship explain` to explain the currently showing modules. Jeśli zauważyłeś symbole których nie rozpoznajesz, możesz użyć `starship explain` aby uzyskać szczegółowy opis obecnie wyświetlanych modułów.
## Starship is doing something unexpected, how can I debug it? ## Starship is doing something unexpected, how can I debug it?
@ -105,9 +105,9 @@ The first line should produce a [snake emoji](https://emojipedia.org/snake/), wh
If either symbol fails to display correctly, your system is still misconfigured. Unfortunately, getting font configuration correct is sometimes difficult. Users on the Discord may be able to help. If both symbols display correctly, but you still don't see them in starship, [file a bug report!](https://github.com/starship/starship/issues/new/choose) If either symbol fails to display correctly, your system is still misconfigured. Unfortunately, getting font configuration correct is sometimes difficult. Users on the Discord may be able to help. If both symbols display correctly, but you still don't see them in starship, [file a bug report!](https://github.com/starship/starship/issues/new/choose)
## How do I uninstall Starship? ## Jak odinstalować Starship?
Starship is just as easy to uninstall as it is to install in the first place. Starship można odinstalować równie łatwo jak przebiega proces instalacji.
1. Usuń zawartość konfiguracji powłoki (np. `~/.bashrc`) służącą do zainicjalizowania Starship. 1. Usuń zawartość konfiguracji powłoki (np. `~/.bashrc`) służącą do zainicjalizowania Starship.
1. Usuń plik wykonywalny programu Starship. 1. Usuń plik wykonywalny programu Starship.

View File

@ -306,7 +306,7 @@ Jeżeli chcesz wspomóc tworzenie starship, zapoznaj się z naszym [Poradnikiem
## 💭Inspiracje ## 💭Inspiracje
Please check out these previous works that helped inspire the creation of starship. 🙏 Zapoznaj się z wcześniejszymi projektami które zainspirowały nas do stworzenia starship. 🙏
- **[denysdovhan/spaceship-prompt](https://github.com/denysdovhan/spaceship-prompt)** - Wiersz poleceń ZSH dla astronautów. - **[denysdovhan/spaceship-prompt](https://github.com/denysdovhan/spaceship-prompt)** - Wiersz poleceń ZSH dla astronautów.

View File

@ -223,6 +223,9 @@ format = '\[[$symbol($version)]($style)\]'
[scala] [scala]
format = '\[[$symbol($version)]($style)\]' format = '\[[$symbol($version)]($style)\]'
[sudo]
format = '\[[as $symbol]\]
[swift] [swift]
format = '\[[$symbol($version)]($style)\]' format = '\[[$symbol($version)]($style)\]'
@ -371,6 +374,9 @@ symbol = "rs "
[scala] [scala]
symbol = "scala " symbol = "scala "
[sudo]
symbol = "sudo "
[swift] [swift]
symbol = "swift " symbol = "swift "
``` ```

View File

@ -31,11 +31,11 @@ trap blastoff DEBUG # Trap Inicia o debug antes de iniciar o starship
eval $(starship init bash) eval $(starship init bash)
``` ```
## Custom pre-prompt and pre-execution Commands in PowerShell ## Comandos personalizados de pre-prompt e pre-execution no PowerShell
PowerShell does not have a formal preexec/precmd framework like most other shells. Because of this, it is difficult to provide fully customizable hooks in `powershell`. No entanto, Starship te oferece uma capacidade limitada de inserir suas próprias funções na processo de prompt-rendering: O PowerShell não possui uma estrutura formal para os hooks preexec/precmd como a maioria dos outros shells. Por esse motivo, é difícil fornecer hooks totalmente customizáveis no `powershell`. No entanto, Starship te oferece uma capacidade limitada de inserir suas próprias funções na processo de prompt-rendering:
Create a function named `Invoke-Starship-PreCommand` Crie uma função chamada `Invoke-Starship-PreCommand`
```powershell ```powershell
function Invoke-Starship-PreCommand { function Invoke-Starship-PreCommand {
@ -43,11 +43,11 @@ function Invoke-Starship-PreCommand {
} }
``` ```
## Change Window Title ## Altera o título da janela
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`. Alguns shell prompts iram alterar o titulo da janela automaticamente para você (e.x: para espelhar o diretório atual). Fish faz isso por padrão. Starship não faz isso, mas é bastante simples adicionar esta funcionalidade ao `bash` ou `zsh`.
First, define a window title change function (identical in bash and zsh): Primeiro, defina uma função de alteração de titulo de janela (é o mesmo para bash e zsh):
```bash ```bash
function set_win_title(){ function set_win_title(){
@ -55,23 +55,23 @@ function set_win_title(){
} }
``` ```
You can use variables to customize this title (`$USER`, `$HOSTNAME`, and `$PWD` are popular choices). Você pode usar variáveis para customizar o titulo (`$USER`, `$HOSTNAME`, e `$PWD` são escolhas populares).
In `bash`, set this function to be the precmd starship function: No `bash`, defina esta função como a precedente da função starship:
```bash ```bash
starship_precmd_user_func="set_win_title" starship_precmd_user_func="set_win_title"
``` ```
In `zsh`, add this to the `precmd_functions` array: No `zsh`, adicione no array `precmd_functions`:
```bash ```bash
precmd_functions+=(set_win_title) precmd_functions+=(set_win_title)
``` ```
If you like the result, add these lines to your shell configuration file (`~/.bashrc` or `~/.zshrc`) to make it permanent. Se você gostar do resultado, adicione esta linha ao seu arquivo de configuração de shell (`~/.bashrc` or `~/.zshrc`) para torna-lo permanente.
For example, if you want to display your current directory in your terminal tab title, add the following snippet to your `~/.bashrc` or `~/.zshrc`: Por exemplo, se você quiser exibir seu diretório atual no seu titulo de aba do terminal, adicione o seguinte snippet ao seu `~/.bashrc` ou `~/.zshrc`:
```bash ```bash
function set_win_title(){ function set_win_title(){
@ -80,7 +80,7 @@ function set_win_title(){
starship_precmd_user_func="set_win_title" starship_precmd_user_func="set_win_title"
``` ```
You can also set a similar output with PowerShell by creating a function named `Invoke-Starship-PreCommand`. Você também pode definir uma saída semelhante com o PowerShell criando uma função chamada `Invoke-Starship-PreCommand`.
```powershell ```powershell
# edit $PROFILE # edit $PROFILE
@ -91,27 +91,27 @@ function Invoke-Starship-PreCommand {
Invoke-Expression (&starship init powershell) Invoke-Expression (&starship init powershell)
``` ```
## Enable Right Prompt ## Ativando o Prompt Direito
Some shells support a right prompt which renders on the same line as the input. Starship can set the content of the right prompt using the `right_format` option. Any module that can be used in `format` is also supported in `right_format`. The `$all` variable will only contain modules not explicitly used in either `format` or `right_format`. Alguns shells suportam um prompt no lado direito que renderiza na mesma linha do input. Starship consegue definir o conteúdo do prompt direito usando a opção `right_format`. Qualquer módulo pode ser usado no `format` é suportado o `right_format`. A variável `$all` só irá alterar os módulos que não usaram de forma explicita o `format` ou `right_format`.
Note: The right prompt is a single line following the input location. To right align modules above the input line in a multi-line prompt, see the [fill module](/config/#fill). Nota: O prompt direito é uma linha única seguindo o local de entrada. Para alinhar à direita os módulos acima a linha de entrada em um prompt de várias linhas, consulte o [módulo fill](/config/#fill).
`right_format` is currently supported for the following shells: elvish, fish, zsh. `right_format` é atualmente suportado para os seguintes shells: elvish, fish, zsh.
### Exemplo ### Exemplo
```toml ```toml
# ~/.config/starship.toml # ~/.config/starship.toml
# A minimal left prompt # Um prompt esquerdo minimo
format = """$character""" format = """$character"""
# move the rest of the prompt to the right # Move o resto do prompt para direita
right_format = """$all""" right_format = """$all"""
``` ```
Produces a prompt like the following: Gera um prompt parecido com o seguinte:
``` ```
▶ starship on  rprompt [!] is 📦 v0.57.0 via 🦀 v1.54.0 took 17s ▶ starship on  rprompt [!] is 📦 v0.57.0 via 🦀 v1.54.0 took 17s
@ -120,7 +120,7 @@ Produces a prompt like the following:
## Estilo dos textos ## 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: Estilo de strings são uma lista de palavras, separadas por espaço. As palavras não são case sensitive (ou seja `bold` e `BoLd` são consideradas iguais). Cada palavra pode ser uma das seguintes:
- `bold` - `bold`
- `italic` - `italic`
@ -132,14 +132,14 @@ Style strings are a list of words, separated by whitespace. The words are not ca
- `<color>` - `<color>`
- `none` - `none`
where `<color>` is a color specifier (discussed below). `fg:<color>` and `<color>` currently do the same thing, though this may change in the future. `inverted` swaps the background and foreground colors. The order of words in the string does not matter. onde `<color>` é uma especialista de cores (discutido abaixo). `fg:<color>` e `<color>` atualmente fazem a mesma coisa, isto deve mudar no futuro. `inverted` troca as cores de background e foreground. A ordem de palavras na string não importa.
The `none` token overrides all other tokens in a string if it is not part of a `bg:` specifier, so that e.g. `fg:red none fg:blue` will still create a string with no styling. `bg:none` sets the background to the default color so `fg:red bg:none` is equivalent to `red` or `fg:red` and `bg:green fg:red bg:none` is also equivalent to `fg:red` or `red`. It may become an error to use `none` in conjunction with other tokens in the future. O token `none` substitui todos os outros tokens na string se ele não fizer parte de um `bg:` especificado que seja, por exemplo `fg:red none fg:blue` ainda criará uma string sem estilo. `bg:none` define a cor padrão de background então `fg:red bg:none` é equivalente a `red` ou `fg:red` e `bg:green fg:red bg:none` é equivalente a `fg:red` ou`red`. Pode se transformar em um erro ao usar `none` em um conjunto de outros tokens no futuro.
A color specifier can be one of the following: Um especialista em cores pode ser um dos seguintes:
- Um dos padrões de cores no terminal: `black`, `red`, `green`, `blue`, `yellow`, `purple`, `cyan`, `white`. Você pode de forma opcional prefixar com `bright-` para obter uma versão mais brilhante/clara (ex `bright-white`). - Um dos padrões de cores no terminal: `black`, `red`, `green`, `blue`, `yellow`, `purple`, `cyan`, `white`. Você pode de forma opcional prefixar com `bright-` para obter uma versão mais brilhante/clara (ex `bright-white`).
- Um `#` seguido por um número de seis dígitos hexadecimais. Isto especifica um [Código RGB em formato hexadecimal](https://www.w3schools.com/colors/colors_hexadecimal.asp). - Um `#` seguido por um número de seis dígitos hexadecimais. Isto especifica um [Código RGB em formato hexadecimal](https://www.w3schools.com/colors/colors_hexadecimal.asp).
- Um número entre 0-255. Este especifica um [Código de Cor ANSI 8 bits](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. Se múltiplas cores forem especificadas para foreground/background, a ultima da string que terá prioridade.

File diff suppressed because it is too large Load Diff

View File

@ -60,9 +60,9 @@ sh -c "$(curl -fsSL https://starship.rs/install.sh)" -- --platform unknown-linux
Starship executes different commands to get information to display in the prompt, for example the version of a program or the current git status. To make sure starship doesn't hang while trying to execute these commands we set a time limit, if a command takes longer than this limit starship will stop the execution of the command and output the above warning, this is expected behaviour. This time limit is configurable using the [`command_timeout` key](/config/#prompt) so if you want you can increase the time limit. You can also follow the debugging steps below to see which command is being slow and see if you can optimise it. Finally you can set the `STARSHIP_LOG` env var to `error` to hide these warnings. Starship executes different commands to get information to display in the prompt, for example the version of a program or the current git status. To make sure starship doesn't hang while trying to execute these commands we set a time limit, if a command takes longer than this limit starship will stop the execution of the command and output the above warning, this is expected behaviour. This time limit is configurable using the [`command_timeout` key](/config/#prompt) so if you want you can increase the time limit. You can also follow the debugging steps below to see which command is being slow and see if you can optimise it. Finally you can set the `STARSHIP_LOG` env var to `error` to hide these warnings.
## I see symbols I don't understand or expect, what do they mean? ## Eu vejo símbolos que não entendo ou não esperado, o que isso significa?
If you see symbols that you don't recognise you can use `starship explain` to explain the currently showing modules. Se você vê símbolos que não reconhece você pode usar `starship explain` para exibir os módulos que estão sendo mostrados no momento.
## Starship is doing something unexpected, how can I debug it? ## Starship is doing something unexpected, how can I debug it?
@ -86,37 +86,37 @@ Finally if you find a bug you can use the `bug-report` command to create a Githu
starship bug-report starship bug-report
``` ```
## Why don't I see a glyph symbol in my prompt? ## Por que não consigo visualizar um simbolo glifo no meu prompt?
The most common cause of this is system misconfiguration. Some Linux distros in particular do not come with font support out-of-the-box. You need to ensure that: A causa mais comum é a configuração incorreta do sistema. Algumas distribuições Linux em particular não vem com suporte de fontes pronto para uso. Você deve conferir os pontos abaixo:
- Sua localização está configurada como UTF-8, como por exemplo `de_DE.UTF-8` ou `ja_JP.UTF-8`. Se `LC_ALL` não estiver configurado como UTF-8, [você deve mudar](https://www.tecmint.com/set-system-locales-in-linux/). - Sua localização está configurada como UTF-8, como por exemplo `de_DE.UTF-8` ou `ja_JP.UTF-8`. Se `LC_ALL` não estiver configurado como UTF-8, [você deve mudar](https://www.tecmint.com/set-system-locales-in-linux/).
- Você tem uma fonte de emoji instalda. A maioria dos sistemas vem com uma fonte de emoji instalada como padrão, mas alguns não (principalmente o Arch Linux). Você pode instalar uma em seu sistema, através do gerenciador de pacotes-[noto emoji](https://www.google.com/get/noto/help/emoji/) é uma escolha popular. - Você tem uma fonte de emoji instalda. A maioria dos sistemas vem com uma fonte de emoji instalada como padrão, mas alguns não (principalmente o Arch Linux). Você pode instalar uma em seu sistema, através do gerenciador de pacotes-[noto emoji](https://www.google.com/get/noto/help/emoji/) é uma escolha popular.
- Você está usando uma [Nerd Font](https://www.nerdfonts.com/). - Você está usando uma [Nerd Font](https://www.nerdfonts.com/).
To test your system, run the following commands in a terminal: Para testar seu sistema, execute o comando abaixo em um terminal:
```sh ```sh
echo -e "\xf0\x9f\x90\x8d" echo -e "\xf0\x9f\x90\x8d"
echo -e "\xee\x82\xa0" echo -e "\xee\x82\xa0"
``` ```
The first line should produce a [snake emoji](https://emojipedia.org/snake/), while the second should produce a [powerline branch symbol (e0a0)](https://github.com/ryanoasis/powerline-extra-symbols#glyphs). A primeira linha deve produzir um [emoji de cobra](https://emojipedia.org/snake/), enquanto a segunda linha deve produzir um [um simbolo de bifurcação (e0a0)](https://github.com/ryanoasis/powerline-extra-symbols#glyphs).
If either symbol fails to display correctly, your system is still misconfigured. Unfortunately, getting font configuration correct is sometimes difficult. Users on the Discord may be able to help. If both symbols display correctly, but you still don't see them in starship, [file a bug report!](https://github.com/starship/starship/issues/new/choose) Se um dos símbolos acima falhar seu sistema ainda está configurado de forma errada. Infelizmente, obter a configuração de fontes correta as vezes é difícil. Usuários no Discord podem te ajudar. Se os dois símbolos acima exibirem de forma correta, mas você ainda continua sem visualizar no Starship, [registre um erro!](https://github.com/starship/starship/issues/new/choose)
## How do I uninstall Starship? ## Como eu desinstalo o Starship?
Starship is just as easy to uninstall as it is to install in the first place. O Starship é tão fácil de desinstalar tão como é para instalar.
1. Remova qualquer linha da configuração do seu shell (ex: `~/.bashrc`) usada para iniciar o Starship. 1. Remova qualquer linha da configuração do seu shell (ex: `~/.bashrc`) usada para iniciar o Starship.
1. Delete o binário do Starship. 1. Delete o binário do Starship.
If Starship was installed using a package manager, please refer to their docs for uninstallation instructions. Se o Starship foi instalando usando algum gerenciador de pacotes, por favor consulte as documentações do mesmo para instruções de desinstalação.
If Starship was installed using the install script, the following command will delete the binary: Se o Starship foi instalado usando o script de instalação, o comando abaixo irá remover o binário:
```sh ```sh
# Locate and delete the starship binary # Localiza e deleta o binario do starship
sh -c 'rm "$(which starship)"' sh -c 'rm "$(which starship)"'
``` ```

View File

@ -306,7 +306,7 @@ Se você está interessado em ajudar contribuindo com o projeto, dê uma olhada
## 💭 Inspirado por ## 💭 Inspirado por
Please check out these previous works that helped inspire the creation of starship. 🙏 Por favor, confira estes projetos anteriores que ajudaram a inspirar a criação do startship. 🙏
- **[denysdovhan/spaceship-prompt](https://github.com/denysdovhan/spaceship-prompt)** - Um prompt ZSH para astronautas. - **[denysdovhan/spaceship-prompt](https://github.com/denysdovhan/spaceship-prompt)** - Um prompt ZSH para astronautas.
@ -316,9 +316,9 @@ Please check out these previous works that helped inspire the creation of starsh
<p align="center"> <p align="center">
<br> <br>
<img width="100" src="https://raw.githubusercontent.com/starship/starship/master/media/icon.png" alt="Starship rocket icon"> <img width="100" src="https://raw.githubusercontent.com/starship/starship/master/media/icon.png" alt="Ícone de foguete do Starship">
</p> </p>
## 📝 Licença ## 📝 Licença
Copyright © 2019-present, [Starship Contributors](https://github.com/starship/starship/graphs/contributors).<br /> This project is [ISC](https://github.com/starship/starship/blob/master/LICENSE) licensed. Todos os direitos reservados © 2019-Presente, [Contribuidores Starship](https://github.com/starship/starship/graphs/contributors).<br /> Este projeto está licenciado pelo [ISC](https://github.com/starship/starship/blob/master/LICENSE).

View File

@ -47,7 +47,7 @@ emerge app-shells/starship
## [Nix](https://nixos.wiki/wiki/Nix) ## [Nix](https://nixos.wiki/wiki/Nix)
### Getting the Binary ### Obtendo o Binário
#### Imperativamente #### Imperativamente
@ -57,7 +57,7 @@ nix-env -iA nixos.starship
#### Declarativo, usuário único, via [home-manager](https://github.com/nix-community/home-manager) #### Declarativo, usuário único, via [home-manager](https://github.com/nix-community/home-manager)
Enable the `programs.starship` module in your `home.nix` file, and add your settings Ative o modulo `programs.starship` em seu arquivo `home.nix`, e adicione suas configurações
```nix ```nix
{ {
@ -79,7 +79,7 @@ Enable the `programs.starship` module in your `home.nix` file, and add your sett
} }
``` ```
then run então execute
```sh ```sh
home-manager switch home-manager switch
@ -87,7 +87,7 @@ home-manager switch
#### Declarativo, em todo o sistema com NixOS #### Declarativo, em todo o sistema com NixOS
Add `pkgs.starship` to `environment.systemPackages` in your `configuration.nix`, then run Adicione `pkgs.starship` em `environment.systemPackages` no arquivo `configuration.nix`, então execute
```sh ```sh
sudo nixos-rebuild switch sudo nixos-rebuild switch

View File

@ -1,6 +1,6 @@
# Predefinições # Configurações
Aqui tem uma coleção de predefinições de configuração criadas pela comunidade de Starship. Se você tem uma predefinição para compartilhar, por favor, [envie uma PR](https://github.com/starship/starship/edit/master/docs/presets/README.md) atualizando este arquivo! 😊 Aqui tem uma coleção de predefinições de configuração criadas pela comunidade de Starship. Se você tem uma configuração para compartilhar, por favor, [envie uma PR](https://github.com/starship/starship/edit/master/docs/presets/README.md) atualizando este arquivo! 😊
## Símbolos Nerd Font ## Símbolos Nerd Font
@ -223,6 +223,9 @@ format = '\[[$symbol($version)]($style)\]'
[scala] [scala]
format = '\[[$symbol($version)]($style)\]' format = '\[[$symbol($version)]($style)\]'
[sudo]
format = '\[[as $symbol]\]
[swift] [swift]
format = '\[[$symbol($version)]($style)\]' format = '\[[$symbol($version)]($style)\]'
@ -371,6 +374,9 @@ symbol = "rs "
[scala] [scala]
symbol = "scala " symbol = "scala "
[sudo]
symbol = "sudo "
[swift] [swift]
symbol = "swift " symbol = "swift "
``` ```
@ -474,9 +480,9 @@ format = 'via [$symbol]($style)'
## Pure ## Pure
This preset emulates the look and behavior of [Pure](https://github.com/sindresorhus/pure). Essa configuração simula a aparência e o comportamento do [Pure](https://github.com/sindresorhus/pure).
![Screenshot of Pure preset](/presets/pure-prompt.png) ![Captura de tela da configuração emulando Pure](/presets/pure-prompt.png)
### Configuração ### Configuração

View File

@ -61,7 +61,7 @@ Format strings are the format that a module prints all its variables with. Most
#### Variable #### Variable
A variable contains a `$` symbol followed by the name of the variable. The name of a variable only contains letters, numbers and `_`. A variable contains a `$` symbol followed by the name of the variable. The name of a variable can only contain letters, numbers and `_`.
For example: For example:
@ -106,18 +106,11 @@ For example:
- `(some text)` will always show nothing since there are no variables wrapped in the braces. - `(some text)` will always show nothing since there are no variables wrapped in the braces.
- When `$all` is a shortcut for `\[$a$b\]`, `($all)` will show nothing only if `$a` and `$b` are both `None`. This works the same as `(\[$a$b\] )`. - When `$all` is a shortcut for `\[$a$b\]`, `($all)` will show nothing only if `$a` and `$b` are both `None`. This works the same as `(\[$a$b\] )`.
#### Escapable characters #### Special characters
The following symbols have special usage in a format string. If you want to print the following symbols, you have to escape them with a backslash (`\`). The following symbols have special usage in a format string and must be escaped: `$ \ [ ] ( )`.
- \$ Note that TOML has [both basic strings and literal strings](https://toml.io/en/v1.0.0#string). It is recommended to use a literal string (surrounded by single quotes) in your config. If you want to use a basic string (surrounded by double quotes), you must escape the backslash itself (i.e. use `\\`).
- \\
- [
- ]
- (
- )
Note that `toml` has [its own escape syntax](https://github.com/toml-lang/toml#user-content-string). It is recommended to use a literal string (`''`) in your config. If you want to use a basic string (`""`), pay attention to escape the backslash `\`.
For example, when you want to print a `$` symbol on a new line, the following configs for `format` are equivalent: For example, when you want to print a `$` symbol on a new line, the following configs for `format` are equivalent:
@ -231,9 +224,11 @@ $memory_usage\
$aws\ $aws\
$gcloud\ $gcloud\
$openstack\ $openstack\
$azure\
$env_var\ $env_var\
$crystal\ $crystal\
$custom\ $custom\
$sudo\
$cmd_duration\ $cmd_duration\
$line_break\ $line_break\
$jobs\ $jobs\
@ -325,6 +320,31 @@ style = "bold blue"
symbol = "🅰 " symbol = "🅰 "
``` ```
## Azure
The `azure` module shows the current Azure Subscription. This is based on showing the name of the default subscription, as defined in the `~/.azure/azureProfile.json` file.
### Options
| Variable | Default | Description |
| ---------- | ---------------------------------------- | ------------------------------------------ |
| `format` | `"on [$symbol($subscription)]($style) "` | The format for the Azure module to render. |
| `symbol` | `"ﴃ "` | The symbol used in the format. |
| `style` | `"blue bold"` | The style used in the format. |
| `disabled` | `true` | Disables the `azure` module. |
### Example
```toml
# ~/.config/starship.toml
[azure]
disabled = false
format = "on [$symbol($subscription)]($style) "
symbol = "ﴃ "
style = "blue bold"
```
## Battery ## Battery
The `battery` module shows how charged the device's battery is and its current charging status. The module is only visible when the device's battery is below 10%. The `battery` module shows how charged the device's battery is and its current charging status. The module is only visible when the device's battery is below 10%.
@ -2129,6 +2149,7 @@ The `package` module is shown when the current directory is the repository for a
- [**Meson**](https://mesonbuild.com/) - The `meson` package version is extracted from the `meson.build` present - [**Meson**](https://mesonbuild.com/) - The `meson` package version is extracted from the `meson.build` present
- [**Shards**](https://crystal-lang.org/reference/the_shards_command/index.html) - The `shards` package version is extracted from the `shard.yml` present - [**Shards**](https://crystal-lang.org/reference/the_shards_command/index.html) - The `shards` package version is extracted from the `shard.yml` present
- [**V**](https://vlang.io) - The `vlang` package version is extracted from the `v.mod` present - [**V**](https://vlang.io) - The `vlang` package version is extracted from the `v.mod` present
- [**SBT**](https://scala-sbt.org) - The `sbt` package version is extracted from the `build.sbt` present in the current directory
> ⚠️ The version being shown is that of the package whose source code is in your current directory, not your package manager. > ⚠️ The version being shown is that of the package whose source code is in your current directory, not your package manager.
@ -2809,6 +2830,56 @@ disabled = false
``` ```
## Sudo
The `sudo` module displays if sudo credentials are currently cached. The module will only be shown if credentials are cached.
::: tip
This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
:::
### Options
| Option | Default | Description |
| --------------- | ----------------------- | ------------------------------------------------------- |
| `format` | `[as $symbol]($style)"` | The format of the module |
| `symbol` | `"🧙 "` | The symbol displayed when credentials are cached |
| `style` | `"bold blue"` | The style for the module. |
| `allow_windows` | `false` | Since windows has no default sudo, default is disabled. |
| `disabled` | `true` | Disables the `sudo` module. |
### Variables
| Variable | Example | Description |
| --------- | ------- | ------------------------------------ |
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
### Example
```toml
# ~/.config/starship.toml
[sudo]
style = "bold green"
symbol = "👩‍💻 "
disabled = false
```
```toml
# On windows
# $HOME\.starship\config.toml
[sudo]
allow_windows = true
disabled = false
```
## Swift ## Swift
By default the `swift` module shows the currently installed version of [Swift](https://swift.org/). The module will be shown if any of the following conditions are met: By default the `swift` module shows the currently installed version of [Swift](https://swift.org/). The module will be shown if any of the following conditions are met:

View File

@ -223,6 +223,9 @@ format = '\[[$symbol($version)]($style)\]'
[scala] [scala]
format = '\[[$symbol($version)]($style)\]' format = '\[[$symbol($version)]($style)\]'
[sudo]
format = '\[[as $symbol]\]
[swift] [swift]
format = '\[[$symbol($version)]($style)\]' format = '\[[$symbol($version)]($style)\]'
@ -371,6 +374,9 @@ symbol = "rs "
[scala] [scala]
symbol = "scala " symbol = "scala "
[sudo]
symbol = "sudo "
[swift] [swift]
symbol = "swift " symbol = "swift "
``` ```

View File

@ -43,11 +43,11 @@ function Invoke-Starship-PreCommand {
} }
``` ```
## Change Window Title ## Изменение заголовка окна
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`. Some shell prompts will automatically change the window title for you (e.g. to reflect your working directory). Fish даже делает это по умолчанию. Starship не делает этого, но достаточно легко добавить эту функциональность к `bash` или `zsh`.
First, define a window title change function (identical in bash and zsh): Сначала задайте функцию изменения заголовка окна (идентичную в bash и zsh):
```bash ```bash
function set_win_title(){ function set_win_title(){
@ -55,15 +55,15 @@ function set_win_title(){
} }
``` ```
You can use variables to customize this title (`$USER`, `$HOSTNAME`, and `$PWD` are popular choices). Вы можете использовать переменные для настройки этого заголовка (`$USER`, `$HOSTNAME`, и `$PWD` являются популярными вариантами).
In `bash`, set this function to be the precmd starship function: В `bash`, установите эту функцию как функцию precmd в Starship:
```bash ```bash
starship_precmd_user_func="set_win_title" starship_precmd_user_func="set_win_title"
``` ```
In `zsh`, add this to the `precmd_functions` array: В `zsh`, добавьте это в массив `precmd_functions`:
```bash ```bash
precmd_functions+=(set_win_title) precmd_functions+=(set_win_title)
@ -71,7 +71,7 @@ precmd_functions+=(set_win_title)
If you like the result, add these lines to your shell configuration file (`~/.bashrc` or `~/.zshrc`) to make it permanent. If you like the result, add these lines to your shell configuration file (`~/.bashrc` or `~/.zshrc`) to make it permanent.
For example, if you want to display your current directory in your terminal tab title, add the following snippet to your `~/.bashrc` or `~/.zshrc`: Например, если вы хотите отобразить ваш текущий каталог в заголовке вкладки терминала, добавьте следующие строки в `~/. bashrc` или `~/.zshrc`:
```bash ```bash
function set_win_title(){ function set_win_title(){
@ -120,7 +120,7 @@ Produces a prompt like 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). Each word can be one of the following: Строки стиля - это список слов, разделенных пробелами. Слова не чувствительны к регистру (то есть `bold` и `BoLd` считаются одной строкой). Каждое слово может быть одним из следующих:
- `bold` - `bold`
- `italic` - `italic`
@ -132,14 +132,14 @@ Style strings are a list of words, separated by whitespace. The words are not ca
- `<color>` - `<color>`
- `none` - `none`
where `<color>` is a color specifier (discussed below). `fg:<color>` and `<color>` currently do the same thing, though this may change in the future. `inverted` swaps the background and foreground colors. The order of words in the string does not matter. где `<color>` является цветовым спецификатором (обсуждается ниже). `fg:<color>` and `<color>` currently do the same thing, though this may change in the future. `inverted` swaps the background and foreground colors. Порядок слов в строке не имеет значения.
The `none` token overrides all other tokens in a string if it is not part of a `bg:` specifier, so that e.g. `fg:red none fg:blue` will still create a string with no styling. `bg:none` sets the background to the default color so `fg:red bg:none` is equivalent to `red` or `fg:red` and `bg:green fg:red bg:none` is also equivalent to `fg:red` or `red`. It may become an error to use `none` in conjunction with other tokens in the future. Токен `none` переопределяет все остальные токены в строке, если он не является частью спецификатора `bg:` так, например, `fg:red none fg:blue` все равно создаст строку без стиля. `bg:none` sets the background to the default color so `fg:red bg:none` is equivalent to `red` or `fg:red` and `bg:green fg:red bg:none` is also equivalent to `fg:red` or `red`. Использование `none` в сочетании с другими токенами может стать ошибкой в будущем.
A color specifier can be one of the following: Цветовой спецификатор может быть одним из следующих:
- Некоторые из стандартных цветов терминалов: `black`, `red`, `green`, `blue`, `gellow`, `purple`, `cyan`, `white`. Вы можете по желанию добавить префикс `bright-`, чтобы получить яркую версию (например, `bright-white`). - Некоторые из стандартных цветов терминалов: `black`, `red`, `green`, `blue`, `gellow`, `purple`, `cyan`, `white`. Вы можете по желанию добавить префикс `bright-`, чтобы получить яркую версию (например, `bright-white`).
- `#`, за которой следует шестизначное шестнадцатеричное число. Это определяет [шестнадцатеричный код цвета RGB](https://www.w3schools.com/colors/colors_hexadecimal.asp). - `#`, за которой следует шестизначное шестнадцатеричное число. Это определяет [шестнадцатеричный код цвета RGB](https://www.w3schools.com/colors/colors_hexadecimal.asp).
- Число от 0 до 255. Это определяет [8-битный код цвета ANSI](https://i.stack.imgur.com/KTSQa.png). - Число от 0 до 255. Это определяет [8-битный код цвета ANSI](https://i.stack.imgur.com/KTSQa.png).
If multiple colors are specified for foreground/background, the last one in the string will take priority. Если для переднего плана/фона задано несколько цветов, то последняя из строк будет иметь приоритет.

File diff suppressed because it is too large Load Diff

View File

@ -105,7 +105,7 @@ The first line should produce a [snake emoji](https://emojipedia.org/snake/), wh
If either symbol fails to display correctly, your system is still misconfigured. Unfortunately, getting font configuration correct is sometimes difficult. Users on the Discord may be able to help. If both symbols display correctly, but you still don't see them in starship, [file a bug report!](https://github.com/starship/starship/issues/new/choose) If either symbol fails to display correctly, your system is still misconfigured. Unfortunately, getting font configuration correct is sometimes difficult. Users on the Discord may be able to help. If both symbols display correctly, but you still don't see them in starship, [file a bug report!](https://github.com/starship/starship/issues/new/choose)
## How do I uninstall Starship? ## Как удалить Starship?
Starship is just as easy to uninstall as it is to install in the first place. Starship is just as easy to uninstall as it is to install in the first place.

View File

@ -306,7 +306,7 @@
## 💭 Вдохновления ## 💭 Вдохновления
Please check out these previous works that helped inspire the creation of starship. 🙏 Пожалуйста, ознакомьтесь с этими предыдущими работами, которые помогли вдохновить создание Starship. 🙏
- **[denysdovhan/spaceship-prompt](https://github.com/denysdovhan/spaceship-prompt)** - командная строка ZSH для астронавтов. - **[denysdovhan/spaceship-prompt](https://github.com/denysdovhan/spaceship-prompt)** - командная строка ZSH для астронавтов.
@ -316,9 +316,9 @@ Please check out these previous works that helped inspire the creation of starsh
<p align="center"> <p align="center">
<br> <br>
<img width="100" src="https://raw.githubusercontent.com/starship/starship/master/media/icon.png" alt="Starship rocket icon"> <img width="100" src="https://raw.githubusercontent.com/starship/starship/master/media/icon.png" alt="Иконка ракеты Starship">
</p> </p>
## 📝 Лицензия ## 📝 Лицензия
Copyright © 2019-present, [Starship Contributors](https://github.com/starship/starship/graphs/contributors).<br /> This project is [ISC](https://github.com/starship/starship/blob/master/LICENSE) licensed. Авторское право © 2019-настоящее, [Starship Contributors](https://github.com/starship/starship/graphs/contributors).<br /> Этот проект [ISC](https://github.com/starship/starship/blob/master/LICENSE) лицензирован.

View File

@ -223,6 +223,9 @@ format = '\[[$symbol($version)]($style)\]'
[scala] [scala]
format = '\[[$symbol($version)]($style)\]' format = '\[[$symbol($version)]($style)\]'
[sudo]
format = '\[[as $symbol]\]
[swift] [swift]
format = '\[[$symbol($version)]($style)\]' format = '\[[$symbol($version)]($style)\]'
@ -371,6 +374,9 @@ symbol = "rs "
[scala] [scala]
symbol = "scala " symbol = "scala "
[sudo]
symbol = "sudo "
[swift] [swift]
symbol = "swift " symbol = "swift "
``` ```

View File

@ -42,7 +42,7 @@ function Invoke-Starship-PreCommand {
} }
``` ```
## Change Window Title ## Pencere Başlığını Değiştirme
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`. 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`.

View File

@ -61,7 +61,7 @@ Format strings are the format that a module prints all its variables with. Most
#### Variable #### Variable
A variable contains a `$` symbol followed by the name of the variable. The name of a variable only contains letters, numbers and `_`. A variable contains a `$` symbol followed by the name of the variable. The name of a variable can only contain letters, numbers and `_`.
For example: For example:
@ -106,18 +106,11 @@ For example:
- `(some text)` will always show nothing since there are no variables wrapped in the braces. - `(some text)` will always show nothing since there are no variables wrapped in the braces.
- When `$all` is a shortcut for `\[$a$b\]`, `($all)` will show nothing only if `$a` and `$b` are both `None`. This works the same as `(\[$a$b\] )`. - When `$all` is a shortcut for `\[$a$b\]`, `($all)` will show nothing only if `$a` and `$b` are both `None`. This works the same as `(\[$a$b\] )`.
#### Escapable characters #### Special characters
The following symbols have special usage in a format string. If you want to print the following symbols, you have to escape them with a backslash (`\`). The following symbols have special usage in a format string and must be escaped: `$ \ [ ] ( )`.
- \$ Note that TOML has [both basic strings and literal strings](https://toml.io/en/v1.0.0#string). It is recommended to use a literal string (surrounded by single quotes) in your config. If you want to use a basic string (surrounded by double quotes), you must escape the backslash itself (i.e. use `\\`).
- \\
- [
- ]
- (
- )
Note that `toml` has [its own escape syntax](https://github.com/toml-lang/toml#user-content-string). It is recommended to use a literal string (`''`) in your config. If you want to use a basic string (`""`), pay attention to escape the backslash `\`.
For example, when you want to print a `$` symbol on a new line, the following configs for `format` are equivalent: For example, when you want to print a `$` symbol on a new line, the following configs for `format` are equivalent:
@ -231,9 +224,11 @@ $memory_usage\
$aws\ $aws\
$gcloud\ $gcloud\
$openstack\ $openstack\
$azure\
$env_var\ $env_var\
$crystal\ $crystal\
$custom\ $custom\
$sudo\
$cmd_duration\ $cmd_duration\
$line_break\ $line_break\
$jobs\ $jobs\
@ -325,6 +320,31 @@ style = "bold blue"
symbol = "🅰 " symbol = "🅰 "
``` ```
## Azure
The `azure` module shows the current Azure Subscription. This is based on showing the name of the default subscription, as defined in the `~/.azure/azureProfile.json` file.
### Options
| Variable | Default | Description |
| ---------- | ---------------------------------------- | ------------------------------------------ |
| `format` | `"on [$symbol($subscription)]($style) "` | The format for the Azure module to render. |
| `symbol` | `"ﴃ "` | The symbol used in the format. |
| `style` | `"blue bold"` | The style used in the format. |
| `disabled` | `true` | Disables the `azure` module. |
### Example
```toml
# ~/.config/starship.toml
[azure]
disabled = false
format = "on [$symbol($subscription)]($style) "
symbol = "ﴃ "
style = "blue bold"
```
## Battery ## Battery
The `battery` module shows how charged the device's battery is and its current charging status. The module is only visible when the device's battery is below 10%. The `battery` module shows how charged the device's battery is and its current charging status. The module is only visible when the device's battery is below 10%.
@ -2129,6 +2149,7 @@ The `package` module is shown when the current directory is the repository for a
- [**Meson**](https://mesonbuild.com/) - The `meson` package version is extracted from the `meson.build` present - [**Meson**](https://mesonbuild.com/) - The `meson` package version is extracted from the `meson.build` present
- [**Shards**](https://crystal-lang.org/reference/the_shards_command/index.html) - The `shards` package version is extracted from the `shard.yml` present - [**Shards**](https://crystal-lang.org/reference/the_shards_command/index.html) - The `shards` package version is extracted from the `shard.yml` present
- [**V**](https://vlang.io) - The `vlang` package version is extracted from the `v.mod` present - [**V**](https://vlang.io) - The `vlang` package version is extracted from the `v.mod` present
- [**SBT**](https://scala-sbt.org) - The `sbt` package version is extracted from the `build.sbt` present in the current directory
> ⚠️ The version being shown is that of the package whose source code is in your current directory, not your package manager. > ⚠️ The version being shown is that of the package whose source code is in your current directory, not your package manager.
@ -2809,6 +2830,56 @@ disabled = false
``` ```
## Sudo
The `sudo` module displays if sudo credentials are currently cached. The module will only be shown if credentials are cached.
::: tip
This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
:::
### Options
| Option | Default | Description |
| --------------- | ----------------------- | ------------------------------------------------------- |
| `format` | `[as $symbol]($style)"` | The format of the module |
| `symbol` | `"🧙 "` | The symbol displayed when credentials are cached |
| `style` | `"bold blue"` | The style for the module. |
| `allow_windows` | `false` | Since windows has no default sudo, default is disabled. |
| `disabled` | `true` | Disables the `sudo` module. |
### Variables
| Variable | Example | Description |
| --------- | ------- | ------------------------------------ |
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
### Example
```toml
# ~/.config/starship.toml
[sudo]
style = "bold green"
symbol = "👩‍💻 "
disabled = false
```
```toml
# On windows
# $HOME\.starship\config.toml
[sudo]
allow_windows = true
disabled = false
```
## Swift ## Swift
By default the `swift` module shows the currently installed version of [Swift](https://swift.org/). The module will be shown if any of the following conditions are met: By default the `swift` module shows the currently installed version of [Swift](https://swift.org/). The module will be shown if any of the following conditions are met:

View File

@ -47,7 +47,7 @@ emerge app-shells/starship
## [Nix](https://nixos.wiki/wiki/Nix) ## [Nix](https://nixos.wiki/wiki/Nix)
### Getting the Binary ### Binary Alma
#### Zorunlu olarak #### Zorunlu olarak
@ -57,7 +57,7 @@ nix-env -iA nixos.starship
#### Açıklayıcı, tek kullanıcı, via [home-manager](https://github.com/nix-community/home-manager) #### Açıklayıcı, tek kullanıcı, via [home-manager](https://github.com/nix-community/home-manager)
Enable the `programs.starship` module in your `home.nix` file, and add your settings `home.nix` dosyanızda, `programs.starship` modülünü etkinleştirin, ayarlarınızı ekleyin
```nix ```nix
{ {
@ -79,7 +79,7 @@ Enable the `programs.starship` module in your `home.nix` file, and add your sett
} }
``` ```
then run sonra çalıştırın
```sh ```sh
home-manager switch home-manager switch

View File

@ -223,6 +223,9 @@ format = '\[[$symbol($version)]($style)\]'
[scala] [scala]
format = '\[[$symbol($version)]($style)\]' format = '\[[$symbol($version)]($style)\]'
[sudo]
format = '\[[as $symbol]\]
[swift] [swift]
format = '\[[$symbol($version)]($style)\]' format = '\[[$symbol($version)]($style)\]'
@ -371,6 +374,9 @@ symbol = "rs "
[scala] [scala]
symbol = "scala " symbol = "scala "
[sudo]
symbol = "sudo "
[swift] [swift]
symbol = "swift " symbol = "swift "
``` ```

View File

@ -43,11 +43,11 @@ function Invoke-Starship-PreCommand {
} }
``` ```
## Change Window Title ## Thay đổi tên gọi trên cửa sổ của chương trình terminal
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`. Một vài shell có khả năng tự động thay đổi tên hiển thị (chẳng hạn như tên của thư mục hiện thời) trên cửa số của trình mô phỏng terminal. Fish shell mặc định thực hiện thay đổi này. Tuy không được set mặc định trên Starship, chức năng này có thể được tích hợp dễ dàng trên `bash` shell và `zsh` shell.
First, define a window title change function (identical in bash and zsh): Đầu tiên, ta cần định nghĩa một hàm thay đổi tiêu đề cửa sổ (dùng chung cho cả bash và zsh):
```bash ```bash
function set_win_title(){ function set_win_title(){
@ -55,23 +55,23 @@ function set_win_title(){
} }
``` ```
You can use variables to customize this title (`$USER`, `$HOSTNAME`, and `$PWD` are popular choices). Ta có thể sử dụng biến số để tuỳ chỉnh tên hiển thị này (`$USER`, `$HOSTNAME`, và `$PWD` là những biến số thường được dùng).
In `bash`, set this function to be the precmd starship function: Với `bash` shell, set precmd của starship bằng tên của hàm này:
```bash ```bash
starship_precmd_user_func="set_win_title" starship_precmd_user_func="set_win_title"
``` ```
In `zsh`, add this to the `precmd_functions` array: Với `zsh` shell, thêm hàm này vào mảng `precmd_functions`:
```bash ```bash
precmd_functions+=(set_win_title) precmd_functions+=(set_win_title)
``` ```
If you like the result, add these lines to your shell configuration file (`~/.bashrc` or `~/.zshrc`) to make it permanent. Nếu ta hài lòng với các tùy biến đã được thiết lập, thêm những dòng sau vào cấu hình shell (`~/.bashrc` hoặc `~/.zshrc`) để thực thi chúng mỗi khi ta khởi tạo một shell mới.
For example, if you want to display your current directory in your terminal tab title, add the following snippet to your `~/.bashrc` or `~/.zshrc`: Ví dụ, nếu ta muốn hiển thị đường dẫn thư mục hiện tại trong tiêu đề của một terminal tab, thêm đoạn code sau vào `~/.bashrc` hoặc `~/.zshrc`:
```bash ```bash
function set_win_title(){ function set_win_title(){
@ -120,7 +120,7 @@ Produces a prompt like the following:
## Các chuỗi kiểu ## Các chuỗi kiểu
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: Chuỗi kiểu là một danh sách các từ, được phân cách bởi khoảng trắng. Các từ là không phân biệt hoa thường (ví dụ. `bold``Bold` là hai chuỗi tương đương). Mỗi từ có thể là một trong các từ sau:
- `bold` - `bold`
- `nghiêng` - `nghiêng`
@ -132,14 +132,14 @@ Style strings are a list of words, separated by whitespace. The words are not ca
- `<color>` - `<color>`
- `none` - `none`
where `<color>` is a color specifier (discussed below). `fg:<color>` and `<color>` currently do the same thing, though this may change in the future. `inverted` swaps the background and foreground colors. The order of words in the string does not matter. `<color>` là một nơi quy định màu (được bàn luận ở phía dưới). `fg:<color>` and `<color>` currently do the same thing, though this may change in the future. `inverted` swaps the background and foreground colors. Thứ tự các từ trong chuỗi là không quan trọng.
The `none` token overrides all other tokens in a string if it is not part of a `bg:` specifier, so that e.g. `fg:red none fg:blue` will still create a string with no styling. `bg:none` sets the background to the default color so `fg:red bg:none` is equivalent to `red` or `fg:red` and `bg:green fg:red bg:none` is also equivalent to `fg:red` or `red`. It may become an error to use `none` in conjunction with other tokens in the future. Từ mã `none` ghi đè tất cả các từ mã khác trong chuỗi nếu nó không là một phần của `bg:` specifier, vậy nên `fg:red none fg:blue` sẽ vẫn tạo một chuỗi mà không có kiểu. `bg:none` sets the background to the default color so `fg:red bg:none` is equivalent to `red` or `fg:red` and `bg:green fg:red bg:none` is also equivalent to `fg:red` or `red`. Nó có thể trở thành một lỗi để sử dụng `none` trong việc kết hợp với các từ mã khác trong tương lai.
A color specifier can be one of the following: Một quy định màu có thể là một trong các thứ sau:
- Một tròn các màu chuẩn của terminal: `black`, `red`, `green`, `blue`, `yellow`, `purple`, `cyan`, `white`. Bạn có thể tuỳ chọn những tiền tố này với `bright` để có được phiên bản sáng hơn (ví dụ: `bright-white`). - Một tròn các màu chuẩn của terminal: `black`, `red`, `green`, `blue`, `yellow`, `purple`, `cyan`, `white`. Bạn có thể tuỳ chọn những tiền tố này với `bright` để có được phiên bản sáng hơn (ví dụ: `bright-white`).
- Một `#` được theo sau bởi một số thập lục phân gồm sáu chữ số. Cái này quy định một [mã thập lục phân cho màu RGB](https://www.w3schools.com/colors/colors_hexadecimal.asp). - Một `#` được theo sau bởi một số thập lục phân gồm sáu chữ số. Cái này quy định một [mã thập lục phân cho màu RGB](https://www.w3schools.com/colors/colors_hexadecimal.asp).
- Một số nằm giữa 0-255. Cái này quy định một [mã màu ANSI 8-bit](https://i.stack.imgur.com/KTSQa.png). - Một số nằm giữa 0-255. Cái này quy định một [mã màu ANSI 8-bit](https://i.stack.imgur.com/KTSQa.png).
If multiple colors are specified for foreground/background, the last one in the string will take priority. Nếu nhiều màu được quy định cho màu chữ/màu nền, cái cuối cùng trong chuỗi sẽ được ưu tiên.

File diff suppressed because it is too large Load Diff

View File

@ -60,9 +60,9 @@ sh -c "$(curl -fsSL https://starship.rs/install.sh)" -- --platform unknown-linux
Starship executes different commands to get information to display in the prompt, for example the version of a program or the current git status. To make sure starship doesn't hang while trying to execute these commands we set a time limit, if a command takes longer than this limit starship will stop the execution of the command and output the above warning, this is expected behaviour. This time limit is configurable using the [`command_timeout` key](/config/#prompt) so if you want you can increase the time limit. You can also follow the debugging steps below to see which command is being slow and see if you can optimise it. Finally you can set the `STARSHIP_LOG` env var to `error` to hide these warnings. Starship executes different commands to get information to display in the prompt, for example the version of a program or the current git status. To make sure starship doesn't hang while trying to execute these commands we set a time limit, if a command takes longer than this limit starship will stop the execution of the command and output the above warning, this is expected behaviour. This time limit is configurable using the [`command_timeout` key](/config/#prompt) so if you want you can increase the time limit. You can also follow the debugging steps below to see which command is being slow and see if you can optimise it. Finally you can set the `STARSHIP_LOG` env var to `error` to hide these warnings.
## I see symbols I don't understand or expect, what do they mean? ## Tôi thấy các biểu tượng tôi không hiểu hoặc không mong muốn, chúng có nghĩa là gì?
If you see symbols that you don't recognise you can use `starship explain` to explain the currently showing modules. Nếu bạn thấy các biểu tượng bạn không biết, bạn có thể sử dụng `starship explain` để giải thích các mô đun hiện tại đang hiển thị.
## Starship is doing something unexpected, how can I debug it? ## Starship is doing something unexpected, how can I debug it?
@ -86,33 +86,33 @@ Finally if you find a bug you can use the `bug-report` command to create a Githu
starship bug-report starship bug-report
``` ```
## Why don't I see a glyph symbol in my prompt? ## Tại sao tôi không tình thấy một kí hiệu glyph trong prompt?
The most common cause of this is system misconfiguration. Some Linux distros in particular do not come with font support out-of-the-box. You need to ensure that: Đa số nguyên nhân phổ biến của việc này là cấu hình hệ thống sai. Một số bản phân phối Linux đặc biệt không có hỗ trợ phông chữ ngay lập tức. Bạn cần chắc chắn rằng:
- Mã ngôn ngữ của bạn được thiết lập là một giá trị UTF-8, giống như `de_DE.UTF-8` or `ja_JP.UTF-8`. Nếu `LO_ALL` không phải là một giá trị UTF-8, [ bạn sẽ cần thay đổi nó](https://www.tecmint.com/set-system-locales-in-linux/). - Mã ngôn ngữ của bạn được thiết lập là một giá trị UTF-8, giống như `de_DE.UTF-8` or `ja_JP.UTF-8`. Nếu `LO_ALL` không phải là một giá trị UTF-8, [ bạn sẽ cần thay đổi nó](https://www.tecmint.com/set-system-locales-in-linux/).
- Bạn đã cài đặt phông chữ biểu tượng cảm xúc. Đa số hệ thống đi kèm với một phông biểu tượng cảm xúc mặc định, nhưng một vài (đáng chú ý là Arch Linux) thì không. Bạn có thể thường cài đặt thông qua một trình quản lí gói hệ thống của bạn--[noto emoji](https://www.google.com/get/noto/help/emoji/) là một lựa chọn phổ biến. - Bạn đã cài đặt phông chữ biểu tượng cảm xúc. Đa số hệ thống đi kèm với một phông biểu tượng cảm xúc mặc định, nhưng một vài (đáng chú ý là Arch Linux) thì không. Bạn có thể thường cài đặt thông qua một trình quản lí gói hệ thống của bạn--[noto emoji](https://www.google.com/get/noto/help/emoji/) là một lựa chọn phổ biến.
- Bạn đang sử dụng một [Nerd Font](https://www.nerdfonts.com/). - Bạn đang sử dụng một [Nerd Font](https://www.nerdfonts.com/).
To test your system, run the following commands in a terminal: Để kiểm tra hệ thống của bạn, chạy các câu lệnh sau trong một terminal:
```sh ```sh
echo -e "\xf0\x9f\x90\x8d" echo -e "\xf0\x9f\x90\x8d"
echo -e "\xee\x82\xa0" echo -e "\xee\x82\xa0"
``` ```
The first line should produce a [snake emoji](https://emojipedia.org/snake/), while the second should produce a [powerline branch symbol (e0a0)](https://github.com/ryanoasis/powerline-extra-symbols#glyphs). Dòng đầu tiên nên sinh ra một [snake emoji](https://emojipedia.org/snake/), trong khi dòng thứ hai nên sinh ra một [powerline branch symbol (e0a0)](https://github.com/ryanoasis/powerline-extra-symbols#glyphs).
If either symbol fails to display correctly, your system is still misconfigured. Unfortunately, getting font configuration correct is sometimes difficult. Users on the Discord may be able to help. If both symbols display correctly, but you still don't see them in starship, [file a bug report!](https://github.com/starship/starship/issues/new/choose) Nếu một trong hai biểu tượng không hiển thị chính xác, hệ thống của bạn vẫn bị cấu hình sai. Thật không may, việc lấy đúng cấu hình phông chữ đôi khi rất khó. Những người dùng trên Discord có thể giúp đỡ. Nếu cả hai kí hiệu hiển thị đúng, nhưng bạn vẫn không thấy chúng trong starship, [nộp một báo cáo lỗi!](https://github.com/starship/starship/issues/new/choose)
## How do I uninstall Starship? ## Làm cách nào để tôi gỡ cài đặt Starship?
Starship is just as easy to uninstall as it is to install in the first place. Starship thì dễ dàng gỡ cài đặt như cài đặt ngay từ đầu.
1. Gỡ mọi tập tin trong cấu hình shell của bạn (e.g. `~/.bashrc`) đã sử dụng để khởi tạo Starship. 1. Gỡ mọi tập tin trong cấu hình shell của bạn (e.g. `~/.bashrc`) đã sử dụng để khởi tạo Starship.
1. Xoá tập tin Starship nhị phân. 1. Xoá tập tin Starship nhị phân.
If Starship was installed using a package manager, please refer to their docs for uninstallation instructions. Nếu Starship đã được cài đặt bằng việc sử dụng một trình quản lí gói, vui lòng tham khảo tài liệu của chúng để gỡ cài đặt.
If Starship was installed using the install script, the following command will delete the binary: If Starship was installed using the install script, the following command will delete the binary:

View File

@ -306,7 +306,7 @@ Nếu bạn thích thú trong việc giúp đỡ đóng góp cho starship, xin h
## Cảm hứng ## Cảm hứng
Please check out these previous works that helped inspire the creation of starship. 🙏 Xin hãy xem qua những công việc này trước đây, những thứ đã giúp truyền cảm hứng để tạo ra starship. 🙏
- **[denysdovhan/spaceship-prompt](https://github.com/denysdovhan/spaceship-prompt)** - A ZSH prompt cho những phi hành gia. - **[denysdovhan/spaceship-prompt](https://github.com/denysdovhan/spaceship-prompt)** - A ZSH prompt cho những phi hành gia.
@ -321,4 +321,4 @@ Please check out these previous works that helped inspire the creation of starsh
## 📝 Giấy phép ## 📝 Giấy phép
Copyright © 2019-present, [Starship Contributors](https://github.com/starship/starship/graphs/contributors).<br /> This project is [ISC](https://github.com/starship/starship/blob/master/LICENSE) licensed. Bản quyền © 2019-nay, [Starship Contributors](https://github.com/starship/starship/graphs/contributors).<br /> Dự án này được [ISC](https://github.com/starship/starship/blob/master/LICENSE) cấp phép.

View File

@ -47,7 +47,7 @@ emerge app-shells/starship
## [Nix](https://nixos.wiki/wiki/Nix) ## [Nix](https://nixos.wiki/wiki/Nix)
### Getting the Binary ### Lấy tệp tin nhị phân
#### Lệnh #### Lệnh
@ -57,14 +57,14 @@ nix-env -iA nixos.starship
#### Khai báo, người dùng đơn, thông qua [home-manager](https://github.com/nix-community/home-manager) #### Khai báo, người dùng đơn, thông qua [home-manager](https://github.com/nix-community/home-manager)
Enable the `programs.starship` module in your `home.nix` file, and add your settings Kích hoạt mô đun `programs.starship` trong tệp `home.nix` của bạn, và thêm các cài đặt của bạn
```nix ```nix
{ {
programs.starship = { programs.starship = {
enable = true; enable = true;
enableZshIntegration = true; enableZshIntegration = true;
# Configuration written to ~/.config/starship.toml # Cấu hình viết vào ~/.config/starship.toml
settings = { settings = {
# add_newline = false; # add_newline = false;
@ -79,7 +79,7 @@ Enable the `programs.starship` module in your `home.nix` file, and add your sett
} }
``` ```
then run sau đó chạy
```sh ```sh
home-manager switch home-manager switch
@ -87,7 +87,7 @@ home-manager switch
#### Khai báo, system-wide, với NixOS #### Khai báo, system-wide, với NixOS
Add `pkgs.starship` to `environment.systemPackages` in your `configuration.nix`, then run Thêm`pkgs.starship` vào `environment.systemPackages` trong `configuration.nix` của bạn, sau đó chạy
```sh ```sh
sudo nixos-rebuild switch sudo nixos-rebuild switch

View File

@ -223,6 +223,9 @@ format = '\[[$symbol($version)]($style)\]'
[scala] [scala]
format = '\[[$symbol($version)]($style)\]' format = '\[[$symbol($version)]($style)\]'
[sudo]
format = '\[[as $symbol]\]
[swift] [swift]
format = '\[[$symbol($version)]($style)\]' format = '\[[$symbol($version)]($style)\]'
@ -371,6 +374,9 @@ symbol = "rs "
[scala] [scala]
symbol = "scala " symbol = "scala "
[sudo]
symbol = "sudo "
[swift] [swift]
symbol = "swift " symbol = "swift "
``` ```

View File

@ -43,11 +43,11 @@ function Invoke-Starship-PreCommand {
} }
``` ```
## Change Window Title ## 更改窗口标题
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`. 一些 shell 会自动更改您的窗口标题(比如改成您的工作目录)。 Fish 甚至默认会执行此功能。 Starship 没有实现此功能,但将这个功能添加到 `bash``zsh` 是相当简单的。
First, define a window title change function (identical in bash and zsh): 首先,定义窗口标题更改函数(在 bash 和 zsh 中相同):
```bash ```bash
function set_win_title(){ function set_win_title(){
@ -55,23 +55,23 @@ function set_win_title(){
} }
``` ```
You can use variables to customize this title (`$USER`, `$HOSTNAME`, and `$PWD` are popular choices). 您可以使用变量来定制标题(常用的有 `$USER``$HOSTNAME` 和 `$PWD`)。
In `bash`, set this function to be the precmd starship function: `bash` 中,设置此函数为 starship 预执行函数:
```bash ```bash
starship_precmd_user_func="set_win_title" starship_precmd_user_func="set_win_title"
``` ```
In `zsh`, add this to the `precmd_functions` array: `zsh`中,将此函数添加到 `reservmd_functions` 列表:
```bash ```bash
precmd_functions+=(set_win_title) precmd_functions+=(set_win_title)
``` ```
If you like the result, add these lines to your shell configuration file (`~/.bashrc` or `~/.zshrc`) to make it permanent. 如果您对产生的效果感到满意,请将以上代码添加到您的 shell 配置文件(`~/.bashrc` 或 `~/zsrhc`)中以使其永久化。
For example, if you want to display your current directory in your terminal tab title, add the following snippet to your `~/.bashrc` or `~/.zshrc`: 例如,如果您想要在终端标签标题中显示当前目录, 将以下代码添加到您的 `~/.ashrc` `~/.zshrc`:
```bash ```bash
function set_win_title(){ function set_win_title(){
@ -91,9 +91,9 @@ function Invoke-Starship-PreCommand {
Invoke-Expression (&starship init powershell) Invoke-Expression (&starship init powershell)
``` ```
## Enable Right Prompt ## 启用右侧提示
Some shells support a right prompt which renders on the same line as the input. Starship can set the content of the right prompt using the `right_format` option. Any module that can be used in `format` is also supported in `right_format`. The `$all` variable will only contain modules not explicitly used in either `format` or `right_format`. 一些 Shell 支持右侧提示, 它与输入区渲染在同一行。 Starship 可以设置右侧提示的内容,使用 `right_format` 选项。 Any module that can be used in `format` is also supported in `right_format`. The `$all` variable will only contain modules not explicitly used in either `format` or `right_format`.
Note: The right prompt is a single line following the input location. To right align modules above the input line in a multi-line prompt, see the [fill module](/config/#fill). Note: The right prompt is a single line following the input location. To right align modules above the input line in a multi-line prompt, see the [fill module](/config/#fill).
@ -120,7 +120,7 @@ Produces a prompt like 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). Each word can be one of the following: 样式字符串是用空格分隔的单词列表。 其中单词不是大小写敏感的(例如 `bold``BoLd` 被视为同一字符串)。 每个单词可以是以下之一:
- `bold` - `bold`
- `italic` - `italic`
@ -132,14 +132,14 @@ Style strings are a list of words, separated by whitespace. The words are not ca
- `<color>` - `<color>`
- `none` - `none`
where `<color>` is a color specifier (discussed below). `fg:<color>` and `<color>` currently do the same thing, though this may change in the future. `inverted` swaps the background and foreground colors. The order of words in the string does not matter. `<color>` 是颜色说明符(下面解释)。 `fg:<color>` and `<color>` currently do the same thing, though this may change in the future. `inverted` swaps the background and foreground colors. 字符串中的单词顺序不影响显示结果。
The `none` token overrides all other tokens in a string if it is not part of a `bg:` specifier, so that e.g. `fg:red none fg:blue` will still create a string with no styling. `bg:none` sets the background to the default color so `fg:red bg:none` is equivalent to `red` or `fg:red` and `bg:green fg:red bg:none` is also equivalent to `fg:red` or `red`. It may become an error to use `none` in conjunction with other tokens in the future. The `none` token overrides all other tokens in a string if it is not part of a `bg:` specifier, so that e.g. `fg:red none fg:blue` will still create a string with no styling. `bg:none` sets the background to the default color so `fg:red bg:none` is equivalent to `red` or `fg:red` and `bg:green fg:red bg:none` is also equivalent to `fg:red` or `red`. 未来可能会将 `none` 与其它标识符一起使用视为一种错误。
A color specifier can be one of the following: 颜色说明符可以是以下内容之一:
- 标准终端颜色之一:`black``red``green``blue``yellow``purple``cyan``white`。 您可以使用可选前缀 `bright-` 来获取明亮版本的颜色(例如,`bright-white`)。 - 标准终端颜色之一:`black``red``green``blue``yellow``purple``cyan``white`。 您可以使用可选前缀 `bright-` 来获取明亮版本的颜色(例如,`bright-white`)。
- 一个 `#` 后跟一个六位十六进制数。 这将指定一个 [十六进制 RGB 颜色代码](https://www.w3schools.com/colors/colors_hexadecimal.asp)。 - 一个 `#` 后跟一个六位十六进制数。 这将指定一个 [十六进制 RGB 颜色代码](https://www.w3schools.com/colors/colors_hexadecimal.asp)。
- 0-255 之间的数字。 这将指定一个 [8 位 ANSI 颜色码](https://i.stack.imgur.com/KTSQa.png)。 - 0-255 之间的数字。 这将指定一个 [8 位 ANSI 颜色码](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

@ -61,7 +61,7 @@ Format strings are the format that a module prints all its variables with. Most
#### 字段 #### 字段
A variable contains a `$` symbol followed by the name of the variable. The name of a variable only contains letters, numbers and `_`. A variable contains a `$` symbol followed by the name of the variable. The name of a variable can only contain letters, numbers and `_`.
For example: For example:
@ -106,18 +106,11 @@ For example:
- `(some text)` will always show nothing since there are no variables wrapped in the braces. - `(some text)` will always show nothing since there are no variables wrapped in the braces.
- When `$all` is a shortcut for `\[$a$b\]`, `($all)` will show nothing only if `$a` and `$b` are both `None`. This works the same as `(\[$a$b\] )`. - When `$all` is a shortcut for `\[$a$b\]`, `($all)` will show nothing only if `$a` and `$b` are both `None`. This works the same as `(\[$a$b\] )`.
#### Escapable characters #### Special characters
The following symbols have special usage in a format string. If you want to print the following symbols, you have to escape them with a backslash (`\`). The following symbols have special usage in a format string and must be escaped: `$ \ [ ] ( )`.
- \$ Note that TOML has [both basic strings and literal strings](https://toml.io/en/v1.0.0#string). It is recommended to use a literal string (surrounded by single quotes) in your config. If you want to use a basic string (surrounded by double quotes), you must escape the backslash itself (i.e. use `\\`).
- \\
- [
- ]
- (
- )
Note that `toml` has [its own escape syntax](https://github.com/toml-lang/toml#user-content-string). It is recommended to use a literal string (`''`) in your config. If you want to use a basic string (`""`), pay attention to escape the backslash `\`.
For example, when you want to print a `$` symbol on a new line, the following configs for `format` are equivalent: For example, when you want to print a `$` symbol on a new line, the following configs for `format` are equivalent:
@ -231,9 +224,11 @@ $memory_usage\
$aws\ $aws\
$gcloud\ $gcloud\
$openstack\ $openstack\
$azure\
$env_var\ $env_var\
$crystal\ $crystal\
$custom\ $custom\
$sudo\
$cmd_duration\ $cmd_duration\
$line_break\ $line_break\
$jobs\ $jobs\
@ -325,22 +320,47 @@ style = "bold blue"
symbol = "🅰 " symbol = "🅰 "
``` ```
## Battery ## Azure
`battery` 组件显示电池充电情况和当前充电状态。 这个组件只会在当前电量低于 10% 时显示。 The `azure` module shows the current Azure Subscription. This is based on showing the name of the default subscription, as defined in the `~/.azure/azureProfile.json` file.
### 配置项 ### 配置项
| Option | 默认值 | 描述 | | 字段 | 默认值 | 描述 |
| -------------------- | --------------------------------- | ---------------- | | ---------- | ---------------------------------------- | ------------------------------------------ |
| `full_symbol` | `" "` | 显示于电池充满时。 | | `format` | `"on [$symbol($subscription)]($style) "` | The format for the Azure module to render. |
| `charging_symbol` | `" "` | 显示于正在充电时。 | | `symbol` | `"ﴃ "` | The symbol used in the format. |
| `discharging_symbol` | `" "` | 显示于电池放电时。 | | `style` | `"blue bold"` | The style used in the format. |
| `unknown_symbol` | `" "` | 显示于电池状态未知时 | | `disabled` | `true` | Disables the `azure` module. |
| `empty_symbol` | `" "` | 显示于电池状态为空时 |
| `format` | `"[$symbol$percentage]($style) "` | 组件格式化模板。 | ### 示例
| `display` | [见下文](#battery-display) | 电量显示阈值和样式。 |
| `disabled` | `false` | 禁用 `battery` 组件。 | ```toml
# ~/.config/starship.toml
[azure]
disabled = false
format = "on [$symbol($subscription)]($style) "
symbol = "ﴃ "
style = "blue bold"
```
## Battery
The `battery` module shows how charged the device's battery is and its current charging status. The module is only visible when the device's battery is below 10%.
### 配置项
| Option | 默认值 | 描述 |
| -------------------- | --------------------------------- | --------------------------------------------------- |
| `full_symbol` | `" "` | The symbol shown when the battery is full. |
| `charging_symbol` | `" "` | The symbol shown when the battery is charging. |
| `discharging_symbol` | `" "` | The symbol shown when the battery is discharging. |
| `unknown_symbol` | `" "` | The symbol shown when the battery state is unknown. |
| `empty_symbol` | `" "` | The symbol shown when the battery state is empty. |
| `format` | `"[$symbol$percentage]($style) "` | 组件格式化模板。 |
| `display` | [见下文](#battery-display) | Display threshold and style for the module. |
| `disabled` | `false` | Disables the `battery` module. |
### 示例 ### 示例
@ -353,9 +373,9 @@ charging_symbol = "⚡️ "
discharging_symbol = "💀 " discharging_symbol = "💀 "
``` ```
### Battery 组件的显示 ### Battery Display
The `display` configuration option is used to define when the battery indicator should be shown (threshold), which symbol would be used (symbol), and what it would like (style). 如果 `display` 没有设置, 默认设置如下: The `display` configuration option is used to define when the battery indicator should be shown (threshold), which symbol would be used (symbol), and what it would like (style). If no `display` is provided. 默认设置如下:
```toml ```toml
[[battery.display]] [[battery.display]]
@ -367,12 +387,12 @@ The default value for the `charging_symbol` and `discharging_symbol` option is r
#### 配置项 #### 配置项
`display` 字段的子字段如下: The `display` option is an array of the following table.
| Option | 默认值 | 描述 | | Option | 默认值 | 描述 |
| -------------------- | ---------- | --------------------------------------------------------------------------------------------------------- | | -------------------- | ---------- | --------------------------------------------------------------------------------------------------------- |
| `threshold` | `10` | 当前显示设置的电量上限(见示例) | | `threshold` | `10` | The upper bound for the display option. |
| `style` | `bold red` | 若组件被显示,则使用此样式 | | `style` | `bold red` | The style used if the display option is in use. |
| `charging_symbol` | `-` | Optional symbol displayed if display option is in use, defaults to battery's `charging_symbol` option. | | `charging_symbol` | `-` | Optional symbol displayed if display option is in use, defaults to battery's `charging_symbol` option. |
| `discharging_symbol` | `-` | Optional symbol displayed if display option is in use, defaults to battery's `discharging_symbol` option. | | `discharging_symbol` | `-` | Optional symbol displayed if display option is in use, defaults to battery's `discharging_symbol` option. |
@ -394,9 +414,9 @@ discharging_symbol = "💦"
## Character ## Character
`character` 组件用于在您输入终端的文本旁显示一个字符(通常是一个箭头)。 The `character` module shows a character (usually an arrow) beside where the text is entered in your terminal.
这个字符可以告诉您最后一个命令是否执行成功。 It can do this in two ways: The character will tell you whether the last command was successful or not. It can do this in two ways:
- changing color (`red`/`green`) - changing color (`red`/`green`)
- changing shape (``/`✖`) - changing shape (``/`✖`)
@ -423,7 +443,7 @@ By default it only changes color. If you also want to change its shape take a lo
| `success_symbol` | `"[](bold green)"` | The format string used before the text input if the previous command succeeded. | | `success_symbol` | `"[](bold green)"` | The format string used before the text input if the previous command succeeded. |
| `error_symbol` | `"[](bold red)"` | The format string used before the text input if the previous command failed. | | `error_symbol` | `"[](bold red)"` | The format string used before the text input if the previous command failed. |
| `vicmd_symbol` | `"[](bold green)"` | The format string used before the text input if the shell is in vim normal mode. | | `vicmd_symbol` | `"[](bold green)"` | The format string used before the text input if the shell is in vim normal mode. |
| `disabled` | `false` | 禁用 `character` 组件。 | | `disabled` | `false` | Disables the `character` module. |
### Variables ### Variables
@ -524,27 +544,27 @@ The `cobol` module shows the currently installed version of COBOL. By default, t
## Command Duration ## Command Duration
`cmd_duration` 组件显示上一个命令执行的时间。 此组件只在命令执行时间长于两秒时显示,或者当其 `min_time` 字段被设置时,按此值为执行时间的显示下限。 The `cmd_duration` module shows how long the last command took to execute. The module will be shown only if the command took longer than two seconds, or the `min_time` config value, if it exists.
::: warning 不要在 Bash 里捕获 DEBUG 信号 ::: warning Do not hook the DEBUG trap in Bash
如果您正在 `bash` 上使用 Starship在运行 `eval $(starship)` 后,不要捕获 `DEBUG` 信号,否则此组件**将会**坏掉。 If you are running Starship in `bash`, do not hook the `DEBUG` trap after running `eval $(starship init $0)`, or this module **will** break.
::: :::
需要在自动每一条命令前执行某些操作的 Bash 用户可以使用 [rcaloras 的 bash_preexec 框架](https://github.com/rcaloras/bash-preexec)。 只需要在执行 `eval $(starship init $0)` 前简单地定义 `preexec_functions``precmd_functions` 两个列表,就可以照常运行了。 Bash users who need preexec-like functionality can use [rcaloras's bash_preexec framework](https://github.com/rcaloras/bash-preexec). Simply define the arrays `preexec_functions` and `precmd_functions` before running `eval $(starship init $0)`, and then proceed as normal.
### 配置项 ### 配置项
| Option | 默认值 | 描述 | | Option | 默认值 | 描述 |
| -------------------- | ----------------------------- | ----------------------------------------------------- | | -------------------- | ----------------------------- | ---------------------------------------------------------- |
| `min_time` | `2_000` | 显示此组件所需的最短执行时长(单位:毫秒)。 | | `min_time` | `2_000` | Shortest duration to show time for (in milliseconds). |
| `show_milliseconds` | `false` | 除了秒数外在执行时长中额外显示毫秒。 | | `show_milliseconds` | `false` | Show milliseconds in addition to seconds for the duration. |
| `format` | `"took [$duration]($style) "` | 组件格式化模板。 | | `format` | `"took [$duration]($style) "` | 组件格式化模板。 |
| `style` | `"bold yellow"` | 此组件的样式。 | | `style` | `"bold yellow"` | 此组件的样式。 |
| `disabled` | `false` | 禁用 `cmd_duration` 组件。 | | `disabled` | `false` | Disables the `cmd_duration` module. |
| `show_notifications` | `false` | Show desktop notifications when command completes. | | `show_notifications` | `false` | Show desktop notifications when command completes. |
| `min_time_to_notify` | `45_000` | Shortest duration for notification (in milliseconds). | | `min_time_to_notify` | `45_000` | Shortest duration for notification (in milliseconds). |
::: tip ::: tip
@ -577,20 +597,20 @@ The `conda` module shows the current [Conda](https://docs.conda.io/en/latest/) e
::: tip ::: tip
此组件没有禁用 conda 自带的提示符修改,您可能需要执行 `conda config --set changeps1 False` This does not suppress conda's own prompt modifier, you may want to run `conda config --set changeps1 False`.
::: :::
### 配置项 ### 配置项
| Option | 默认值 | 描述 | | Option | 默认值 | 描述 |
| ------------------- | -------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | | ------------------- | -------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `truncation_length` | `1` | 如果这个 conda 环境是通过 `conda create -p [path]` 创建的,环境路径的目录深度应该被截断到此数量。 `0` 表示不用截断。 另请参阅 [`directory`](#directory) 组件。 | | `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` | `"🅒 "` | 在环境名之前显示的符号。 | | `symbol` | `"🅒 "` | The symbol used before the environment name. |
| `style` | `"bold green"` | 此组件的样式。 | | `style` | `"bold green"` | 此组件的样式。 |
| `format` | `"via [$symbol$environment]($style) "` | 组件格式化模板。 | | `format` | `"via [$symbol$environment]($style) "` | 组件格式化模板。 |
| `ignore_base` | `true` | Ignores `base` environment when activated. | | `ignore_base` | `true` | Ignores `base` environment when activated. |
| `disabled` | `false` | 禁用 `conda` 组件。 | | `disabled` | `false` | Disables the `conda` module. |
### Variables ### Variables
@ -615,7 +635,7 @@ format = "[$symbol$environment](dimmed green) "
The `crystal` module shows the currently installed version of [Crystal](https://crystal-lang.org/). By default the module will be shown if any of the following conditions are met: The `crystal` module shows the currently installed version of [Crystal](https://crystal-lang.org/). By default the module will be shown if any of the following conditions are met:
- 当前目录包含 `shard.yml` 文件 - The current directory contains a `shard.yml` file
- The current directory contains a `.cr` file - The current directory contains a `.cr` file
### 配置项 ### 配置项
@ -656,7 +676,7 @@ The `dart` module shows the currently installed version of [Dart](https://dart.d
- The current directory contains a file with `.dart` extension - The current directory contains a file with `.dart` extension
- The current directory contains a `.dart_tool` directory - The current directory contains a `.dart_tool` directory
- 当前目录包含 `pubspec.yaml``pubspec.yml` 或 `pubspec.lock` 文件 - The current directory contains a `pubspec.yaml`, `pubspec.yml` or `pubspec.lock` file
### 配置项 ### 配置项
@ -727,21 +747,21 @@ format = "via [🦕 $version](green bold) "
## Directory ## Directory
`directory` 组件显示当前目录的路径,显示的路径会截断到三个父目录以内。 如果您处于一个 git 仓库中,显示的路径则最多会截断到该仓库的根目录。 The `directory` module shows the path to your current directory, truncated to three parent folders. Your directory will also be truncated to the root of the git repo that you're currently in.
当使用 fish 风格的当前目录显示样式时,您会看到基于您的设置的每个上级目录的短名称,而不是隐藏被截断的上级目录。 When using the fish style pwd option, instead of hiding the path that is truncated, you will see a shortened name of each directory based on the number you enable for the option.
例如,对于 `~/Dev/Nix/nixpkgs/pkgs`,其中 `nixpkgs` 是 git 仓库根目录fish 风格相关选项设置为 `1`。 您将会看到 `~/D/N/nixpkgs/pkgs`,而在设置 fish 风格之前,当前路径将显示成 `nixpkgs/pkgs` For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, and the option set to `1`. You will now see `~/D/N/nixpkgs/pkgs`, whereas before it would have been `nixpkgs/pkgs`.
### 配置项 ### 配置项
| Option | 默认值 | 描述 | | Option | 默认值 | 描述 |
| ------------------- | -------------------------------------------------- | -------------------------------------------------------------------------------------- | | ------------------- | -------------------------------------------------- | -------------------------------------------------------------------------------------- |
| `truncation_length` | `3` | 当前目录路径被截断后最多保留的父目录数量。 | | `truncation_length` | `3` | The number of parent folders that the current directory should be truncated to. |
| `truncate_to_repo` | `true` | 是否只截断到您当前处于的 git 仓库根目录下。 | | `truncate_to_repo` | `true` | Whether or not to truncate to the root of the git repo that you're currently in. |
| `format` | `"[$path]($style)[$read_only]($read_only_style) "` | 组件格式化模板。 | | `format` | `"[$path]($style)[$read_only]($read_only_style) "` | 组件格式化模板。 |
| `style` | `"bold cyan"` | 此组件的样式。 | | `style` | `"bold cyan"` | 此组件的样式。 |
| `disabled` | `false` | 禁用 `directory` 组件。 | | `disabled` | `false` | Disables the `directory` module. |
| `read_only` | `"🔒"` | The symbol indicating current directory is read only. | | `read_only` | `"🔒"` | The symbol indicating current directory is read only. |
| `read_only_style` | `"red"` | The style for the read only symbol. | | `read_only_style` | `"red"` | The style for the read only symbol. |
| `truncation_symbol` | `""` | The symbol to prefix to truncated paths. eg: "…/" | | `truncation_symbol` | `""` | The symbol to prefix to truncated paths. eg: "…/" |
@ -749,12 +769,12 @@ format = "via [🦕 $version](green bold) "
| `home_symbol` | `"~"` | The symbol indicating home directory. | | `home_symbol` | `"~"` | The symbol indicating home directory. |
<details> <details>
<summary>此组件有几个高级配置选项来控制当前目录路径的显示方式。</summary> <summary>This module has a few advanced configuration options that control how the directory is displayed.</summary>
| Advanced Option | 默认值 | 描述 | | Advanced Option | 默认值 | 描述 |
| --------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | --------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `substitutions` | | A table of substitutions to be made to the path. | | `substitutions` | | A table of substitutions to be made to the path. |
| `fish_style_pwd_dir_length` | `0` | 使用 fish shell 当前目录路径逻辑时每个省略目录名使用的字符数。 | | `fish_style_pwd_dir_length` | `0` | The number of characters to use when applying fish shell pwd path logic. |
| `use_logical_path` | `true` | If `true` render the logical path sourced from the shell via `PWD` or `--logical-path`. If `false` instead render the physical filesystem path with symlinks resolved. | | `use_logical_path` | `true` | If `true` render the logical path sourced from the shell via `PWD` or `--logical-path`. If `false` instead render the physical filesystem path with symlinks resolved. |
`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. `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.
@ -826,7 +846,7 @@ format = "via [🐋 $context](blue bold)"
## Dotnet ## Dotnet
The `dotnet` module shows the relevant version of the [.NET Core SDK](https://dotnet.microsoft.com/) for the current directory. 如果当前目录已被绑定了一个版本的 SDK则显示被帮定的版本。 否则此组件将显示最新安装的 SDK 版本。 The `dotnet` module shows the relevant version of the [.NET Core SDK](https://dotnet.microsoft.com/) 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.
By default this module will only be shown in your prompt when one or more of the following files are present in the current directory: By default this module will only be shown in your prompt when one or more of the following files are present in the current directory:
@ -841,7 +861,7 @@ By default this module will only be shown in your prompt when one or more of the
You'll also need the .NET Core SDK installed in order to use it correctly. You'll also need the .NET Core SDK 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.
The module will also show the Target Framework Moniker (<https://docs.microsoft.com/en-us/dotnet/standard/frameworks#supported-target-framework-versions>) when there is a csproj file in the current directory. The module will also show the Target Framework Moniker (<https://docs.microsoft.com/en-us/dotnet/standard/frameworks#supported-target-framework-versions>) when there is a csproj file in the current directory.
@ -851,13 +871,13 @@ The module will also show the Target Framework Moniker (<https://docs.microsoft.
| ------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- | | ------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| `format` | `"via [$symbol($version )(🎯 $tfm )]($style)"` | 组件格式化模板。 | | `format` | `"via [$symbol($version )(🎯 $tfm )]($style)"` | 组件格式化模板。 |
| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | | `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` |
| `symbol` | `".NET "` | 这个字段的内容会显示在当前 .NET 版本之前。 | | `symbol` | `".NET "` | The symbol used before displaying the version of dotnet. |
| `heuristic` | `true` | 使用更快的版本探测机制以保证 starship 的运行速度。 | | `heuristic` | `true` | Use faster version detection to keep starship snappy. |
| `detect_extensions` | `["csproj", "fsproj", "xproj"]` | Which extensions should trigger this module. | | `detect_extensions` | `["csproj", "fsproj", "xproj"]` | Which extensions should trigger this module. |
| `detect_files` | `["global.json", "project.json", "Directory.Build.props", "Directory.Build.targets", "Packages.props"]` | Which filenames should trigger this module. | | `detect_files` | `["global.json", "project.json", "Directory.Build.props", "Directory.Build.targets", "Packages.props"]` | Which filenames should trigger this module. |
| `detect_folders` | `[]` | Which folders should trigger this modules. | | `detect_folders` | `[]` | Which folders should trigger this modules. |
| `style` | `"bold blue"` | 此组件的样式。 | | `style` | `"bold blue"` | 此组件的样式。 |
| `disabled` | `false` | 禁用 `dotnet` 组件。 | | `disabled` | `false` | Disables the `dotnet` module. |
### Variables ### Variables
@ -885,7 +905,7 @@ heuristic = false
The `elixir` module shows the currently installed version of [Elixir](https://elixir-lang.org/) and [Erlang/OTP](https://erlang.org/doc/). By default the module will be shown if any of the following conditions are met: The `elixir` module shows the currently installed version of [Elixir](https://elixir-lang.org/) and [Erlang/OTP](https://erlang.org/doc/). By default the module will be shown if any of the following conditions are met:
- 当前目录包含 `mix.exs` 文件. - The current directory contains a `mix.exs` file.
### 配置项 ### 配置项
@ -924,8 +944,8 @@ symbol = "🔮 "
The `elm` module shows the currently installed version of [Elm](https://elm-lang.org/). By default the module will be shown if any of the following conditions are met: The `elm` module shows the currently installed version of [Elm](https://elm-lang.org/). By default the module will be shown if any of the following conditions are met:
- 当前目录包含 `elm.json` 文件 - The current directory contains a `elm.json` file
- 当前目录包含 `elm-package.json` 文件 - The current directory contains a `elm-package.json` file
- The current directory contains a `.elm-version` file - The current directory contains a `.elm-version` file
- The current directory contains a `elm-stuff` folder - The current directory contains a `elm-stuff` folder
- The current directory contains a `*.elm` files - The current directory contains a `*.elm` files
@ -964,10 +984,10 @@ format = "via [ $version](cyan bold) "
## Environment Variable ## Environment Variable
The `env_var` module displays the current value of a selected environment variables. 此组件只有满足以下条件之一时才会被显示: The `env_var` module displays the current value of a selected environment variables. The module will be shown only if any of the following conditions are met:
- 设置的 `variable` 是一个已存在的环境变量 - The `variable` configuration option matches an existing environment variable
- 未定义 `variable`,但定义了 `default` - The `variable` configuration option is not defined, but the `default` configuration option is
::: tip Multiple environmental variables can be displayed by using a `.`. (see example) If the `variable` configuration option is not set, the module will display value of variable under the name of text after the `.` character. ::: tip Multiple environmental variables can be displayed by using a `.`. (see example) If the `variable` configuration option is not set, the module will display value of variable under the name of text after the `.` character.
@ -983,13 +1003,13 @@ default = "unknown user"
### 配置项 ### 配置项
| Option | 默认值 | 描述 | | Option | 默认值 | 描述 |
| ---------- | ------------------------------ | ------------------- | | ---------- | ------------------------------ | ---------------------------------------------------------------------------- |
| `symbol` | `""` | 这个字段的内容会显示在环境变量值之前。 | | `symbol` | `""` | The symbol used before displaying the variable value. |
| `variable` | | 要显示的环境变量。 | | `variable` | | The environment variable to be displayed. |
| `default` | | 所选变量未定义时显示的默认值。 | | `default` | | The default value to be displayed when the selected variable is not defined. |
| `format` | `"with [$env_value]($style) "` | 组件格式化模板。 | | `format` | `"with [$env_value]($style) "` | 组件格式化模板。 |
| `disabled` | `false` | 禁用 `env_var` 组件。 | | `disabled` | `false` | Disables the `env_var` module. |
### Variables ### Variables
@ -1026,8 +1046,8 @@ default = "unknown user"
The `erlang` module shows the currently installed version of [Erlang/OTP](https://erlang.org/doc/). By default the module will be shown if any of the following conditions are met: The `erlang` module shows the currently installed version of [Erlang/OTP](https://erlang.org/doc/). By default the module will be shown if any of the following conditions are met:
- 当前目录包含 `rebar.config` 文件. - The current directory contains a `rebar.config` file.
- 当前目录包含 `erlang.mk` 文件. - The current directory contains a `erlang.mk` file.
### 配置项 ### 配置项
@ -1154,20 +1174,20 @@ asia-northeast1 = "an1"
## Git Branch ## Git Branch
`git_branch` 组件显示当前目录的 git 仓库的活动分支。 The `git_branch` module shows the active branch of the repo in your current directory.
### 配置项 ### 配置项
| Option | 默认值 | 描述 | | Option | 默认值 | 描述 |
| -------------------- | -------------------------------- | ------------------------------------------------------------------------------------ | | -------------------- | -------------------------------- | ---------------------------------------------------------------------------------------- |
| `always_show_remote` | `false` | Shows the remote tracking branch name, even if it is equal to the local branch name. | | `always_show_remote` | `false` | Shows the remote tracking branch name, even if it is equal to the local branch name. |
| `format` | `"on [$symbol$branch]($style) "` | 组件格式化模板。 Use `"$branch"` to refer to the current branch name. | | `format` | `"on [$symbol$branch]($style) "` | 组件格式化模板。 Use `"$branch"` to refer to the current branch name. |
| `symbol` | `" "` | A format string representing the symbol of git branch. | | `symbol` | `" "` | A format string representing the symbol of git branch. |
| `style` | `"bold purple"` | 此组件的样式。 | | `style` | `"bold purple"` | 此组件的样式。 |
| `truncation_length` | `2^63 - 1` | Truncates a git branch to `N` graphemes. | | `truncation_length` | `2^63 - 1` | Truncates a git branch to `N` graphemes. |
| `truncation_symbol` | `"…"` | 此字段的内容用来表示分支名称被截断。 You can use `""` for no symbol. | | `truncation_symbol` | `"…"` | The symbol used to indicate a branch name was truncated. You can use `""` for no symbol. |
| `only_attached` | `false` | Only show the branch name when not in a detached `HEAD` state. | | `only_attached` | `false` | Only show the branch name when not in a detached `HEAD` state. |
| `disabled` | `false` | 禁用 `git_branch` 组件。 | | `disabled` | `false` | Disables the `git_branch` module. |
### Variables ### Variables
@ -1200,13 +1220,13 @@ The `git_commit` module shows the current commit hash and also the tag (if any)
| Option | 默认值 | 描述 | | Option | 默认值 | 描述 |
| -------------------- | ---------------------------------- | ------------------------------------------------------- | | -------------------- | ---------------------------------- | ------------------------------------------------------- |
| `commit_hash_length` | `7` | 显示的 git 提交哈希值的长度。 | | `commit_hash_length` | `7` | The length of the displayed git commit hash. |
| `format` | `"[\\($hash$tag\\)]($style) "` | 组件格式化模板。 | | `format` | `"[\\($hash$tag\\)]($style) "` | 组件格式化模板。 |
| `style` | `"bold green"` | 此组件的样式。 | | `style` | `"bold green"` | 此组件的样式。 |
| `only_detached` | `true` | Only show git commit hash when in detached `HEAD` state | | `only_detached` | `true` | Only show git commit hash when in detached `HEAD` state |
| `tag_disabled` | `true` | Disables showing tag info in `git_commit` module. | | `tag_disabled` | `true` | Disables showing tag info in `git_commit` module. |
| `tag_symbol` | `" 🏷 "` | Tag symbol prefixing the info shown | | `tag_symbol` | `" 🏷 "` | Tag symbol prefixing the info shown |
| `disabled` | `false` | 禁用 `git_commit` 组件。 | | `disabled` | `false` | Disables the `git_commit` module. |
### Variables ### Variables
@ -1229,7 +1249,7 @@ tag_symbol = "🔖 "
## Git State ## 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.
### 配置项 ### 配置项
@ -1244,7 +1264,7 @@ tag_symbol = "🔖 "
| `am_or_rebase` | `"AM/REBASE"` | A format string displayed when an ambiguous `apply-mailbox` or `rebase` is in progress. | | `am_or_rebase` | `"AM/REBASE"` | A format string displayed when an ambiguous `apply-mailbox` or `rebase` is in progress. |
| `style` | `"bold yellow"` | 此组件的样式。 | | `style` | `"bold yellow"` | 此组件的样式。 |
| `format` | `'\([$state( $progress_current/$progress_total)]($style)\) '` | 组件格式化模板。 | | `format` | `'\([$state( $progress_current/$progress_total)]($style)\) '` | 组件格式化模板。 |
| `disabled` | `false` | 禁用 `git_state` 模块 | | `disabled` | `false` | Disables the `git_state` module. |
### Variables ### Variables
@ -1273,7 +1293,7 @@ The `git_metrics` module will show the number of added and deleted lines in the
::: tip ::: tip
此组件默认被禁用。 若要启用此组件,请在配置文件中设置 `disable` 字段为 `false` This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
::: :::
@ -1310,14 +1330,14 @@ format = '[+$added]($added_style)/[-$deleted]($deleted_style) '
## Git Status ## Git Status
`git_status`组件通过相应的符号显示您当前目录中 git 仓库的状态。 The `git_status` module shows symbols representing the state of the repo in your current directory.
### 配置项 ### 配置项
| Option | 默认值 | 描述 | | Option | 默认值 | 描述 |
| ------------ | ----------------------------------------------- | ----------------------------------- | | ------------ | ----------------------------------------------- | ----------------------------------- |
| `format` | `'([\[$all_status$ahead_behind\]]($style) )'` | The default format for `git_status` | | `format` | `'([\[$all_status$ahead_behind\]]($style) )'` | The default format for `git_status` |
| `conflicted` | `"="` | 这个分支有合并冲突。 | | `conflicted` | `"="` | This branch has merge conflicts. |
| `ahead` | `"⇡"` | The format of `ahead` | | `ahead` | `"⇡"` | The format of `ahead` |
| `behind` | `"⇣"` | The format of `behind` | | `behind` | `"⇣"` | The format of `behind` |
| `diverged` | `"⇕"` | The format of `diverged` | | `diverged` | `"⇕"` | The format of `diverged` |
@ -1329,7 +1349,7 @@ format = '[+$added]($added_style)/[-$deleted]($deleted_style) '
| `renamed` | `"»"` | The format of `renamed` | | `renamed` | `"»"` | The format of `renamed` |
| `deleted` | `"✘"` | The format of `deleted` | | `deleted` | `"✘"` | The format of `deleted` |
| `style` | `"bold red"` | 此组件的样式。 | | `style` | `"bold red"` | 此组件的样式。 |
| `disabled` | `false` | 禁用 `git_status` 组件。 | | `disabled` | `false` | Disables the `git_status` module. |
### Variables ### Variables
@ -1359,9 +1379,9 @@ The following variables can be used in `diverged`:
The following variables can be used in `conflicted`, `ahead`, `behind`, `untracked`, `stashed`, `modified`, `staged`, `renamed` and `deleted`: The following variables can be used in `conflicted`, `ahead`, `behind`, `untracked`, `stashed`, `modified`, `staged`, `renamed` and `deleted`:
| 字段 | 描述 | | 字段 | 描述 |
| ------- | --------- | | ------- | ------------------------ |
| `count` | 显示相应的文件数量 | | `count` | Show the number of files |
### 示例 ### 示例
@ -1397,14 +1417,14 @@ behind = "⇣${count}"
The `golang` module shows the currently installed version of [Go](https://golang.org/). By default the module will be shown if any of the following conditions are met: The `golang` module shows the currently installed version of [Go](https://golang.org/). By default the module will be shown if any of the following conditions are met:
- 当前目录包含 `go.mod` 文件 - The current directory contains a `go.mod` file
- 当前目录包含 `go.sum` 文件 - The current directory contains a `go.sum` file
- 当前目录包含 `glide.yaml` 文件 - The current directory contains a `glide.yaml` file
- 当前目录包含 `Gopkg.yml` 文件 - The current directory contains a `Gopkg.yml` file
- 当前目录包含 `Gopkg.lock` 文件 - The current directory contains a `Gopkg.lock` file
- The current directory contains a `.go-version` file - The current directory contains a `.go-version` file
- 当前目录包含 `Godeps` 目录 - The current directory contains a `Godeps` directory
- 当前目录包含一个使用 `.go` 扩展名的文件 - The current directory contains a file with the `.go` extension
### 配置项 ### 配置项
@ -1417,7 +1437,7 @@ The `golang` module shows the currently installed version of [Go](https://golang
| `detect_files` | `["go.mod", "go.sum", "glide.yaml", "Gopkg.yml", "Gopkg.lock", ".go-version"]` | Which filenames should trigger this module. | | `detect_files` | `["go.mod", "go.sum", "glide.yaml", "Gopkg.yml", "Gopkg.lock", ".go-version"]` | Which filenames should trigger this module. |
| `detect_folders` | `["Godeps"]` | Which folders should trigger this module. | | `detect_folders` | `["Godeps"]` | Which folders should trigger this module. |
| `style` | `"bold cyan"` | 此组件的样式。 | | `style` | `"bold cyan"` | 此组件的样式。 |
| `disabled` | `false` | 禁用 `golang` 组件。 | | `disabled` | `false` | Disables the `golang` module. |
### Variables ### Variables
@ -1442,7 +1462,7 @@ format = "via [🏎💨 $version](bold cyan) "
The `helm` module shows the currently installed version of [Helm](https://helm.sh/). By default the module will be shown if any of the following conditions are met: The `helm` module shows the currently installed version of [Helm](https://helm.sh/). By default the module will be shown if any of the following conditions are met:
- 当前目录包含 `helmfile.yaml` 文件 - The current directory contains a `helmfile.yaml` file
- The current directory contains a `Chart.yaml` file - The current directory contains a `Chart.yaml` file
### 配置项 ### 配置项
@ -1479,17 +1499,17 @@ format = "via [⎈ $version](bold white) "
## Hostname ## Hostname
`hostname` 组件显示系统主机名。 The `hostname` module shows the system hostname.
### 配置项 ### 配置项
| Option | 默认值 | 描述 | | Option | 默认值 | 描述 |
| ---------- | --------------------------- | ------------------------------------------------------------------ | | ---------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| `ssh_only` | `true` | 仅在连接到 SSH 会话时显示主机名。 | | `ssh_only` | `true` | Only show hostname when connected to an SSH session. |
| `trim_at` | `"."` | 当主机名过长被截断时,会截断成第一次匹配该字符串之前的主机名。 `"."` 会让主机名截断到第一个点处。 `""` 会禁用任何截断。 | | `trim_at` | `"."` | String that the hostname is cut off at, after the first match. `"."` will stop after the first dot. `""` will disable any truncation |
| `format` | `"[$hostname]($style) in "` | 组件格式化模板。 | | `format` | `"[$hostname]($style) in "` | 组件格式化模板。 |
| `style` | `"bold dimmed green"` | 此组件的样式。 | | `style` | `"bold dimmed green"` | 此组件的样式。 |
| `disabled` | `false` | 禁用 `hostname` 组件。 | | `disabled` | `false` | Disables the `hostname` module. |
### Variables ### Variables
@ -1530,7 +1550,7 @@ The `java` module shows the currently installed version of [Java](https://www.or
| `detect_folders` | `[]` | Which folders should trigger this modules. | | `detect_folders` | `[]` | Which folders should trigger this modules. |
| `symbol` | `"☕ "` | A format string representing the symbol of Java | | `symbol` | `"☕ "` | A format string representing the symbol of Java |
| `style` | `"red dimmed"` | 此组件的样式。 | | `style` | `"red dimmed"` | 此组件的样式。 |
| `disabled` | `false` | 禁用 `java` 组件。 | | `disabled` | `false` | Disables the `java` module. |
### Variables ### Variables
@ -1553,7 +1573,7 @@ symbol = "🌟 "
## Jobs ## Jobs
`jobs` 组件显示当前正在运行的任务数量。 仅当有后台任务运行时,此组件才会显示。 The module will show the number of jobs running if there are at least 2 jobs, or more than the `number_threshold` config value, if it exists. The module will show a symbol if there is at least 1 job, or more than the `symbol_threshold` config value, if it exists. You can set both values to 0 in order to *always* show the symbol and number of jobs, even if there are 0 jobs running. 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 are at least 2 jobs, or more than the `number_threshold` config value, if it exists. The module will show a symbol if there is at least 1 job, or more than the `symbol_threshold` config value, if it exists. You can set both values to 0 in order to *always* show the symbol and number of jobs, even if there are 0 jobs running.
The default functionality is: The default functionality is:
@ -1577,13 +1597,13 @@ The `threshold` option is deprecated, but if you want to use it, the module will
| Option | 默认值 | 描述 | | Option | 默认值 | 描述 |
| ------------------ | ----------------------------- | ------------------------------------------------------------------------ | | ------------------ | ----------------------------- | ------------------------------------------------------------------------ |
| `threshold`\* | `1` | 如果超过此字段的值,显示任务数量。 | | `threshold`\* | `1` | Show number of jobs if exceeded. |
| `symbol_threshold` | `1` | Show `symbol` if the job count is at least `symbol_threshold`. | | `symbol_threshold` | `1` | Show `symbol` if the job count is at least `symbol_threshold`. |
| `number_threshold` | `2` | Show the number of jobs if the job count is at least `number_threshold`. | | `number_threshold` | `2` | Show the number of jobs if the job count is at least `number_threshold`. |
| `format` | `"[$symbol$number]($style) "` | 组件格式化模板。 | | `format` | `"[$symbol$number]($style) "` | 组件格式化模板。 |
| `symbol` | `"✦"` | The string used to represent the `symbol` variable. | | `symbol` | `"✦"` | The string used to represent the `symbol` variable. |
| `style` | `"bold blue"` | 此组件的样式。 | | `style` | `"bold blue"` | 此组件的样式。 |
| `disabled` | `false` | 禁用 `jobs` 组件。 | | `disabled` | `false` | Disables the `jobs` module. |
\*: This option is deprecated, please use the \*: This option is deprecated, please use the
`number_threshold` and `symbol_threshold` options instead. `number_threshold` and `symbol_threshold` options instead.
@ -1702,7 +1722,7 @@ Displays the current [Kubernetes context](https://kubernetes.io/docs/concepts/co
::: tip ::: tip
此组件默认被禁用。 若要启用此组件,请在配置文件中设置 `disable` 字段为 `false` This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
::: :::
@ -1764,13 +1784,13 @@ Long and automatically generated cluster names can be identified and shortened u
## Line Break ## Line Break
`line_break` 组件将提示分隔为两行。 The `line_break` module separates the prompt into two lines.
### 配置项 ### 配置项
| Option | 默认值 | 描述 | | Option | 默认值 | 描述 |
| ---------- | ------- | --------------------------- | | ---------- | ------- | ------------------------------------------------------------------ |
| `disabled` | `false` | 禁用 `line_break` 组件,使提示成为单行。 | | `disabled` | `false` | Disables the `line_break` module, making the prompt a single line. |
### 示例 ### 示例
@ -1824,25 +1844,25 @@ format = "via [🌕 $version](bold blue) "
## Memory Usage ## 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 ::: tip
此组件默认被禁用。 若要启用此组件,请在配置文件中设置 `disable` 字段为 `false` This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
::: :::
### 配置项 ### 配置项
| Option | 默认值 | 描述 | | Option | 默认值 | 描述 |
| ----------- | ----------------------------------------------- | ---------------------- | | ----------- | ----------------------------------------------- | -------------------------------------------------------- |
| `threshold` | `75` | 隐藏内存使用情况,除非它超过这个百分比。 | | `threshold` | `75` | Hide the memory usage unless it exceeds this percentage. |
| `format` | `"via $symbol [${ram}( \| ${swap})]($style) "` | 组件格式化模板。 | | `format` | `"via $symbol [${ram}( \| ${swap})]($style) "` | 组件格式化模板。 |
| `symbol` | `"🐏"` | 这个字段的内容会显示在当前内存使用情况之前。 | | `symbol` | `"🐏"` | The symbol used before displaying the memory usage. |
| `style` | `"bold dimmed white"` | 此组件的样式。 | | `style` | `"bold dimmed white"` | 此组件的样式。 |
| `disabled` | `true` | 禁用 `memory_usage` 模块 | | `disabled` | `true` | Disables the `memory_usage` module. |
### Variables ### Variables
@ -1871,18 +1891,18 @@ style = "bold dimmed green"
## Mercurial Branch ## Mercurial Branch
`hg_branch` 组件显示当前目录的 hg 仓库的活动分支。 The `hg_branch` module shows the active branch of the repo in your current directory.
### 配置项 ### 配置项
| Option | 默认值 | 描述 | | Option | 默认值 | 描述 |
| ------------------- | -------------------------------- | --------------------------------------------- | | ------------------- | -------------------------------- | -------------------------------------------------------------------------------------------- |
| `symbol` | `" "` | 该字段的内容显示于当前仓库的 hg 书签或活动分支名之前。 | | `symbol` | `" "` | The symbol used before the hg bookmark or branch name of the repo in your current directory. |
| `style` | `"bold purple"` | 此组件的样式。 | | `style` | `"bold purple"` | 此组件的样式。 |
| `format` | `"on [$symbol$branch]($style) "` | 组件格式化模板。 | | `format` | `"on [$symbol$branch]($style) "` | 组件格式化模板。 |
| `truncation_length` | `2^63 - 1` | Truncates the hg branch name to `N` graphemes | | `truncation_length` | `2^63 - 1` | Truncates the hg branch name to `N` graphemes |
| `truncation_symbol` | `"…"` | 此字段的内容用来表示分支名称被截断。 | | `truncation_symbol` | `"…"` | The symbol used to indicate a branch name was truncated. |
| `disabled` | `true` | 禁用 `hg_branch` 组件。 | | `disabled` | `true` | Disables the `hg_branch` module. |
### Variables ### Variables
@ -1909,7 +1929,7 @@ truncation_symbol = ""
The `nim` module shows the currently installed version of [Nim](https://nim-lang.org/). By default the module will be shown if any of the following conditions are met: The `nim` module shows the currently installed version of [Nim](https://nim-lang.org/). By default the module will be shown if any of the following conditions are met:
- 当前目录包含 `nim.cfg` 文件 - 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 `.nim` extension
- The current directory contains a file with the `.nims` extension - The current directory contains a file with the `.nims` extension
- The current directory contains a file with the `.nimble` extension - The current directory contains a file with the `.nimble` extension
@ -1949,7 +1969,7 @@ symbol = "🎣 "
## Nix-shell ## Nix-shell
The `nix_shell` module shows the [nix-shell](https://nixos.org/guides/nix-pills/developing-with-nix-shell.html) environment. 当处于一个 nix-shell 环境中时,此组件会被显示。 The `nix_shell` module shows the [nix-shell](https://nixos.org/guides/nix-pills/developing-with-nix-shell.html) environment. The module will be shown when inside a nix-shell environment.
### 配置项 ### 配置项
@ -1960,7 +1980,7 @@ The `nix_shell` module shows the [nix-shell](https://nixos.org/guides/nix-pills/
| `style` | `"bold blue"` | 此组件的样式。 | | `style` | `"bold blue"` | 此组件的样式。 |
| `impure_msg` | `"impure"` | A format string shown when the shell is impure. | | `impure_msg` | `"impure"` | A format string shown when the shell is impure. |
| `pure_msg` | `"pure"` | A format string shown when the shell is pure. | | `pure_msg` | `"pure"` | A format string shown when the shell is pure. |
| `disabled` | `false` | 禁用 `nix_shell` 组件。 | | `disabled` | `false` | Disables the `nix_shell` module. |
### Variables ### Variables
@ -1989,10 +2009,10 @@ format = 'via [☃️ $state( \($name\))](bold blue) '
The `nodejs` module shows the currently installed version of [Node.js](https://nodejs.org/). By default the module will be shown if any of the following conditions are met: The `nodejs` module shows the currently installed version of [Node.js](https://nodejs.org/). By default the module will be shown if any of the following conditions are met:
- 当前目录包含 `package.json` 文件 - The current directory contains a `package.json` file
- The current directory contains a `.node-version` file - The current directory contains a `.node-version` file
- The current directory contains a `.nvmrc` file - The current directory contains a `.nvmrc` file
- 当前目录包含 `node_modules` 目录 - The current directory contains a `node_modules` directory
- The current directory contains a file with the `.js`, `.mjs` or `.cjs` extension - The current directory contains a file with the `.js`, `.mjs` or `.cjs` extension
- The current directory contains a file with the `.ts` extension - The current directory contains a file with the `.ts` extension
@ -2007,7 +2027,7 @@ The `nodejs` module shows the currently installed version of [Node.js](https://n
| `detect_files` | `["package.json", ".node-version"]` | Which filenames should trigger this module. | | `detect_files` | `["package.json", ".node-version"]` | Which filenames should trigger this module. |
| `detect_folders` | `["node_modules"]` | Which folders should trigger this module. | | `detect_folders` | `["node_modules"]` | Which folders should trigger this module. |
| `style` | `"bold green"` | 此组件的样式。 | | `style` | `"bold green"` | 此组件的样式。 |
| `disabled` | `false` | 禁用 `nodejs` 组件。 | | `disabled` | `false` | Disables the `nodejs` module. |
| `not_capable_style` | `bold red` | The style for the module when an engines property in package.json does not match the Node.js version. | | `not_capable_style` | `bold red` | The style for the module when an engines property in package.json does not match the Node.js version. |
### Variables ### Variables
@ -2113,7 +2133,7 @@ symbol = "☁️ "
## Package Version ## Package Version
当前目录是软件包的代码仓库时,将显示 `package` 组件,并显示软件包当前版本。 The module currently supports `npm`, `nimble`, `cargo`, `poetry`, `composer`, `gradle`, `julia`, `mix`, `helm` and `shards` 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`, `nimble`, `cargo`, `poetry`, `composer`, `gradle`, `julia`, `mix`, `helm` and `shards` packages.
- [**npm**](https://docs.npmjs.com/cli/commands/npm) The `npm` package version is extracted from the `package.json` present in the current directory - [**npm**](https://docs.npmjs.com/cli/commands/npm) The `npm` package version is extracted from the `package.json` present in the current directory
- [**Cargo**](https://doc.rust-lang.org/cargo/) The `cargo` package version is extracted from the `Cargo.toml` present in the current directory - [**Cargo**](https://doc.rust-lang.org/cargo/) The `cargo` package version is extracted from the `Cargo.toml` present in the current directory
@ -2129,6 +2149,7 @@ symbol = "☁️ "
- [**Meson**](https://mesonbuild.com/) - The `meson` package version is extracted from the `meson.build` present - [**Meson**](https://mesonbuild.com/) - The `meson` package version is extracted from the `meson.build` present
- [**Shards**](https://crystal-lang.org/reference/the_shards_command/index.html) - The `shards` package version is extracted from the `shard.yml` present - [**Shards**](https://crystal-lang.org/reference/the_shards_command/index.html) - The `shards` package version is extracted from the `shard.yml` present
- [**V**](https://vlang.io) - The `vlang` package version is extracted from the `v.mod` present - [**V**](https://vlang.io) - The `vlang` package version is extracted from the `v.mod` present
- [**SBT**](https://scala-sbt.org) - The `sbt` package version is extracted from the `build.sbt` present in the current directory
> ⚠ 此组件显示的是源代码在当前目录中的软件包的版本,而不是包管理器的版本。 > ⚠ 此组件显示的是源代码在当前目录中的软件包的版本,而不是包管理器的版本。
@ -2137,11 +2158,11 @@ symbol = "☁️ "
| Option | 默认值 | 描述 | | Option | 默认值 | 描述 |
| ----------------- | --------------------------------- | ------------------------------------------------------------------------- | | ----------------- | --------------------------------- | ------------------------------------------------------------------------- |
| `format` | `"is [$symbol$version]($style) "` | 组件格式化模板。 | | `format` | `"is [$symbol$version]($style) "` | 组件格式化模板。 |
| `symbol` | `"📦 "` | 这个字段的内容会显示在当前软件包版本之前。 | | `symbol` | `"📦 "` | The symbol used before displaying the version the package. |
| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | | `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` |
| `style` | `"bold 208"` | 此组件的样式。 | | `style` | `"bold 208"` | 此组件的样式。 |
| `display_private` | `false` | Enable displaying version for packages marked as private. | | `display_private` | `false` | Enable displaying version for packages marked as private. |
| `disabled` | `false` | 禁用 `package` 组件。 | | `disabled` | `false` | Disables the `package` module. |
### Variables ### Variables
@ -2206,7 +2227,7 @@ format = "via [🦪 $version]($style) "
The `php` module shows the currently installed version of [PHP](https://www.php.net/). By default the module will be shown if any of the following conditions are met: The `php` module shows the currently installed version of [PHP](https://www.php.net/). By default the module will be shown if any of the following conditions are met:
- 当前目录包含一个 `composer.json` 文件 - The current directory contains a `composer.json` file
- The current directory contains a `.php-version` file - The current directory contains a `.php-version` file
- The current directory contains a `.php` extension - The current directory contains a `.php` extension
@ -2216,12 +2237,12 @@ The `php` module shows the currently installed version of [PHP](https://www.php.
| ------------------- | ------------------------------------ | ------------------------------------------------------------------------- | | ------------------- | ------------------------------------ | ------------------------------------------------------------------------- |
| `format` | `"via [$symbol($version )]($style)"` | 组件格式化模板。 | | `format` | `"via [$symbol($version )]($style)"` | 组件格式化模板。 |
| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | | `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` |
| `symbol` | `"🐘 "` | 这个字段的内容会显示在当前 PHP 版本之前。 | | `symbol` | `"🐘 "` | The symbol used before displaying the version of PHP. |
| `detect_extensions` | `["php"]` | Which extensions should trigger this module. | | `detect_extensions` | `["php"]` | Which extensions should trigger this module. |
| `detect_files` | `["composer.json", ".php-version"]` | Which filenames should trigger this module. | | `detect_files` | `["composer.json", ".php-version"]` | Which filenames should trigger this module. |
| `detect_folders` | `[]` | Which folders should trigger this module. | | `detect_folders` | `[]` | Which folders should trigger this module. |
| `style` | `"147 bold"` | 此组件的样式。 | | `style` | `"147 bold"` | 此组件的样式。 |
| `disabled` | `false` | 禁用 `php` 组件。 | | `disabled` | `false` | Disables the `php` module. |
### Variables ### Variables
@ -2636,7 +2657,7 @@ The `shell` module shows an indicator for currently used shell.
::: tip ::: tip
此组件默认被禁用。 若要启用此组件,请在配置文件中设置 `disable` 字段为 `false` This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
::: :::
@ -2753,7 +2774,7 @@ The `status` module displays the exit code of the previous command. The module w
::: tip ::: tip
此组件默认被禁用。 若要启用此组件,请在配置文件中设置 `disable` 字段为 `false` This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
::: :::
@ -2809,6 +2830,56 @@ disabled = false
``` ```
## Sudo
The `sudo` module displays if sudo credentials are currently cached. The module will only be shown if credentials are cached.
::: tip
This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
:::
### 配置项
| Option | 默认值 | 描述 |
| --------------- | ----------------------- | ------------------------------------------------------- |
| `format` | `[as $symbol]($style)"` | The format of the module |
| `symbol` | `"🧙 "` | The symbol displayed when credentials are cached |
| `style` | `"bold blue"` | 此组件的样式。 |
| `allow_windows` | `false` | Since windows has no default sudo, default is disabled. |
| `disabled` | `true` | Disables the `sudo` module. |
### Variables
| 字段 | 示例 | 描述 |
| --------- | -- | ----------- |
| symbol | | `symbol`对应值 |
| style\* | | `style`对应值 |
\*: This variable can only be used as a part of a style string
### 示例
```toml
# ~/.config/starship.toml
[sudo]
style = "bold green"
symbol = "👩‍💻 "
disabled = false
```
```toml
# On windows
# $HOME\.starship\config.toml
[sudo]
allow_windows = true
disabled = false
```
## Swift ## Swift
By default the `swift` module shows the currently installed version of [Swift](https://swift.org/). The module will be shown if any of the following conditions are met: By default the `swift` module shows the currently installed version of [Swift](https://swift.org/). The module will be shown if any of the following conditions are met:
@ -2913,7 +2984,7 @@ The `time` module shows the current **local** time. The `format` configuration v
::: tip ::: tip
此组件默认被禁用。 若要启用此组件,请在配置文件中设置 `disable` 字段为 `false` This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
::: :::

View File

@ -88,7 +88,7 @@ starship bug-report
## Why don't I see a glyph symbol in my prompt? ## Why don't I see a glyph symbol in my prompt?
The most common cause of this is system misconfiguration. Some Linux distros in particular do not come with font support out-of-the-box. You need to ensure that: 最常见的原因是系统配置有问题。 有个别Linux发行版不自带对字体的支持。 请确保:
- Your locale is set to a UTF-8 value, like `de_DE.UTF-8` or `ja_JP.UTF-8`. If `LC_ALL` is not a UTF-8 value, [you will need to change it](https://www.tecmint.com/set-system-locales-in-linux/). - Your locale is set to a UTF-8 value, like `de_DE.UTF-8` or `ja_JP.UTF-8`. If `LC_ALL` is not a UTF-8 value, [you will need to change it](https://www.tecmint.com/set-system-locales-in-linux/).
- 安装了 emoji 字体。 大部分系统都会自带 emoji 字体,但有些系统(例如 Arch Linux则没有。 字体一般可以用系统的包管理器安装,常见的字体有 [Noto emoji](https://www.google.com/get/noto/help/emoji/) 等。 - 安装了 emoji 字体。 大部分系统都会自带 emoji 字体,但有些系统(例如 Arch Linux则没有。 字体一般可以用系统的包管理器安装,常见的字体有 [Noto emoji](https://www.google.com/get/noto/help/emoji/) 等。
@ -101,20 +101,20 @@ echo -e "\xf0\x9f\x90\x8d"
echo -e "\xee\x82\xa0" echo -e "\xee\x82\xa0"
``` ```
The first line should produce a [snake emoji](https://emojipedia.org/snake/), while the second should produce a [powerline branch symbol (e0a0)](https://github.com/ryanoasis/powerline-extra-symbols#glyphs). 第一行应该显示出一个[蛇的 emoji](https://emojipedia.org/snake/),第二行应该显示出 [powerline 的分支符号e0a0](https://github.com/ryanoasis/powerline-extra-symbols#glyphs).
If either symbol fails to display correctly, your system is still misconfigured. Unfortunately, getting font configuration correct is sometimes difficult. Users on the Discord may be able to help. If both symbols display correctly, but you still don't see them in starship, [file a bug report!](https://github.com/starship/starship/issues/new/choose) If either symbol fails to display correctly, your system is still misconfigured. Unfortunately, getting font configuration correct is sometimes difficult. Users on the Discord may be able to help. If both symbols display correctly, but you still don't see them in starship, [file a bug report!](https://github.com/starship/starship/issues/new/choose)
## How do I uninstall Starship? ## 如何卸载 Starship
Starship is just as easy to uninstall as it is to install in the first place. Starship 的卸载过程与安装过程一样简单。
1. 将 shell 的配置文件(比如 `~/.bashrc`)中初始化 Starship 的部分全部删除。 1. 将 shell 的配置文件(比如 `~/.bashrc`)中初始化 Starship 的部分全部删除。
1. 删除 Starship 的二进制文件。 1. 删除 Starship 的二进制文件。
If Starship was installed using a package manager, please refer to their docs for uninstallation instructions. 如果 Starship 是用包管理器安装的,请到包管理器的文档中查找卸载的步骤。
If Starship was installed using the install script, the following command will delete the binary: 如果 Starship 是用安装脚本安装的,可以用以下命令删除二进制文件:
```sh ```sh
# Locate and delete the starship binary # Locate and delete the starship binary

View File

@ -298,7 +298,7 @@
## 🤝 贡献 ## 🤝 贡献
我们一直在寻找贡献者!你都可以参与贡献 ** 不论你的技能如何 **。 如果您希望快速为项目作出贡献,请尝试解决 [good first issue](https://github.com/starship/starship/labels/🌱%20good%20first%20issue)。 我们一直在寻找贡献者!**不论你的技能如何**你都可以参与贡献 。 如果您希望快速为项目作出贡献,请尝试解决 [good first issue](https://github.com/starship/starship/labels/🌱%20good%20first%20issue)。
If you are fluent in a non-English language, we greatly appreciate any help keeping our docs translated and up-to-date in other languages. If you would like to help, translations can be contributed on the [Starship Crowdin](https://translate.starship.rs/). If you are fluent in a non-English language, we greatly appreciate any help keeping our docs translated and up-to-date in other languages. If you would like to help, translations can be contributed on the [Starship Crowdin](https://translate.starship.rs/).
@ -306,7 +306,7 @@ If you are fluent in a non-English language, we greatly appreciate any help keep
## 💭该项目受以下项目启发 ## 💭该项目受以下项目启发
Please check out these previous works that helped inspire the creation of starship. 🙏 请参考这些曾经为 Starship 提供启发的工程。 🙏
- **[denysdovhan/spaceship-prompt](https://github.com/denysdovhan/spaceship-prompt)** - A ZSH prompt for astronauts. - **[denysdovhan/spaceship-prompt](https://github.com/denysdovhan/spaceship-prompt)** - A ZSH prompt for astronauts.

View File

@ -223,6 +223,9 @@ format = '\[[$symbol($version)]($style)\]'
[scala] [scala]
format = '\[[$symbol($version)]($style)\]' format = '\[[$symbol($version)]($style)\]'
[sudo]
format = '\[[as $symbol]\]
[swift] [swift]
format = '\[[$symbol($version)]($style)\]' format = '\[[$symbol($version)]($style)\]'
@ -371,6 +374,9 @@ symbol = "rs "
[scala] [scala]
symbol = "scala " symbol = "scala "
[sudo]
symbol = "sudo "
[swift] [swift]
symbol = "swift " symbol = "swift "
``` ```

View File

@ -43,33 +43,33 @@ function Invoke-Starship-PreCommand {
} }
``` ```
## Change Window Title ## 改變視窗標題
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`. Some shell prompts will automatically change the window title for you (e.g. to reflect your working directory). Fish 甚至預設就會這樣做。 Starship 沒有幫你這樣做,但是可以用直覺的方式加入這個功能到 `bash``zsh` 之中。
First, define a window title change function (identical in bash and zsh): 首先,定義一個改變視窗標題的函式(在 bash 與 zsh 之中都一樣):
```bash ```bash
function set_win_title(){ function set_win_title(){
echo -ne "\033]0; YOUR_WINDOW_TITLE_HERE \007" echo -ne "\033]0; 你的標題在此 \007"
} }
``` ```
You can use variables to customize this title (`$USER`, `$HOSTNAME`, and `$PWD` are popular choices). 你可以利用變數來自定義這個標題(`$USER`、`$HOSTNAME` 與 `$PWD` 是很受歡迎的選項)。
In `bash`, set this function to be the precmd starship function: `bash` 中,將這個函式設定為 Starship 的預執行函式:
```bash ```bash
starship_precmd_user_func="set_win_title" starship_precmd_user_func="set_win_title"
``` ```
In `zsh`, add this to the `precmd_functions` array: `zsh` 中,將這個函式加入 `precmd_functions` 陣列:
```bash ```bash
precmd_functions+=(set_win_title) precmd_functions+=(set_win_title)
``` ```
If you like the result, add these lines to your shell configuration file (`~/.bashrc` or `~/.zshrc`) to make it permanent. 如果你喜歡這個結果,把這幾行加入你的 shell 設定檔中(`~/.bashrc` or `~/.zsrhc`)來將此設為永久設定。
For example, if you want to display your current directory in your terminal tab title, add the following snippet to your `~/.bashrc` or `~/.zshrc`: For example, if you want to display your current directory in your terminal tab title, add the following snippet to your `~/.bashrc` or `~/.zshrc`:
@ -120,7 +120,7 @@ Produces a prompt like 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). Each word can be one of the following: 風格字串是一個以空白分開的單詞清單。 單字並不會區分大小寫(換句話說,`bold` 與 `BoLd` 是被當作兩個相同的字串)。 每個單詞可以是下列其中之一:
- `bold` - `bold`
- `斜體字` - `斜體字`
@ -132,14 +132,14 @@ Style strings are a list of words, separated by whitespace. The words are not ca
- `<color>` - `<color>`
- `none` - `none`
where `<color>` is a color specifier (discussed below). `fg:<color>` and `<color>` currently do the same thing, though this may change in the future. `inverted` swaps the background and foreground colors. The order of words in the string does not matter. 其中 `<color>` 是指定顏色用的(下面解釋)。 `fg:<color>` and `<color>` currently do the same thing, though this may change in the future. `inverted` swaps the background and foreground colors. 單詞在字串中的順序不重要。
The `none` token overrides all other tokens in a string if it is not part of a `bg:` specifier, so that e.g. `fg:red none fg:blue` will still create a string with no styling. `bg:none` sets the background to the default color so `fg:red bg:none` is equivalent to `red` or `fg:red` and `bg:green fg:red bg:none` is also equivalent to `fg:red` or `red`. It may become an error to use `none` in conjunction with other tokens in the future. The `none` token overrides all other tokens in a string if it is not part of a `bg:` specifier, so that e.g. `fg:red none fg:blue` will still create a string with no styling. `bg:none` sets the background to the default color so `fg:red bg:none` is equivalent to `red` or `fg:red` and `bg:green fg:red bg:none` is also equivalent to `fg:red` or `red`. 未來可能會將 `none` 與其他符號一起使用的情形視為是一種錯誤。
A color specifier can be one of the following: 一個顏色指定符號可以是下列其中之一:
- 任一個標準終端機顏色:`black`、`red`、`green`、`blue`、`yellow`、`purple`、`cyan`、`white`。 你可以選擇性地加上前綴 `bright-` 來取得明亮版本的顏色(例如:`bright-white`)。 - 任一個標準終端機顏色:`black`、`red`、`green`、`blue`、`yellow`、`purple`、`cyan`、`white`。 你可以選擇性地加上前綴 `bright-` 來取得明亮版本的顏色(例如:`bright-white`)。
- 一個 `#` 後面跟隨著六位數的十六進位數字。 這個指定了 [RGB 十六進制色碼](https://www.w3schools.com/colors/colors_hexadecimal.asp)。 - 一個 `#` 後面跟隨著六位數的十六進位數字。 這個指定了 [RGB 十六進制色碼](https://www.w3schools.com/colors/colors_hexadecimal.asp)。
- 一個介於 0~255 之間的數字。 這個指定了 [8-bit ANSI 色碼](https://i.stack.imgur.com/KTSQa.png)。 - 一個介於 0~255 之間的數字。 這個指定了 [8-bit ANSI 色碼](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

@ -61,7 +61,7 @@ Format strings are the format that a module prints all its variables with. Most
#### 變數 #### 變數
A variable contains a `$` symbol followed by the name of the variable. The name of a variable only contains letters, numbers and `_`. A variable contains a `$` symbol followed by the name of the variable. The name of a variable can only contain letters, numbers and `_`.
For example: For example:
@ -106,18 +106,11 @@ For example:
- `(some text)` will always show nothing since there are no variables wrapped in the braces. - `(some text)` will always show nothing since there are no variables wrapped in the braces.
- When `$all` is a shortcut for `\[$a$b\]`, `($all)` will show nothing only if `$a` and `$b` are both `None`. This works the same as `(\[$a$b\] )`. - When `$all` is a shortcut for `\[$a$b\]`, `($all)` will show nothing only if `$a` and `$b` are both `None`. This works the same as `(\[$a$b\] )`.
#### Escapable characters #### Special characters
The following symbols have special usage in a format string. If you want to print the following symbols, you have to escape them with a backslash (`\`). The following symbols have special usage in a format string and must be escaped: `$ \ [ ] ( )`.
- \$ Note that TOML has [both basic strings and literal strings](https://toml.io/en/v1.0.0#string). It is recommended to use a literal string (surrounded by single quotes) in your config. If you want to use a basic string (surrounded by double quotes), you must escape the backslash itself (i.e. use `\\`).
- \\
- [
- ]
- (
- )
Note that `toml` has [its own escape syntax](https://github.com/toml-lang/toml#user-content-string). It is recommended to use a literal string (`''`) in your config. If you want to use a basic string (`""`), pay attention to escape the backslash `\`.
For example, when you want to print a `$` symbol on a new line, the following configs for `format` are equivalent: For example, when you want to print a `$` symbol on a new line, the following configs for `format` are equivalent:
@ -231,9 +224,11 @@ $memory_usage\
$aws\ $aws\
$gcloud\ $gcloud\
$openstack\ $openstack\
$azure\
$env_var\ $env_var\
$crystal\ $crystal\
$custom\ $custom\
$sudo\
$cmd_duration\ $cmd_duration\
$line_break\ $line_break\
$jobs\ $jobs\
@ -325,22 +320,47 @@ style = "bold blue"
symbol = "🅰 " symbol = "🅰 "
``` ```
## 電池 ## Azure
`battery` 模組顯示電池的電量以及現在的充電狀態。 這個模組只會在裝置的電量低於 10% 的時候看見。 The `azure` module shows the current Azure Subscription. This is based on showing the name of the default subscription, as defined in the `~/.azure/azureProfile.json` file.
### 選項 ### 選項
| Option | 預設 | 說明 | | 變數 | 預設 | 說明 |
| -------------------- | --------------------------------- | -------------------------- | | ---------- | ---------------------------------------- | ------------------------------------------ |
| `full_symbol` | `" "` | 當電池充飽時顯示的符號。 | | `format` | `"on [$symbol($subscription)]($style) "` | The format for the Azure module to render. |
| `charging_symbol` | `" "` | 當電池正在充電時顯示的符號。 | | `symbol` | `"ﴃ "` | The symbol used in the format. |
| `discharging_symbol` | `" "` | 當電池正在放電時顯示的符號。 | | `style` | `"blue bold"` | The style used in the format. |
| `unknown_symbol` | `" "` | 當電池狀態不明時顯示的符號。 | | `disabled` | `true` | Disables the `azure` module. |
| `empty_symbol` | `" "` | 當電池沒電時顯示的符號。 |
| `format` | `"[$symbol$percentage]($style) "` | The format for the module. | ### 範例
| `display` | [連結](#battery-display) | 顯示的門檻與模組的風格。 |
| `disabled` | `false` | 停用 `battery` 模組。 | ```toml
# ~/.config/starship.toml
[azure]
disabled = false
format = "on [$symbol($subscription)]($style) "
symbol = "ﴃ "
style = "blue bold"
```
## Battery
The `battery` module shows how charged the device's battery is and its current charging status. The module is only visible when the device's battery is below 10%.
### 選項
| Option | 預設 | 說明 |
| -------------------- | --------------------------------- | --------------------------------------------------- |
| `full_symbol` | `" "` | The symbol shown when the battery is full. |
| `charging_symbol` | `" "` | The symbol shown when the battery is charging. |
| `discharging_symbol` | `" "` | The symbol shown when the battery is discharging. |
| `unknown_symbol` | `" "` | The symbol shown when the battery state is unknown. |
| `empty_symbol` | `" "` | The symbol shown when the battery state is empty. |
| `format` | `"[$symbol$percentage]($style) "` | The format for the module. |
| `display` | [連結](#battery-display) | Display threshold and style for the module. |
| `disabled` | `false` | Disables the `battery` module. |
### 範例 ### 範例
@ -353,9 +373,9 @@ charging_symbol = "⚡️ "
discharging_symbol = "💀 " discharging_symbol = "💀 "
``` ```
### 電池顯示 ### Battery Display
The `display` configuration option is used to define when the battery indicator should be shown (threshold), which symbol would be used (symbol), and what it would like (style). 如果沒有提供 `display` 預設如下: The `display` configuration option is used to define when the battery indicator should be shown (threshold), which symbol would be used (symbol), and what it would like (style). If no `display` is provided. 預設如下:
```toml ```toml
[[battery.display]] [[battery.display]]
@ -367,12 +387,12 @@ The default value for the `charging_symbol` and `discharging_symbol` option is r
#### 選項 #### 選項
`display` 選項是一個下列表格的陣列。 The `display` option is an array of the following table.
| Option | 預設 | 說明 | | Option | 預設 | 說明 |
| -------------------- | ---------- | --------------------------------------------------------------------------------------------------------- | | -------------------- | ---------- | --------------------------------------------------------------------------------------------------------- |
| `threshold` | `10` | 顯示選項的上界。 | | `threshold` | `10` | The upper bound for the display option. |
| `style` | `bold red` | 顯示選項使用時的風格。 | | `style` | `bold red` | The style used if the display option is in use. |
| `charging_symbol` | `-` | Optional symbol displayed if display option is in use, defaults to battery's `charging_symbol` option. | | `charging_symbol` | `-` | Optional symbol displayed if display option is in use, defaults to battery's `charging_symbol` option. |
| `discharging_symbol` | `-` | Optional symbol displayed if display option is in use, defaults to battery's `discharging_symbol` option. | | `discharging_symbol` | `-` | Optional symbol displayed if display option is in use, defaults to battery's `discharging_symbol` option. |
@ -394,9 +414,9 @@ discharging_symbol = "💦"
## 字元 ## 字元
`character` 模組在你的文字輸入處旁顯示一個字元 (通常是箭頭)。 The `character` module shows a character (usually an arrow) beside where the text is entered in your terminal.
這個字元會告訴你最後的指令是成功還是失敗。 It can do this in two ways: The character will tell you whether the last command was successful or not. It can do this in two ways:
- changing color (`red`/`green`) - changing color (`red`/`green`)
- changing shape (``/`✖`) - changing shape (``/`✖`)
@ -423,7 +443,7 @@ By default it only changes color. If you also want to change its shape take a lo
| `success_symbol` | `"[](bold green)"` | The format string used before the text input if the previous command succeeded. | | `success_symbol` | `"[](bold green)"` | The format string used before the text input if the previous command succeeded. |
| `error_symbol` | `"[](bold red)"` | The format string used before the text input if the previous command failed. | | `error_symbol` | `"[](bold red)"` | The format string used before the text input if the previous command failed. |
| `vicmd_symbol` | `"[](bold green)"` | The format string used before the text input if the shell is in vim normal mode. | | `vicmd_symbol` | `"[](bold green)"` | The format string used before the text input if the shell is in vim normal mode. |
| `disabled` | `false` | 停用 `character` 模組。 | | `disabled` | `false` | Disables the `character` module. |
### Variables ### Variables
@ -524,27 +544,27 @@ The `cobol` module shows the currently installed version of COBOL. By default, t
## 指令持續時間 ## 指令持續時間
`cmd_duration` 模組顯示最後一個指令執行所花費的時間。 這個模組只會在指令花費超過兩秒或是有設定 `min_time` 時,超過設定值時出現。 The `cmd_duration` module shows how long the last command took to execute. The module will be shown only if the command took longer than two seconds, or the `min_time` config value, if it exists.
::: warning 不要在 Bash 中設置 DEBUG trap ::: warning Do not hook the DEBUG trap in Bash
如果你在 `bash` 中使用 Starship不要在執行 `eval $(starship init $0)` 之後設置 `DEBUG` trap不然這個模組**會**壞掉。 If you are running Starship in `bash`, do not hook the `DEBUG` trap after running `eval $(starship init $0)`, or this module **will** break.
::: :::
想使用類似 preexec 功能的 Bash 使用者可以 [rcaloras 的 bash_preexec 框架](https://github.com/rcaloras/bash-preexec)。 只要在 `eval $(starship init $0)` 之前簡單地定義 `preexec_functions``precmd_functions` 兩個陣列,然後就可以照常進行。 Bash users who need preexec-like functionality can use [rcaloras's bash_preexec framework](https://github.com/rcaloras/bash-preexec). Simply define the arrays `preexec_functions` and `precmd_functions` before running `eval $(starship init $0)`, and then proceed as normal.
### 選項 ### 選項
| Option | 預設 | 說明 | | Option | 預設 | 說明 |
| -------------------- | ----------------------------- | ----------------------------------------------------- | | -------------------- | ----------------------------- | ---------------------------------------------------------- |
| `min_time` | `2_000` | Shortest duration to show time for (in milliseconds). | | `min_time` | `2_000` | Shortest duration to show time for (in milliseconds). |
| `show_milliseconds` | `false` | 顯示時間除了以秒為單位外,亦以毫秒顯示 | | `show_milliseconds` | `false` | Show milliseconds in addition to seconds for the duration. |
| `format` | `"took [$duration]($style) "` | The format for the module. | | `format` | `"took [$duration]($style) "` | The format for the module. |
| `style` | `"bold yellow"` | 這個模組的風格。 | | `style` | `"bold yellow"` | 這個模組的風格。 |
| `disabled` | `false` | 停用 `cmd_duration` 模組。 | | `disabled` | `false` | Disables the `cmd_duration` module. |
| `show_notifications` | `false` | Show desktop notifications when command completes. | | `show_notifications` | `false` | Show desktop notifications when command completes. |
| `min_time_to_notify` | `45_000` | Shortest duration for notification (in milliseconds). | | `min_time_to_notify` | `45_000` | Shortest duration for notification (in milliseconds). |
::: tip ::: tip
@ -583,14 +603,14 @@ This does not suppress conda's own prompt modifier, you may want to run `conda c
### 選項 ### 選項
| Option | 預設 | 說明 | | Option | 預設 | 說明 |
| ------------------- | -------------------------------------- | ----------------------------------------------------------------------------------------------- | | ------------------- | -------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `truncation_length` | `1` | 如果環境變數由所`conda create -p [path]`產生時,環境變數的資料夾需要截斷的數目。 `0` 表示不截斷 也請參考 [`directory`](#directory)模組 | | `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` | `"🅒 "` | 環境名稱前使用的符號。 | | `symbol` | `"🅒 "` | The symbol used before the environment name. |
| `style` | `"bold green"` | 這個模組的風格。 | | `style` | `"bold green"` | 這個模組的風格。 |
| `format` | `"via [$symbol$environment]($style) "` | The format for the module. | | `format` | `"via [$symbol$environment]($style) "` | The format for the module. |
| `ignore_base` | `true` | Ignores `base` environment when activated. | | `ignore_base` | `true` | Ignores `base` environment when activated. |
| `disabled` | `false` | 停用 `conda` 模組。 | | `disabled` | `false` | Disables the `conda` module. |
### Variables ### Variables
@ -615,8 +635,8 @@ format = "[$symbol$environment](dimmed green) "
The `crystal` module shows the currently installed version of [Crystal](https://crystal-lang.org/). By default the module will be shown if any of the following conditions are met: The `crystal` module shows the currently installed version of [Crystal](https://crystal-lang.org/). By default the module will be shown if any of the following conditions are met:
- 現在資料夾中含有一個 `shard.yml` 檔案 - The current directory contains a `shard.yml` file
- 現在資料夾中含有一個`.cr`檔案 - The current directory contains a `.cr` file
### 選項 ### 選項
@ -656,7 +676,7 @@ The `dart` module shows the currently installed version of [Dart](https://dart.d
- The current directory contains a file with `.dart` extension - The current directory contains a file with `.dart` extension
- The current directory contains a `.dart_tool` directory - The current directory contains a `.dart_tool` directory
- 現在資料夾中包含一個 `pubspec.yaml`、`pubspec.yml` 或 `pubspec.lock` 檔案 - The current directory contains a `pubspec.yaml`, `pubspec.yml` or `pubspec.lock` file
### 選項 ### 選項
@ -727,21 +747,21 @@ format = "via [🦕 $version](green bold) "
## 資料夾 ## 資料夾
`directory` 模組顯示到現在資料夾的路徑,並裁減到前三層資料夾。 你的資料夾也會被裁減到你所在的 git 儲存庫的根目錄。 The `directory` module shows the path to your current directory, truncated to three parent folders. Your directory will also be truncated to the root of the git repo that you're currently in.
如果正在使用 fish 風格的 pwd 選項,將不會隱藏被裁減的資料夾,而是會根據你在選項中設定的數字看到每一層資料夾的縮寫。 When using the fish style pwd option, instead of hiding the path that is truncated, you will see a shortened name of each directory based on the number you enable for the option.
例如,給定一個右列的路徑 `~/Dev/Nix/nixpkgs/pkgs` 其中 `nixpkgs` 是儲存庫的根目錄,而且該選項被設定為 `1`。 你會看到 `~/D/N/nixpkgs/pkgs`,而在這個設定之前則是 `nixpkgs/pkgs` For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, and the option set to `1`. You will now see `~/D/N/nixpkgs/pkgs`, whereas before it would have been `nixpkgs/pkgs`.
### 選項 ### 選項
| Option | 預設 | 說明 | | Option | 預設 | 說明 |
| ------------------- | -------------------------------------------------- | -------------------------------------------------------------------------------------- | | ------------------- | -------------------------------------------------- | -------------------------------------------------------------------------------------- |
| `truncation_length` | `3` | 到達現在資料夾的路徑中,要被裁減掉的資料夾數目。 | | `truncation_length` | `3` | The number of parent folders that the current directory should be truncated to. |
| `truncate_to_repo` | `true` | 是否要裁減到你現在所在的 git 儲存庫的根目錄。 | | `truncate_to_repo` | `true` | Whether or not to truncate to the root of the git repo that you're currently in. |
| `format` | `"[$path]($style)[$read_only]($read_only_style) "` | The format for the module. | | `format` | `"[$path]($style)[$read_only]($read_only_style) "` | The format for the module. |
| `style` | `"bold cyan"` | 這個模組的風格。 | | `style` | `"bold cyan"` | 這個模組的風格。 |
| `disabled` | `false` | 停用 `directory` 模組。 | | `disabled` | `false` | Disables the `directory` module. |
| `read_only` | `"🔒"` | The symbol indicating current directory is read only. | | `read_only` | `"🔒"` | The symbol indicating current directory is read only. |
| `read_only_style` | `"red"` | The style for the read only symbol. | | `read_only_style` | `"red"` | The style for the read only symbol. |
| `truncation_symbol` | `""` | The symbol to prefix to truncated paths. eg: "…/" | | `truncation_symbol` | `""` | The symbol to prefix to truncated paths. eg: "…/" |
@ -749,12 +769,12 @@ format = "via [🦕 $version](green bold) "
| `home_symbol` | `"~"` | The symbol indicating home directory. | | `home_symbol` | `"~"` | The symbol indicating home directory. |
<details> <details>
<summary>這個模組有些進階設定選項可以控制顯示資料夾。</summary> <summary>This module has a few advanced configuration options that control how the directory is displayed.</summary>
| Advanced Option | 預設 | 說明 | | Advanced Option | 預設 | 說明 |
| --------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | --------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `substitutions` | | A table of substitutions to be made to the path. | | `substitutions` | | A table of substitutions to be made to the path. |
| `fish_style_pwd_dir_length` | `0` | 當使用 fish shell 的 pwd 路徑邏輯時使用的字元數量。 | | `fish_style_pwd_dir_length` | `0` | The number of characters to use when applying fish shell pwd path logic. |
| `use_logical_path` | `true` | If `true` render the logical path sourced from the shell via `PWD` or `--logical-path`. If `false` instead render the physical filesystem path with symlinks resolved. | | `use_logical_path` | `true` | If `true` render the logical path sourced from the shell via `PWD` or `--logical-path`. If `false` instead render the physical filesystem path with symlinks resolved. |
`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. `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.
@ -826,7 +846,7 @@ format = "via [🐋 $context](blue bold)"
## Dotnet ## Dotnet
The `dotnet` module shows the relevant version of the [.NET Core SDK](https://dotnet.microsoft.com/) for the current directory. 如果這個資料夾已經選定一個 SDK則顯示這個 SDK 的版本。 如果沒有的話,則顯示最新安裝的 SDK 版本。 The `dotnet` module shows the relevant version of the [.NET Core SDK](https://dotnet.microsoft.com/) 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.
By default this module will only be shown in your prompt when one or more of the following files are present in the current directory: By default this module will only be shown in your prompt when one or more of the following files are present in the current directory:
@ -841,7 +861,7 @@ By default this module will only be shown in your prompt when one or more of the
You'll also need the .NET Core SDK installed in order to use it correctly. You'll also need the .NET Core SDK 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.
The module will also show the Target Framework Moniker (<https://docs.microsoft.com/en-us/dotnet/standard/frameworks#supported-target-framework-versions>) when there is a csproj file in the current directory. The module will also show the Target Framework Moniker (<https://docs.microsoft.com/en-us/dotnet/standard/frameworks#supported-target-framework-versions>) when there is a csproj file in the current directory.
@ -851,13 +871,13 @@ The module will also show the Target Framework Moniker (<https://docs.microsoft.
| ------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- | | ------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| `format` | `"via [$symbol($version )(🎯 $tfm )]($style)"` | The format for the module. | | `format` | `"via [$symbol($version )(🎯 $tfm )]($style)"` | The format for the module. |
| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | | `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` |
| `symbol` | `".NET "` | 在顯示 dotnet 版本之前用的符號。 | | `symbol` | `".NET "` | The symbol used before displaying the version of dotnet. |
| `heuristic` | `true` | 使用更快速的版本偵測法來保持 starship 的速度。 | | `heuristic` | `true` | Use faster version detection to keep starship snappy. |
| `detect_extensions` | `["csproj", "fsproj", "xproj"]` | Which extensions should trigger this module. | | `detect_extensions` | `["csproj", "fsproj", "xproj"]` | Which extensions should trigger this module. |
| `detect_files` | `["global.json", "project.json", "Directory.Build.props", "Directory.Build.targets", "Packages.props"]` | Which filenames should trigger this module. | | `detect_files` | `["global.json", "project.json", "Directory.Build.props", "Directory.Build.targets", "Packages.props"]` | Which filenames should trigger this module. |
| `detect_folders` | `[]` | Which folders should trigger this modules. | | `detect_folders` | `[]` | Which folders should trigger this modules. |
| `style` | `"bold blue"` | 這個模組的風格。 | | `style` | `"bold blue"` | 這個模組的風格。 |
| `disabled` | `false` | 停用 `dotnet` 模組。 | | `disabled` | `false` | Disables the `dotnet` module. |
### Variables ### Variables
@ -885,7 +905,7 @@ heuristic = false
The `elixir` module shows the currently installed version of [Elixir](https://elixir-lang.org/) and [Erlang/OTP](https://erlang.org/doc/). By default the module will be shown if any of the following conditions are met: The `elixir` module shows the currently installed version of [Elixir](https://elixir-lang.org/) and [Erlang/OTP](https://erlang.org/doc/). By default the module will be shown if any of the following conditions are met:
- 現在資料夾中含有一個 `mix.exs` 檔案. - The current directory contains a `mix.exs` file.
### 選項 ### 選項
@ -924,8 +944,8 @@ symbol = "🔮 "
The `elm` module shows the currently installed version of [Elm](https://elm-lang.org/). By default the module will be shown if any of the following conditions are met: The `elm` module shows the currently installed version of [Elm](https://elm-lang.org/). By default the module will be shown if any of the following conditions are met:
- 現在資料夾中含有一個 `elm.json` 檔案 - The current directory contains a `elm.json` file
- 現在資料夾中包含一個 `elm-package.json` 檔案 - The current directory contains a `elm-package.json` file
- The current directory contains a `.elm-version` file - The current directory contains a `.elm-version` file
- The current directory contains a `elm-stuff` folder - The current directory contains a `elm-stuff` folder
- The current directory contains a `*.elm` files - The current directory contains a `*.elm` files
@ -964,10 +984,10 @@ format = "via [ $version](cyan bold) "
## 環境變數 ## 環境變數
The `env_var` module displays the current value of a selected environment variables. 這個模組只在下列條件其中之一達到時顯示: The `env_var` module displays the current value of a selected environment variables. The module will be shown only if any of the following conditions are met:
- `variable` 設定選項符合一個存在的環境變數。 - The `variable` configuration option matches an existing environment variable
- 沒有設定 `variable` 選項,但是有設定 `default` 選項。 - The `variable` configuration option is not defined, but the `default` configuration option is
::: tip Multiple environmental variables can be displayed by using a `.`. (see example) If the `variable` configuration option is not set, the module will display value of variable under the name of text after the `.` character. ::: tip Multiple environmental variables can be displayed by using a `.`. (see example) If the `variable` configuration option is not set, the module will display value of variable under the name of text after the `.` character.
@ -983,13 +1003,13 @@ default = "unknown user"
### 選項 ### 選項
| Option | 預設 | 說明 | | Option | 預設 | 說明 |
| ---------- | ------------------------------ | -------------------------- | | ---------- | ------------------------------ | ---------------------------------------------------------------------------- |
| `symbol` | `""` | 顯示在變數數值之前的符號。 | | `symbol` | `""` | The symbol used before displaying the variable value. |
| `variable` | | 要顯示的環境變數。 | | `variable` | | The environment variable to be displayed. |
| `default` | | 在選擇的變數值沒有定義時,顯示的預設值。 | | `default` | | The default value to be displayed when the selected variable is not defined. |
| `format` | `"with [$env_value]($style) "` | The format for the module. | | `format` | `"with [$env_value]($style) "` | The format for the module. |
| `disabled` | `false` | 停用 `env_var` 模組。 | | `disabled` | `false` | Disables the `env_var` module. |
### Variables ### Variables
@ -1026,8 +1046,8 @@ default = "unknown user"
The `erlang` module shows the currently installed version of [Erlang/OTP](https://erlang.org/doc/). By default the module will be shown if any of the following conditions are met: The `erlang` module shows the currently installed version of [Erlang/OTP](https://erlang.org/doc/). By default the module will be shown if any of the following conditions are met:
- 現在資料夾中含有一個 `rebar.config` 檔案. - The current directory contains a `rebar.config` file.
- 現在資料夾中含有一個 `erlang.mk` 檔案. - The current directory contains a `erlang.mk` file.
### 選項 ### 選項
@ -1152,22 +1172,22 @@ us-central1 = "uc1"
asia-northeast1 = "an1" asia-northeast1 = "an1"
``` ```
## Git 分支 ## Git Branch
`git_branch` 模組顯示現在的資料夾中使用中的儲存庫的分支。 The `git_branch` module shows the active branch of the repo in your current directory.
### 選項 ### 選項
| Option | 預設 | 說明 | | Option | 預設 | 說明 |
| -------------------- | -------------------------------- | ------------------------------------------------------------------------------------ | | -------------------- | -------------------------------- | ---------------------------------------------------------------------------------------- |
| `always_show_remote` | `false` | Shows the remote tracking branch name, even if it is equal to the local branch name. | | `always_show_remote` | `false` | Shows the remote tracking branch name, even if it is equal to the local branch name. |
| `format` | `"on [$symbol$branch]($style) "` | The format for the module. Use `"$branch"` to refer to the current branch name. | | `format` | `"on [$symbol$branch]($style) "` | The format for the module. Use `"$branch"` to refer to the current branch name. |
| `symbol` | `" "` | A format string representing the symbol of git branch. | | `symbol` | `" "` | A format string representing the symbol of git branch. |
| `style` | `"bold purple"` | 這個模組的風格。 | | `style` | `"bold purple"` | 這個模組的風格。 |
| `truncation_length` | `2^63 - 1` | Truncates a git branch to `N` graphemes. | | `truncation_length` | `2^63 - 1` | Truncates a git branch to `N` graphemes. |
| `truncation_symbol` | `"…"` | 用來指示分支名稱被縮減的符號。 You can use `""` for no symbol. | | `truncation_symbol` | `"…"` | The symbol used to indicate a branch name was truncated. You can use `""` for no symbol. |
| `only_attached` | `false` | Only show the branch name when not in a detached `HEAD` state. | | `only_attached` | `false` | Only show the branch name when not in a detached `HEAD` state. |
| `disabled` | `false` | 停用 `git_branch` 模組。 | | `disabled` | `false` | Disables the `git_branch` module. |
### Variables ### Variables
@ -1229,7 +1249,7 @@ tag_symbol = "🔖 "
## Git State ## 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.
### 選項 ### 選項
@ -1244,7 +1264,7 @@ tag_symbol = "🔖 "
| `am_or_rebase` | `"AM/REBASE"` | A format string displayed when an ambiguous `apply-mailbox` or `rebase` is in progress. | | `am_or_rebase` | `"AM/REBASE"` | A format string displayed when an ambiguous `apply-mailbox` or `rebase` is in progress. |
| `style` | `"bold yellow"` | 這個模組的風格。 | | `style` | `"bold yellow"` | 這個模組的風格。 |
| `format` | `'\([$state( $progress_current/$progress_total)]($style)\) '` | The format for the module. | | `format` | `'\([$state( $progress_current/$progress_total)]($style)\) '` | The format for the module. |
| `disabled` | `false` | 停用 `git_state` 模組。 | | `disabled` | `false` | Disables the `git_state` module. |
### Variables ### Variables
@ -1273,7 +1293,7 @@ The `git_metrics` module will show the number of added and deleted lines in the
::: tip ::: tip
這個模組預設是停用的。 想要啟用它的話,請在設定檔中將 `disabled` 設定為 `false` This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
::: :::
@ -1310,14 +1330,14 @@ format = '[+$added]($added_style)/[-$deleted]($deleted_style) '
## Git Status ## Git Status
`git_status` 模組顯示用來表示現在資料夾之中儲存庫狀態的符號。 The `git_status` module shows symbols representing the state of the repo in your current directory.
### 選項 ### 選項
| Option | 預設 | 說明 | | Option | 預設 | 說明 |
| ------------ | ----------------------------------------------- | ----------------------------------- | | ------------ | ----------------------------------------------- | ----------------------------------- |
| `format` | `'([\[$all_status$ahead_behind\]]($style) )'` | The default format for `git_status` | | `format` | `'([\[$all_status$ahead_behind\]]($style) )'` | The default format for `git_status` |
| `conflicted` | `"="` | 這個分支有合併衝突。 | | `conflicted` | `"="` | This branch has merge conflicts. |
| `ahead` | `"⇡"` | The format of `ahead` | | `ahead` | `"⇡"` | The format of `ahead` |
| `behind` | `"⇣"` | The format of `behind` | | `behind` | `"⇣"` | The format of `behind` |
| `diverged` | `"⇕"` | The format of `diverged` | | `diverged` | `"⇕"` | The format of `diverged` |
@ -1329,7 +1349,7 @@ format = '[+$added]($added_style)/[-$deleted]($deleted_style) '
| `renamed` | `"»"` | The format of `renamed` | | `renamed` | `"»"` | The format of `renamed` |
| `deleted` | `"✘"` | The format of `deleted` | | `deleted` | `"✘"` | The format of `deleted` |
| `style` | `"bold red"` | 這個模組的風格。 | | `style` | `"bold red"` | 這個模組的風格。 |
| `disabled` | `false` | 停用 `git_status` 模組。 | | `disabled` | `false` | Disables the `git_status` module. |
### Variables ### Variables
@ -1397,14 +1417,14 @@ behind = "⇣${count}"
The `golang` module shows the currently installed version of [Go](https://golang.org/). By default the module will be shown if any of the following conditions are met: The `golang` module shows the currently installed version of [Go](https://golang.org/). By default the module will be shown if any of the following conditions are met:
- 現在資料夾中含有一個 `go.mod` 檔案 - The current directory contains a `go.mod` file
- 現在資料夾中含有一個 `go.sum` 檔案 - The current directory contains a `go.sum` file
- 現在資料夾中含有一個 `glide.yaml` 檔案 - The current directory contains a `glide.yaml` file
- 現在資料夾中含有一個 `Gopkg.yml` 檔案 - The current directory contains a `Gopkg.yml` file
- 現在資料夾中含有一個 `Gopkg.lock` 檔案 - The current directory contains a `Gopkg.lock` file
- The current directory contains a `.go-version` file - The current directory contains a `.go-version` file
- 現在資料夾中含有一個 `Godeps` 資料夾 - The current directory contains a `Godeps` directory
- 現在資料夾中含有一個檔案具有 `.go` 副檔名 - The current directory contains a file with the `.go` extension
### 選項 ### 選項
@ -1417,7 +1437,7 @@ The `golang` module shows the currently installed version of [Go](https://golang
| `detect_files` | `["go.mod", "go.sum", "glide.yaml", "Gopkg.yml", "Gopkg.lock", ".go-version"]` | Which filenames should trigger this module. | | `detect_files` | `["go.mod", "go.sum", "glide.yaml", "Gopkg.yml", "Gopkg.lock", ".go-version"]` | Which filenames should trigger this module. |
| `detect_folders` | `["Godeps"]` | Which folders should trigger this module. | | `detect_folders` | `["Godeps"]` | Which folders should trigger this module. |
| `style` | `"bold cyan"` | 這個模組的風格。 | | `style` | `"bold cyan"` | 這個模組的風格。 |
| `disabled` | `false` | 停用 `golang` 模組。 | | `disabled` | `false` | Disables the `golang` module. |
### Variables ### Variables
@ -1442,7 +1462,7 @@ format = "via [🏎💨 $version](bold cyan) "
The `helm` module shows the currently installed version of [Helm](https://helm.sh/). By default the module will be shown if any of the following conditions are met: The `helm` module shows the currently installed version of [Helm](https://helm.sh/). By default the module will be shown if any of the following conditions are met:
- 現在資料夾中含有一個 `helmfile.yaml` 檔案 - The current directory contains a `helmfile.yaml` file
- The current directory contains a `Chart.yaml` file - The current directory contains a `Chart.yaml` file
### 選項 ### 選項
@ -1479,17 +1499,17 @@ format = "via [⎈ $version](bold white) "
## 主機名稱 ## 主機名稱
`hostname` 模組顯示系統的主機名稱。 The `hostname` module shows the system hostname.
### 選項 ### 選項
| Option | 預設 | 說明 | | Option | 預設 | 說明 |
| ---------- | --------------------------- | ---------------------------------------------------------- | | ---------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| `ssh_only` | `true` | 只在連接到一個 SSH session 時顯示主機名稱。 | | `ssh_only` | `true` | Only show hostname when connected to an SSH session. |
| `trim_at` | `"."` | 擷取出主機名稱的斷點,以第一個符合的為準。 `"."` 會讓它停在第一個點的符號。 `""` 會停用任何的截斷功能。 | | `trim_at` | `"."` | String that the hostname is cut off at, after the first match. `"."` will stop after the first dot. `""` will disable any truncation |
| `format` | `"[$hostname]($style) in "` | The format for the module. | | `format` | `"[$hostname]($style) in "` | The format for the module. |
| `style` | `"bold dimmed green"` | 這個模組的風格。 | | `style` | `"bold dimmed green"` | 這個模組的風格。 |
| `disabled` | `false` | 停用 `hostname` 模組。 | | `disabled` | `false` | Disables the `hostname` module. |
### Variables ### Variables
@ -1530,7 +1550,7 @@ The `java` module shows the currently installed version of [Java](https://www.or
| `detect_folders` | `[]` | Which folders should trigger this modules. | | `detect_folders` | `[]` | Which folders should trigger this modules. |
| `symbol` | `"☕ "` | A format string representing the symbol of Java | | `symbol` | `"☕ "` | A format string representing the symbol of Java |
| `style` | `"red dimmed"` | 這個模組的風格。 | | `style` | `"red dimmed"` | 這個模組的風格。 |
| `disabled` | `false` | 停用 `java` 模組。 | | `disabled` | `false` | Disables the `java` module. |
### Variables ### Variables
@ -1551,9 +1571,9 @@ The `java` module shows the currently installed version of [Java](https://www.or
symbol = "🌟 " symbol = "🌟 "
``` ```
## 工作 ## Jobs
`jobs` 模組顯示現在正在執行中的工作。 這個模組只會在有背景工作正在執行時顯示。 The module will show the number of jobs running if there are at least 2 jobs, or more than the `number_threshold` config value, if it exists. The module will show a symbol if there is at least 1 job, or more than the `symbol_threshold` config value, if it exists. You can set both values to 0 in order to *always* show the symbol and number of jobs, even if there are 0 jobs running. 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 are at least 2 jobs, or more than the `number_threshold` config value, if it exists. The module will show a symbol if there is at least 1 job, or more than the `symbol_threshold` config value, if it exists. You can set both values to 0 in order to *always* show the symbol and number of jobs, even if there are 0 jobs running.
The default functionality is: The default functionality is:
@ -1577,13 +1597,13 @@ The `threshold` option is deprecated, but if you want to use it, the module will
| Option | 預設 | 說明 | | Option | 預設 | 說明 |
| ------------------ | ----------------------------- | ------------------------------------------------------------------------ | | ------------------ | ----------------------------- | ------------------------------------------------------------------------ |
| `threshold`\* | `1` | 在超過指定值時顯示工作數量。 | | `threshold`\* | `1` | Show number of jobs if exceeded. |
| `symbol_threshold` | `1` | Show `symbol` if the job count is at least `symbol_threshold`. | | `symbol_threshold` | `1` | Show `symbol` if the job count is at least `symbol_threshold`. |
| `number_threshold` | `2` | Show the number of jobs if the job count is at least `number_threshold`. | | `number_threshold` | `2` | Show the number of jobs if the job count is at least `number_threshold`. |
| `format` | `"[$symbol$number]($style) "` | The format for the module. | | `format` | `"[$symbol$number]($style) "` | The format for the module. |
| `symbol` | `"✦"` | The string used to represent the `symbol` variable. | | `symbol` | `"✦"` | The string used to represent the `symbol` variable. |
| `style` | `"bold blue"` | 這個模組的風格。 | | `style` | `"bold blue"` | 這個模組的風格。 |
| `disabled` | `false` | 停用 `jobs` 模組。 | | `disabled` | `false` | Disables the `jobs` module. |
\*: This option is deprecated, please use the \*: This option is deprecated, please use the
`number_threshold` and `symbol_threshold` options instead. `number_threshold` and `symbol_threshold` options instead.
@ -1702,7 +1722,7 @@ Displays the current [Kubernetes context](https://kubernetes.io/docs/concepts/co
::: tip ::: tip
這個模組預設是停用的。 想要啟用它的話,請在設定檔中將 `disabled` 設定為 `false` This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
::: :::
@ -1762,15 +1782,15 @@ Long and automatically generated cluster names can be identified and shortened u
"gke_.*_(?P<cluster>[\\w-]+)" = "gke-$cluster" "gke_.*_(?P<cluster>[\\w-]+)" = "gke-$cluster"
``` ```
## 換行 ## Line Break
`line_break` 模組將提示字元分成兩行。 The `line_break` module separates the prompt into two lines.
### 選項 ### 選項
| Option | 預設 | 說明 | | Option | 預設 | 說明 |
| ---------- | ------- | ----------------------------- | | ---------- | ------- | ------------------------------------------------------------------ |
| `disabled` | `false` | 停用 `line_break` 模組,讓提示字元變成一行。 | | `disabled` | `false` | Disables the `line_break` module, making the prompt a single line. |
### 範例 ### 範例
@ -1822,27 +1842,27 @@ The `lua` module shows the currently installed version of [Lua](http://www.lua.o
format = "via [🌕 $version](bold blue) " format = "via [🌕 $version](bold blue) "
``` ```
## 記憶體使用量 ## Memory Usage
`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 ::: tip
這個模組預設是停用的。 想要啟用它的話,請在設定檔中將 `disabled` 設定為 `false` This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
::: :::
### 選項 ### 選項
| Option | 預設 | 說明 | | Option | 預設 | 說明 |
| ----------- | ----------------------------------------------- | -------------------------- | | ----------- | ----------------------------------------------- | -------------------------------------------------------- |
| `threshold` | `75` | 將記憶體使用量隱藏,除非使用量超過指定值。 | | `threshold` | `75` | Hide the memory usage unless it exceeds this percentage. |
| `format` | `"via $symbol [${ram}( \| ${swap})]($style) "` | The format for the module. | | `format` | `"via $symbol [${ram}( \| ${swap})]($style) "` | The format for the module. |
| `symbol` | `"🐏"` | 顯示在記憶體使用量之前的符號。 | | `symbol` | `"🐏"` | The symbol used before displaying the memory usage. |
| `style` | `"bold dimmed white"` | 這個模組的風格。 | | `style` | `"bold dimmed white"` | 這個模組的風格。 |
| `disabled` | `true` | 停用 `memory_usage` 模組。 | | `disabled` | `true` | Disables the `memory_usage` module. |
### Variables ### Variables
@ -1881,7 +1901,7 @@ The `hg_branch` module shows the active branch of the repo in your current direc
| `style` | `"bold purple"` | 這個模組的風格。 | | `style` | `"bold purple"` | 這個模組的風格。 |
| `format` | `"on [$symbol$branch]($style) "` | The format for the module. | | `format` | `"on [$symbol$branch]($style) "` | The format for the module. |
| `truncation_length` | `2^63 - 1` | Truncates the hg branch name to `N` graphemes | | `truncation_length` | `2^63 - 1` | Truncates the hg branch name to `N` graphemes |
| `truncation_symbol` | `"…"` | 用來指示分支名稱被縮減的符號。 | | `truncation_symbol` | `"…"` | The symbol used to indicate a branch name was truncated. |
| `disabled` | `true` | Disables the `hg_branch` module. | | `disabled` | `true` | Disables the `hg_branch` module. |
### Variables ### Variables
@ -1909,7 +1929,7 @@ truncation_symbol = ""
The `nim` module shows the currently installed version of [Nim](https://nim-lang.org/). By default the module will be shown if any of the following conditions are met: The `nim` module shows the currently installed version of [Nim](https://nim-lang.org/). By default the module will be shown if any of the following conditions are met:
- 現在資料夾中含有一個 `nim.cfg` 檔案 - 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 `.nim` extension
- The current directory contains a file with the `.nims` extension - The current directory contains a file with the `.nims` extension
- The current directory contains a file with the `.nimble` extension - The current directory contains a file with the `.nimble` extension
@ -1949,7 +1969,7 @@ symbol = "🎣 "
## Nix-shell ## Nix-shell
The `nix_shell` module shows the [nix-shell](https://nixos.org/guides/nix-pills/developing-with-nix-shell.html) environment. 這個模組會在 nix-shell 環境中顯示。 The `nix_shell` module shows the [nix-shell](https://nixos.org/guides/nix-pills/developing-with-nix-shell.html) environment. The module will be shown when inside a nix-shell environment.
### 選項 ### 選項
@ -1960,7 +1980,7 @@ The `nix_shell` module shows the [nix-shell](https://nixos.org/guides/nix-pills/
| `style` | `"bold blue"` | 這個模組的風格。 | | `style` | `"bold blue"` | 這個模組的風格。 |
| `impure_msg` | `"impure"` | A format string shown when the shell is impure. | | `impure_msg` | `"impure"` | A format string shown when the shell is impure. |
| `pure_msg` | `"pure"` | A format string shown when the shell is pure. | | `pure_msg` | `"pure"` | A format string shown when the shell is pure. |
| `disabled` | `false` | 停用 `nix_shell` 模組。 | | `disabled` | `false` | Disables the `nix_shell` module. |
### Variables ### Variables
@ -1989,10 +2009,10 @@ format = 'via [☃️ $state( \($name\))](bold blue) '
The `nodejs` module shows the currently installed version of [Node.js](https://nodejs.org/). By default the module will be shown if any of the following conditions are met: The `nodejs` module shows the currently installed version of [Node.js](https://nodejs.org/). By default the module will be shown if any of the following conditions are met:
- 現在資料夾中包含一個 `package.json` 檔案 - The current directory contains a `package.json` file
- The current directory contains a `.node-version` file - The current directory contains a `.node-version` file
- The current directory contains a `.nvmrc` file - The current directory contains a `.nvmrc` file
- 現在資料夾中包含一個 `node_modules` 資料夾 - The current directory contains a `node_modules` directory
- The current directory contains a file with the `.js`, `.mjs` or `.cjs` extension - The current directory contains a file with the `.js`, `.mjs` or `.cjs` extension
- The current directory contains a file with the `.ts` extension - The current directory contains a file with the `.ts` extension
@ -2007,7 +2027,7 @@ The `nodejs` module shows the currently installed version of [Node.js](https://n
| `detect_files` | `["package.json", ".node-version"]` | Which filenames should trigger this module. | | `detect_files` | `["package.json", ".node-version"]` | Which filenames should trigger this module. |
| `detect_folders` | `["node_modules"]` | Which folders should trigger this module. | | `detect_folders` | `["node_modules"]` | Which folders should trigger this module. |
| `style` | `"bold green"` | 這個模組的風格。 | | `style` | `"bold green"` | 這個模組的風格。 |
| `disabled` | `false` | 停用 `nodejs` 模組。 | | `disabled` | `false` | Disables the `nodejs` module. |
| `not_capable_style` | `bold red` | The style for the module when an engines property in package.json does not match the Node.js version. | | `not_capable_style` | `bold red` | The style for the module when an engines property in package.json does not match the Node.js version. |
### Variables ### Variables
@ -2111,9 +2131,9 @@ style = "bold yellow"
symbol = "☁️ " symbol = "☁️ "
``` ```
## 套件版本 ## Package Version
The `package` 模組在現在資料夾是一個套件的儲藏庫時出現,並顯示他的現在版本。 The module currently supports `npm`, `nimble`, `cargo`, `poetry`, `composer`, `gradle`, `julia`, `mix`, `helm` and `shards` 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`, `nimble`, `cargo`, `poetry`, `composer`, `gradle`, `julia`, `mix`, `helm` and `shards` packages.
- [**npm**](https://docs.npmjs.com/cli/commands/npm) The `npm` package version is extracted from the `package.json` present in the current directory - [**npm**](https://docs.npmjs.com/cli/commands/npm) The `npm` package version is extracted from the `package.json` present in the current directory
- [**Cargo**](https://doc.rust-lang.org/cargo/) The `cargo` package version is extracted from the `Cargo.toml` present in the current directory - [**Cargo**](https://doc.rust-lang.org/cargo/) The `cargo` package version is extracted from the `Cargo.toml` present in the current directory
@ -2129,6 +2149,7 @@ The `package` 模組在現在資料夾是一個套件的儲藏庫時出現,並
- [**Meson**](https://mesonbuild.com/) - The `meson` package version is extracted from the `meson.build` present - [**Meson**](https://mesonbuild.com/) - The `meson` package version is extracted from the `meson.build` present
- [**Shards**](https://crystal-lang.org/reference/the_shards_command/index.html) - The `shards` package version is extracted from the `shard.yml` present - [**Shards**](https://crystal-lang.org/reference/the_shards_command/index.html) - The `shards` package version is extracted from the `shard.yml` present
- [**V**](https://vlang.io) - The `vlang` package version is extracted from the `v.mod` present - [**V**](https://vlang.io) - The `vlang` package version is extracted from the `v.mod` present
- [**SBT**](https://scala-sbt.org) - The `sbt` package version is extracted from the `build.sbt` present in the current directory
> ⚠️ 顯示出來的版本是從你的現在資料夾之中擷取出來的,並非從套件管理員取得。 > ⚠️ 顯示出來的版本是從你的現在資料夾之中擷取出來的,並非從套件管理員取得。
@ -2137,11 +2158,11 @@ The `package` 模組在現在資料夾是一個套件的儲藏庫時出現,並
| Option | 預設 | 說明 | | Option | 預設 | 說明 |
| ----------------- | --------------------------------- | ------------------------------------------------------------------------- | | ----------------- | --------------------------------- | ------------------------------------------------------------------------- |
| `format` | `"is [$symbol$version]($style) "` | The format for the module. | | `format` | `"is [$symbol$version]($style) "` | The format for the module. |
| `symbol` | `"📦 "` | 顯示在套件的版本之前的符號。 | | `symbol` | `"📦 "` | The symbol used before displaying the version the package. |
| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | | `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` |
| `style` | `"bold 208"` | 這個模組的風格。 | | `style` | `"bold 208"` | 這個模組的風格。 |
| `display_private` | `false` | Enable displaying version for packages marked as private. | | `display_private` | `false` | Enable displaying version for packages marked as private. |
| `disabled` | `false` | 停用 `package` 模組。 | | `disabled` | `false` | Disables the `package` module. |
### Variables ### Variables
@ -2206,7 +2227,7 @@ format = "via [🦪 $version]($style) "
The `php` module shows the currently installed version of [PHP](https://www.php.net/). By default the module will be shown if any of the following conditions are met: The `php` module shows the currently installed version of [PHP](https://www.php.net/). By default the module will be shown if any of the following conditions are met:
- 現在資料夾中含有一個 `composer.json` 檔案 - The current directory contains a `composer.json` file
- The current directory contains a `.php-version` file - The current directory contains a `.php-version` file
- The current directory contains a `.php` extension - The current directory contains a `.php` extension
@ -2636,7 +2657,7 @@ The `shell` module shows an indicator for currently used shell.
::: tip ::: tip
這個模組預設是停用的。 想要啟用它的話,請在設定檔中將 `disabled` 設定為 `false` This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
::: :::
@ -2753,7 +2774,7 @@ The `status` module displays the exit code of the previous command. The module w
::: tip ::: tip
這個模組預設是停用的。 想要啟用它的話,請在設定檔中將 `disabled` 設定為 `false` This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
::: :::
@ -2809,6 +2830,56 @@ disabled = false
``` ```
## Sudo
The `sudo` module displays if sudo credentials are currently cached. The module will only be shown if credentials are cached.
::: tip
This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
:::
### 選項
| Option | 預設 | 說明 |
| --------------- | ----------------------- | ------------------------------------------------------- |
| `format` | `[as $symbol]($style)"` | The format of the module |
| `symbol` | `"🧙 "` | The symbol displayed when credentials are cached |
| `style` | `"bold blue"` | 這個模組的風格。 |
| `allow_windows` | `false` | Since windows has no default sudo, default is disabled. |
| `disabled` | `true` | Disables the `sudo` module. |
### Variables
| 變數 | 範例 | 說明 |
| --------- | -- | ------------------------------------ |
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
### 範例
```toml
# ~/.config/starship.toml
[sudo]
style = "bold green"
symbol = "👩‍💻 "
disabled = false
```
```toml
# On windows
# $HOME\.starship\config.toml
[sudo]
allow_windows = true
disabled = false
```
## Swift ## Swift
By default the `swift` module shows the currently installed version of [Swift](https://swift.org/). The module will be shown if any of the following conditions are met: By default the `swift` module shows the currently installed version of [Swift](https://swift.org/). The module will be shown if any of the following conditions are met:
@ -2913,7 +2984,7 @@ The `time` module shows the current **local** time. The `format` configuration v
::: tip ::: tip
這個模組預設是停用的。 想要啟用它的話,請在設定檔中將 `disabled` 設定為 `false` This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
::: :::

View File

@ -60,9 +60,9 @@ sh -c "$(curl -fsSL https://starship.rs/install.sh)" -- --platform unknown-linux
Starship executes different commands to get information to display in the prompt, for example the version of a program or the current git status. To make sure starship doesn't hang while trying to execute these commands we set a time limit, if a command takes longer than this limit starship will stop the execution of the command and output the above warning, this is expected behaviour. This time limit is configurable using the [`command_timeout` key](/config/#prompt) so if you want you can increase the time limit. You can also follow the debugging steps below to see which command is being slow and see if you can optimise it. Finally you can set the `STARSHIP_LOG` env var to `error` to hide these warnings. Starship executes different commands to get information to display in the prompt, for example the version of a program or the current git status. To make sure starship doesn't hang while trying to execute these commands we set a time limit, if a command takes longer than this limit starship will stop the execution of the command and output the above warning, this is expected behaviour. This time limit is configurable using the [`command_timeout` key](/config/#prompt) so if you want you can increase the time limit. You can also follow the debugging steps below to see which command is being slow and see if you can optimise it. Finally you can set the `STARSHIP_LOG` env var to `error` to hide these warnings.
## I see symbols I don't understand or expect, what do they mean? ## 我發現一些看不懂或意料外的符號,那是代表什麼意思?
If you see symbols that you don't recognise you can use `starship explain` to explain the currently showing modules. 如果你看見了一些不認得的符號,你可以使用 `starship explain` 來列出當下顯示出的 modules 的解釋。
## Starship is doing something unexpected, how can I debug it? ## Starship is doing something unexpected, how can I debug it?
@ -86,37 +86,37 @@ Finally if you find a bug you can use the `bug-report` command to create a Githu
starship bug-report starship bug-report
``` ```
## Why don't I see a glyph symbol in my prompt? ## 為什麼我無法在我的提示字元中看到字形符號?
The most common cause of this is system misconfiguration. Some Linux distros in particular do not come with font support out-of-the-box. You need to ensure that: 會導致這種狀況,通常是因為系統配置錯誤。 有些 Linux 發行版不支援隨開隨用的字體。 你需要確保:
- 你的當地語言設置為 UTF-8`de_DE.UTF-8``ja_JP.UTF-8`。 如果 `LC_ALL` 不是 UTF-8[你會需要改變他](https://www.tecmint.com/set-system-locales-in-linux/)。 - 你的當地語言設置為 UTF-8`de_DE.UTF-8``ja_JP.UTF-8`。 如果 `LC_ALL` 不是 UTF-8[你會需要改變他](https://www.tecmint.com/set-system-locales-in-linux/)。
- 你已經安裝一個表情符號字體。 大多數的系統在預設情況下皆有支持表情符號字體,然後有些(尤其 Arch Linux沒有。 你通常可以透過系統的套件管理器安裝一個表情符號字體 —— [noto emoji](https://www.google.com/get/noto/help/emoji/) 是個受歡迎的選擇。 - 你已經安裝一個表情符號字體。 大多數的系統在預設情況下皆有支持表情符號字體,然後有些(尤其 Arch Linux沒有。 你通常可以透過系統的套件管理器安裝一個表情符號字體 —— [noto emoji](https://www.google.com/get/noto/help/emoji/) 是個受歡迎的選擇。
- 你正在使用 [Nerd Font](https://www.nerdfonts.com/)。 - 你正在使用 [Nerd Font](https://www.nerdfonts.com/)。
To test your system, run the following commands in a terminal: 要測試你的系統,你可以在終端中執行以下指令:
```sh ```sh
echo -e "\xf0\x9f\x90\x8d" echo -e "\xf0\x9f\x90\x8d"
echo -e "\xee\x82\xa0" echo -e "\xee\x82\xa0"
``` ```
The first line should produce a [snake emoji](https://emojipedia.org/snake/), while the second should produce a [powerline branch symbol (e0a0)](https://github.com/ryanoasis/powerline-extra-symbols#glyphs). 第一行指令應該會顯示一個 [snake emoji](https://emojipedia.org/snake/),同時,第二行指令應該顯示 [powerline branch symbol (e0a0)](https://github.com/ryanoasis/powerline-extra-symbols#glyphs)
If either symbol fails to display correctly, your system is still misconfigured. Unfortunately, getting font configuration correct is sometimes difficult. Users on the Discord may be able to help. If both symbols display correctly, but you still don't see them in starship, [file a bug report!](https://github.com/starship/starship/issues/new/choose) 如果任何一個符號顯示錯誤,代表你的系統配置仍然是錯誤的。 不幸的是,正確的設置字體有時候是件困難的事。 Discord 上的使用者可能可以提供協助。 如果兩種符號皆正確顯示,但你仍然無法在 starship 中看到他們,請[發送 bug 回報](https://github.com/starship/starship/issues/new/choose)
## How do I uninstall Starship? ## 我要如何從電腦中移除 Starship
Starship is just as easy to uninstall as it is to install in the first place. 移除 Starship 的過程與安裝過程一樣簡單。
1. 刪除 Shell 的設定檔案 (比如 `~/.bashrc`) 中用來初始化 Starship 的部分。 1. 刪除 Shell 的設定檔案 (比如 `~/.bashrc`) 中用來初始化 Starship 的部分。
1. 刪除 Starship 的執行檔 1. 刪除 Starship 的執行檔
If Starship was installed using a package manager, please refer to their docs for uninstallation instructions. 如果你是透過套件管理器安裝 Starship 的,請到套件管理器的文件中尋找相關的移除步驟指示。
If Starship was installed using the install script, the following command will delete the binary: 如果你是透過安裝腳本來安裝 Starship 的,可以執行以下的命令來移除執行檔。
```sh ```sh
# Locate and delete the starship binary # 定位並且刪除 starship 執行檔
sh -c 'rm "$(which starship)"' sh -c 'rm "$(which starship)"'
``` ```

View File

@ -306,7 +306,7 @@
## 💭 發想來自 ## 💭 發想來自
Please check out these previous works that helped inspire the creation of starship. 🙏 請看之前這些幫助我們創造 Starship 的前任作品。 🙏
- **[denysdovhan/spaceship-prompt](https://github.com/denysdovhan/spaceship-prompt)** - 給太空人的 ZSH 提示。 - **[denysdovhan/spaceship-prompt](https://github.com/denysdovhan/spaceship-prompt)** - 給太空人的 ZSH 提示。
@ -321,4 +321,4 @@ Please check out these previous works that helped inspire the creation of starsh
## 📝 許可 ## 📝 許可
Copyright © 2019-present, [Starship Contributors](https://github.com/starship/starship/graphs/contributors).<br /> This project is [ISC](https://github.com/starship/starship/blob/master/LICENSE) licensed. Copyright © 2019-present, [Starship Contributors](https://github.com/starship/starship/graphs/contributors).<br /> 這個專案使用 [ISC](https://github.com/starship/starship/blob/master/LICENSE) 許可。

View File

@ -47,7 +47,7 @@ emerge app-shells/starship
## [Nix](https://nixos.wiki/wiki/Nix) ## [Nix](https://nixos.wiki/wiki/Nix)
### Getting the Binary ### 獲得執行檔
#### 命令式 #### 命令式
@ -57,7 +57,7 @@ nix-env -iA nixos.starship
#### 聲明式、單個使用者,使用 [home-manager](https://github.com/nix-community/home-manager) #### 聲明式、單個使用者,使用 [home-manager](https://github.com/nix-community/home-manager)
Enable the `programs.starship` module in your `home.nix` file, and add your settings `home.nix` 檔案中,啟用 `programs.starship` 模組,並且添加你的設定:
```nix ```nix
{ {
@ -79,7 +79,7 @@ Enable the `programs.starship` module in your `home.nix` file, and add your sett
} }
``` ```
then run 然後執行
```sh ```sh
home-manager switch home-manager switch
@ -87,7 +87,7 @@ home-manager switch
#### 聲明式、全系統,使用 NixOS #### 聲明式、全系統,使用 NixOS
Add `pkgs.starship` to `environment.systemPackages` in your `configuration.nix`, then run `pkgs.starship` 添加至 `configuration.nix` 檔案內的 `environment.systemPackages` 下,並且執行
```sh ```sh
sudo nixos-rebuild switch sudo nixos-rebuild switch

View File

@ -223,6 +223,9 @@ format = '\[[$symbol($version)]($style)\]'
[scala] [scala]
format = '\[[$symbol($version)]($style)\]' format = '\[[$symbol($version)]($style)\]'
[sudo]
format = '\[[as $symbol]\]
[swift] [swift]
format = '\[[$symbol($version)]($style)\]' format = '\[[$symbol($version)]($style)\]'
@ -371,6 +374,9 @@ symbol = "rs "
[scala] [scala]
symbol = "scala " symbol = "scala "
[sudo]
symbol = "sudo "
[swift] [swift]
symbol = "swift " symbol = "swift "
``` ```