diff --git a/docs/ar-SA/README.md b/docs/ar-SA/README.md index ffc403eb1..e3cfcb8ae 100644 --- a/docs/ar-SA/README.md +++ b/docs/ar-SA/README.md @@ -18,7 +18,7 @@ features: footer: ISC Licensed | Copyright © 2019-present Starship Contributors #Used for the description meta tag, for SEO metaTitle: "Starship: Cross-Shell Prompt" -description: Starship is the minimal, blazing fast, and extremely customizable prompt for any shell! Shows the information you need, while staying sleek and minimal. Quick installation available for Bash, Fish, ZSH, Ion, Tcsh, Elvish, Nu, Xonsh, and PowerShell. +description: Starship is the minimal, blazing fast, and extremely customizable prompt for any shell! Shows the information you need, while staying sleek and minimal. Quick installation available for Bash, Fish, ZSH, Ion, Tcsh, Elvish, Nu, Xonsh, Cmd, and PowerShell. ---
@@ -119,7 +119,7 @@ description: Starship is the minimal, blazing fast, and extremely customizable p #### Elvish - ::: تحذير يدعم فقط elvish v0.15 أو أعلى. ::: + ::: warning Only elvish v0.17 or higher is supported. ::: أضف ما يلي إلى نهاية `~/.elvish/rc.elv`: @@ -164,3 +164,14 @@ description: Starship is the minimal, blazing fast, and extremely customizable p execx($(starship init xonsh)) ``` + + + #### Cmd + + You need to use [Clink](https://chrisant996.github.io/clink/clink.html) (v1.2.30+) with Cmd. Add the following to a file `starship.lua` and place this file in Clink scripts directory: + + ```lua + -- starship.lua + + load(io.popen('starship init cmd'):read("*a"))() + ``` diff --git a/docs/ar-SA/advanced-config/README.md b/docs/ar-SA/advanced-config/README.md index cc5de9d73..a29253086 100644 --- a/docs/ar-SA/advanced-config/README.md +++ b/docs/ar-SA/advanced-config/README.md @@ -8,6 +8,30 @@ The configurations in this section are subject to change in future releases of S ::: +## Custom pre-prompt and pre-execution Commands in Cmd + +Clink provides extremely flexible APIs to run pre-prompt and pre-exec commands in Cmd shell. It is fairly simple to use with Starship. Make the following changes to your `starship.lua` file as per your requirements: + +- To run a custom function right before the prompt is drawn, define a new function called `starship_preprompt_user_func`. This function receives the current prompt as a string that you can utilize. For example, to draw a rocket before the prompt, you would do + +```lua +function starship_preprompt_user_func(prompt) + print("🚀") +end + +load(io.popen('starship init cmd'):read("*a"))() +``` + +- To run a custom function right before a command is executed, define a new function called `starship_precmd_user_func`. This function receives the current commandline as a string that you can utilize. For example, to print the command that's about to be executed, you would do + +```lua +function starship_precmd_user_func(line) + print("Executing: "..line) +end + +load(io.popen('starship init cmd'):read("*a"))() +``` + ## Custom pre-prompt and pre-execution Commands in Bash Bash does not have a formal preexec/precmd framework like most other shells. Because of this, it is difficult to provide fully customizable hooks in `bash`. However, Starship does give you limited ability to insert your own functions into the prompt-rendering procedure: @@ -45,7 +69,7 @@ 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 even does it by default. Starship does not do this, but it's fairly straightforward to add this functionality to `bash`, `zsh`, `cmd` or `powershell`. First, define a window title change function (identical in bash and zsh): @@ -80,6 +104,16 @@ function set_win_title(){ starship_precmd_user_func="set_win_title" ``` +For Cmd, you can change the window title using the `starship_preprompt_user_func` function. + +```lua +function starship_preprompt_user_func(prompt) + console.settitle(os.getenv('USERNAME').."@"..os.getenv('COMPUTERNAME')..": "..os.getcwd()) +end + +load(io.popen('starship init cmd'):read("*a"))() +``` + You can also set a similar output with PowerShell by creating a function named `Invoke-Starship-PreCommand`. ```powershell @@ -97,7 +131,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). -`right_format` is currently supported for the following shells: elvish, fish, zsh. +`right_format` is currently supported for the following shells: elvish, fish, zsh, xonsh, cmd. ### مثال @@ -117,6 +151,28 @@ Produces a prompt like the following: ▶ starship on  rprompt [!] is 📦 v0.57.0 via 🦀 v1.54.0 took 17s ``` +## Continuation Prompt + +Some shells support a continuation prompt along with the normal prompt. This prompt is rendered instead of the normal prompt when the user has entered an incomplete statement (such as a single left parenthesis or quote). + +Starship can set the continuation prompt using the `continuation_prompt` option. The default prompt is `"[∙](bright-black) "`. + +Note: `continuation_prompt` should be set to a literal string without any variables. + +Note: Continuation prompts are only available in the following shells: + + - `bash` + - `zsh` + - `PowerShell` + +### مثال + +```toml +# ~/.config/starship.toml + +# A continuation prompt that displays two filled in arrows +continuation_prompt = "▶▶" +``` ## Style Strings diff --git a/docs/ar-SA/config/README.md b/docs/ar-SA/config/README.md index bec007e1b..60c431a0a 100644 --- a/docs/ar-SA/config/README.md +++ b/docs/ar-SA/config/README.md @@ -24,13 +24,19 @@ disabled = true You can change default configuration file location with `STARSHIP_CONFIG` environment variable: ```sh -export STARSHIP_CONFIG=~/.starship/config.toml +export STARSHIP_CONFIG=~/example/non/default/path/starship.toml ``` Equivalently in PowerShell (Windows) would be adding this line to your `$PROFILE`: ```powershell -$ENV:STARSHIP_CONFIG = "$HOME\.starship\config.toml" +$ENV:STARSHIP_CONFIG = "$HOME\example\non\default\path\starship.toml" +``` + +Or for Cmd (Windows) would be adding this line to your `starship.lua`: + +```lua +os.setenv('STARSHIP_CONFIG', 'C:\\Users\\user\\example\\non\\default\\path\\starship.toml') ``` ### Logging @@ -47,6 +53,12 @@ Equivalently in PowerShell (Windows) would be adding this line to your `$PROFILE $ENV:STARSHIP_CACHE = "$HOME\AppData\Local\Temp" ``` +Or for Cmd (Windows) would be adding this line to your `starship.lua`: + +```lua +os.setenv('STARSHIP_CACHE', 'C:\\Users\\user\\AppData\\Local\\Temp') +``` + ### Terminology **Module**: A component in the prompt giving information based on contextual information from your OS. For example, the "nodejs" module shows the version of Node.js that is currently installed on your computer, if your current directory is a Node.js project. @@ -63,7 +75,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 can only contain letters, numbers and `_`. -على سبيل المثال: +For example: - `$version` is a format string with a variable named `version`. - `$git_branch$git_commit` is a format string with two variables named `git_branch` and `git_commit`. @@ -77,7 +89,7 @@ The first part, which is enclosed in a `[]`, is a [format string](#format-string In the second part, which is enclosed in a `()`, is a [style string](#style-strings). This can be used to style the first part. -على سبيل المثال: +For example: - `[on](red bold)` will print a string `on` with bold text colored red. - `[⌘ $version](bold green)` will print a symbol `⌘` followed by the content of variable `version`, with bold text colored green. @@ -100,7 +112,7 @@ Note that what styling looks like will be controlled by your terminal emulator. A conditional format string wrapped in `(` and `)` will not render if all variables inside are empty. -على سبيل المثال: +For example: - `(@$region)` will show nothing if the variable `region` is `None` or empty string, otherwise `@` followed by the value of region. - `(some text)` will always show nothing since there are no variables wrapped in the braces. @@ -425,13 +437,13 @@ By default it only changes color. If you also want to change its shape take a lo ::: تحذير -`error_symbol` is not supported on elvish and nu shell. +`error_symbol` is not supported on nu shell. ::: ::: تحذير -`vicmd_symbol` is only supported in fish and zsh. +`vicmd_symbol` is only supported in cmd, fish and zsh. ::: @@ -568,7 +580,7 @@ Bash users who need preexec-like functionality can use [rcaloras's bash_preexec ::: tip -Showing desktop notifications requires starship to be built with `rust-notify` support. You check if your starship supports notifications by running `STARSHIP_LOG=debug starship module cmd_duration -d 60000` when `show_notifications` is set to `true`. +Showing desktop notifications requires starship to be built with `notify-rust` support. You check if your starship supports notifications by running `STARSHIP_LOG=debug starship module cmd_duration -d 60000` when `show_notifications` is set to `true`. ::: @@ -713,20 +725,20 @@ format = "via [🔰 $version](bold red) " ## Deno The `deno` module shows you your currently installed version of [Deno](https://deno.land/). By default the module will be shown if any of the following conditions are met: -- The current directory contains a `mod.ts`, `mod.js`, `deps.ts` or `deps.js` file +- The current directory contains a `deno.json`, `deno.jsonc`, `mod.ts`, `mod.js`, `deps.ts` or `deps.js` file ### Options -| Option | الافتراضي | الوصف | -| ------------------- | -------------------------------------------- | ------------------------------------------------------------------------- | -| `format` | `"via [$symbol($version )]($style)"` | The format for the module. | -| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | -| `symbol` | `"🦕 "` | A format string representing the symbol of Deno | -| `detect_extensions` | `[]` | Which extensions should trigger this module. | -| `detect_files` | `["mod.ts", "mod.js", "deps.ts", "deps.js"]` | Which filenames should trigger this module. | -| `detect_folders` | `[]` | Which folders should trigger this module. | -| `style` | `"green bold"` | The style for the module. | -| `disabled` | `false` | Disables the `deno` module. | +| Option | الافتراضي | الوصف | +| ------------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `format` | `"via [$symbol($version )]($style)"` | The format for the module. | +| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | +| `symbol` | `"🦕 "` | A format string representing the symbol of Deno | +| `detect_extensions` | `[]` | Which extensions should trigger this module. | +| `detect_files` | `["deno.json", "deno.jsonc", "mod.ts", "mod.js", "deps.ts", "deps.js"]` | Which filenames should trigger this module. | +| `detect_folders` | `[]` | Which folders should trigger this module. | +| `style` | `"green bold"` | The style for the module. | +| `disabled` | `false` | Disables the `deno` module. | ### Variables @@ -755,18 +767,19 @@ For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, an ### Options -| Option | الافتراضي | الوصف | -| ------------------- | -------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `truncation_length` | `3` | The number of parent folders that the current directory should be truncated to. | -| `truncate_to_repo` | `true` | Whether or not to truncate to the root of the git repo that you're currently in. | -| `format` | `"[$path]($style)[$read_only]($read_only_style) "` | The format for the module. | -| `style` | `"bold cyan"` | The style for the module. | -| `disabled` | `false` | Disables the `directory` module. | -| `read_only` | `"🔒"` | The symbol indicating current directory is read only. | -| `read_only_style` | `"red"` | The style for the read only symbol. | -| `truncation_symbol` | `""` | The symbol to prefix to truncated paths. eg: "…/" | -| `repo_root_style` | `None` | The style for the root of the git repo when `truncate_to_repo` option is set to false. | -| `home_symbol` | `"~"` | The symbol indicating home directory. | +| Option | الافتراضي | الوصف | +| ------------------- | -------------------------------------------------- | --------------------------------------------------------------------------------------- | +| `truncation_length` | `3` | The number of parent folders that the current directory should be truncated to. | +| `truncate_to_repo` | `true` | Whether or not to truncate to the root of the git repo that you're currently in. | +| `format` | `"[$path]($style)[$read_only]($read_only_style) "` | The format for the module. | +| `style` | `"bold cyan"` | The style for the module. | +| `disabled` | `false` | Disables the `directory` module. | +| `read_only` | `"🔒"` | The symbol indicating current directory is read only. | +| `read_only_style` | `"red"` | The style for the read only symbol. | +| `truncation_symbol` | `""` | The symbol to prefix to truncated paths. eg: "…/" | +| `repo_root_style` | `None` | The style for the root of the git repo when `truncate_to_repo` option is set to false. | +| `home_symbol` | `"~"` | The symbol indicating home directory. | +| `use_os_path_sep` | `true` | Use the OS specific path seperator instead of always using `/` (e.g. `\` on Windows) |
This module has a few advanced configuration options that control how the directory is displayed. @@ -1334,22 +1347,23 @@ The `git_status` module shows symbols representing the state of the repo in your ### Options -| Option | الافتراضي | الوصف | -| ------------ | ----------------------------------------------- | ----------------------------------- | -| `format` | `'([\[$all_status$ahead_behind\]]($style) )'` | The default format for `git_status` | -| `conflicted` | `"="` | This branch has merge conflicts. | -| `ahead` | `"⇡"` | The format of `ahead` | -| `behind` | `"⇣"` | The format of `behind` | -| `diverged` | `"⇕"` | The format of `diverged` | -| `up_to_date` | `""` | The format of `up_to_date` | -| `untracked` | `"?"` | The format of `untracked` | -| `stashed` | `"$"` | The format of `stashed` | -| `modified` | `"!"` | The format of `modified` | -| `staged` | `"+"` | The format of `staged` | -| `renamed` | `"»"` | The format of `renamed` | -| `deleted` | `"✘"` | The format of `deleted` | -| `style` | `"bold red"` | The style for the module. | -| `disabled` | `false` | Disables the `git_status` module. | +| Option | الافتراضي | الوصف | +| ------------------- | ----------------------------------------------- | ----------------------------------- | +| `format` | `'([\[$all_status$ahead_behind\]]($style) )'` | The default format for `git_status` | +| `conflicted` | `"="` | This branch has merge conflicts. | +| `ahead` | `"⇡"` | The format of `ahead` | +| `behind` | `"⇣"` | The format of `behind` | +| `diverged` | `"⇕"` | The format of `diverged` | +| `up_to_date` | `""` | The format of `up_to_date` | +| `untracked` | `"?"` | The format of `untracked` | +| `stashed` | `"$"` | The format of `stashed` | +| `modified` | `"!"` | The format of `modified` | +| `staged` | `"+"` | The format of `staged` | +| `renamed` | `"»"` | The format of `renamed` | +| `deleted` | `"✘"` | The format of `deleted` | +| `style` | `"bold red"` | The style for the module. | +| `ignore_submodules` | `false` | Ignore changes to submodules. | +| `disabled` | `false` | Disables the `git_status` module. | ### Variables @@ -1513,10 +1527,10 @@ The `hostname` module shows the system hostname. ### Variables -| Variable | مثال | الوصف | -| --------- | ---- | ------------------------------------ | -| symbol | | Mirrors the value of option `symbol` | -| style\* | | Mirrors the value of option `style` | +| Variable | مثال | الوصف | +| --------- | ---------- | ----------------------------------- | +| hostname | `computer` | The hostname of the computer | +| style\* | | Mirrors the value of option `style` | \*: This variable can only be used as a part of a style string @@ -2133,7 +2147,7 @@ symbol = "☁️ " ## Package Version -The `package` module is shown when the current directory is the repository for a package, and shows its current version. The module currently supports `npm`, `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`, `shards` and `dart` packages. - [**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 @@ -2150,6 +2164,7 @@ The `package` module is shown when the current directory is the repository for a - [**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 - [**SBT**](https://scala-sbt.org) - The `sbt` package version is extracted from the `build.sbt` present in the current directory +- [**Dart**](https://pub.dev/) - The `dart` package version is extracted from the `pubspec.yaml` 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. @@ -2673,6 +2688,8 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y | `elvish_indicator` | `esh` | A format string used to represent elvish. | | `tcsh_indicator` | `tsh` | A format string used to represent tcsh. | | `xonsh_indicator` | `xsh` | A format string used to represent xonsh. | +| `cmd_indicator` | `cmd` | A format string used to represent cmd. | +| `nu_indicator` | `nu` | A format string used to represent nu. | | `unknown_indicator` | | The default value to be displayed when the shell is unknown. | | `format` | `"[$indicator]($style) "` | The format for the module. | | `style` | `"white bold"` | The style for the module. | @@ -2778,7 +2795,7 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y ::: -::: warning This module is not supported on elvish and nu shell. ::: +::: warning This module is not supported on nu shell. ::: ### Options @@ -2804,6 +2821,7 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y | Variable | مثال | الوصف | | -------------- | ------- | ------------------------------------------------------------------------------------------- | | status | `127` | The exit code of the last command | +| hex_status | `0x7F` | The exit code of the last command in hex | | int | `127` | The exit code of the last command | | common_meaning | `ERROR` | Meaning of the code if not a signal | | signal_number | `9` | Signal number corresponding to the exit code, only if signalled | diff --git a/docs/ar-SA/faq/README.md b/docs/ar-SA/faq/README.md index 8422ee2e3..99dd6bcc8 100644 --- a/docs/ar-SA/faq/README.md +++ b/docs/ar-SA/faq/README.md @@ -69,13 +69,13 @@ If you see symbols that you don't recognise you can use `starship explain` to ex You can enable the debug logs by using the `STARSHIP_LOG` env var. These logs can be very verbose so it is often useful to use the `module` command if you are trying to debug a particular module, for example, if you are trying to debug the `rust` module you could run the following command to get the trace logs and output from the module. ```sh -env STARHIP_LOG=trace starship module rust +env STARSHIP_LOG=trace starship module rust ``` If starship is being slow you can try using the `timings` command to see if there is a particular module or command that to blame. ```sh -env STARHIP_LOG=trace starship timings +env STARSHIP_LOG=trace starship timings ``` This will output the trace log and a breakdown of all modules that either took more than 1ms to execute or produced some output. @@ -118,5 +118,5 @@ If Starship was installed using the install script, the following command will d ```sh # Locate and delete the starship binary -sh -c 'rm "$(which starship)"' +sh -c 'rm "$(command -v 'starship')"' ``` diff --git a/docs/ar-SA/guide/README.md b/docs/ar-SA/guide/README.md index 5ae5becea..243fcfca4 100644 --- a/docs/ar-SA/guide/README.md +++ b/docs/ar-SA/guide/README.md @@ -72,6 +72,22 @@ height="20" src="https://raw.githubusercontent.com/starship/starship/master/media/flag-fr.png" alt="Français" + /> +   + Bahasa Indonesia +   + Italiano   @@ -119,7 +119,7 @@ description: 'Starship: یەکێ لە promptـە سوکەڵە، خێرا، و ب #### Elvish - ::: ئاگادارکردنەوە تەنها elvish v0.15 یان بەرزتر پشتگیری کراوە. ::: + ::: warning Only elvish v0.17 or higher is supported. ::: ئەمەی خوارەوە زیادبکە لە کۆتایی `~/.elvish/rc.elv`: @@ -164,3 +164,14 @@ description: 'Starship: یەکێ لە promptـە سوکەڵە، خێرا، و ب execx($(starship init xonsh)) ``` + + + #### Cmd + + You need to use [Clink](https://chrisant996.github.io/clink/clink.html) (v1.2.30+) with Cmd. Add the following to a file `starship.lua` and place this file in Clink scripts directory: + + ```lua + -- starship.lua + + load(io.popen('starship init cmd'):read("*a"))() + ``` diff --git a/docs/ckb-IR/advanced-config/README.md b/docs/ckb-IR/advanced-config/README.md index 375855752..84f3de2e0 100644 --- a/docs/ckb-IR/advanced-config/README.md +++ b/docs/ckb-IR/advanced-config/README.md @@ -8,9 +8,33 @@ ::: -## فرمانە کڕیاڕخوازەکانی pre-prompt و pre-execution لە Bashـدا +## Custom pre-prompt and pre-execution Commands in Cmd -بەپێچەوانەی شێلەکانی دیکە Bash هیچ چوارچێوەیەکی فەرمی preexec/precmdـی نییە. لەبەر ئەوە، دابین کردنی قولابە تەواو کڕیارخوازکراوەکان ئاسان نییە لە `Bash`. However, Starship does give you limited ability to insert your own functions into the prompt-rendering procedure: +Clink provides extremely flexible APIs to run pre-prompt and pre-exec commands in Cmd shell. It is fairly simple to use with Starship. Make the following changes to your `starship.lua` file as per your requirements: + +- To run a custom function right before the prompt is drawn, define a new function called `starship_preprompt_user_func`. This function receives the current prompt as a string that you can utilize. For example, to draw a rocket before the prompt, you would do + +```lua +function starship_preprompt_user_func(prompt) + print("🚀") +end + +load(io.popen('starship init cmd'):read("*a"))() +``` + +- To run a custom function right before a command is executed, define a new function called `starship_precmd_user_func`. This function receives the current commandline as a string that you can utilize. For example, to print the command that's about to be executed, you would do + +```lua +function starship_precmd_user_func(line) + print("Executing: "..line) +end + +load(io.popen('starship init cmd'):read("*a"))() +``` + +## Custom pre-prompt and pre-execution Commands in Bash + +Bash does not have a formal preexec/precmd framework like most other shells. Because of this, it is difficult to provide fully customizable hooks in `bash`. However, Starship does give you limited ability to insert your own functions into the prompt-rendering procedure: - To run a custom function right before the prompt is drawn, define a new function and then assign its name to `starship_precmd_user_func`. For example, to draw a rocket before the prompt, you would do @@ -45,7 +69,7 @@ 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 even does it by default. Starship does not do this, but it's fairly straightforward to add this functionality to `bash`, `zsh`, `cmd` or `powershell`. First, define a window title change function (identical in bash and zsh): @@ -80,6 +104,16 @@ function set_win_title(){ starship_precmd_user_func="set_win_title" ``` +For Cmd, you can change the window title using the `starship_preprompt_user_func` function. + +```lua +function starship_preprompt_user_func(prompt) + console.settitle(os.getenv('USERNAME').."@"..os.getenv('COMPUTERNAME')..": "..os.getcwd()) +end + +load(io.popen('starship init cmd'):read("*a"))() +``` + You can also set a similar output with PowerShell by creating a function named `Invoke-Starship-PreCommand`. ```powershell @@ -97,7 +131,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). -`right_format` is currently supported for the following shells: elvish, fish, zsh. +`right_format` is currently supported for the following shells: elvish, fish, zsh, xonsh, cmd. ### نموونە @@ -117,22 +151,44 @@ Produces a prompt like the following: ▶ starship on  rprompt [!] is 📦 v0.57.0 via 🦀 v1.54.0 took 17s ``` +## Continuation Prompt + +Some shells support a continuation prompt along with the normal prompt. This prompt is rendered instead of the normal prompt when the user has entered an incomplete statement (such as a single left parenthesis or quote). + +Starship can set the continuation prompt using the `continuation_prompt` option. The default prompt is `"[∙](bright-black) "`. + +Note: `continuation_prompt` should be set to a literal string without any variables. + +Note: Continuation prompts are only available in the following shells: + + - `bash` + - `zsh` + - `PowerShell` + +### نموونە + +```toml +# ~/.config/starship.toml + +# A continuation prompt that displays two filled in arrows +continuation_prompt = "▶▶" +``` ## 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: - - `تۆخ` - - `لار` - - `بنهێڵ` - - `کاڵ کراو` - - `پێچەوانە کراو` + - `bold` + - `italic` + - `underline` + - `dimmed` + - `inverted` - `bg:` - `fg:` - `` - - `هیچ` + - `none` -کە `` دیاریکەری ڕەنگێکە (لە ژێرەوە باسکراوە). `fg:` و `` لە ئێستادا هەمان شت ئەکەن، بەڵام ئەمە ڕەنگە لە داهاتووا بگۆڕێت. `inverted` ڕەنگی پاشبنەما و پێشبنەما ئەگۆڕێتەوە. ڕیزبەندی ووشەکان لە زنجیرەکەدا گرنگ نییە. +where `` is a color specifier (discussed below). `fg:` and `` 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. 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. diff --git a/docs/ckb-IR/config/README.md b/docs/ckb-IR/config/README.md index cbb7ad75c..2444e1037 100644 --- a/docs/ckb-IR/config/README.md +++ b/docs/ckb-IR/config/README.md @@ -24,13 +24,19 @@ disabled = true You can change default configuration file location with `STARSHIP_CONFIG` environment variable: ```sh -export STARSHIP_CONFIG=~/.starship/config.toml +export STARSHIP_CONFIG=~/example/non/default/path/starship.toml ``` Equivalently in PowerShell (Windows) would be adding this line to your `$PROFILE`: ```powershell -$ENV:STARSHIP_CONFIG = "$HOME\.starship\config.toml" +$ENV:STARSHIP_CONFIG = "$HOME\example\non\default\path\starship.toml" +``` + +Or for Cmd (Windows) would be adding this line to your `starship.lua`: + +```lua +os.setenv('STARSHIP_CONFIG', 'C:\\Users\\user\\example\\non\\default\\path\\starship.toml') ``` ### Logging @@ -47,6 +53,12 @@ Equivalently in PowerShell (Windows) would be adding this line to your `$PROFILE $ENV:STARSHIP_CACHE = "$HOME\AppData\Local\Temp" ``` +Or for Cmd (Windows) would be adding this line to your `starship.lua`: + +```lua +os.setenv('STARSHIP_CACHE', 'C:\\Users\\user\\AppData\\Local\\Temp') +``` + ### Terminology **Module**: A component in the prompt giving information based on contextual information from your OS. For example, the "nodejs" module shows the version of Node.js that is currently installed on your computer, if your current directory is a Node.js project. @@ -63,7 +75,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 can only contain letters, numbers and `_`. -بۆ نموونە: +For example: - `$version` is a format string with a variable named `version`. - `$git_branch$git_commit` is a format string with two variables named `git_branch` and `git_commit`. @@ -77,7 +89,7 @@ The first part, which is enclosed in a `[]`, is a [format string](#format-string In the second part, which is enclosed in a `()`, is a [style string](#style-strings). This can be used to style the first part. -بۆ نموونە: +For example: - `[on](red bold)` will print a string `on` with bold text colored red. - `[⌘ $version](bold green)` will print a symbol `⌘` followed by the content of variable `version`, with bold text colored green. @@ -100,7 +112,7 @@ Note that what styling looks like will be controlled by your terminal emulator. A conditional format string wrapped in `(` and `)` will not render if all variables inside are empty. -بۆ نموونە: +For example: - `(@$region)` will show nothing if the variable `region` is `None` or empty string, otherwise `@` followed by the value of region. - `(some text)` will always show nothing since there are no variables wrapped in the braces. @@ -425,13 +437,13 @@ By default it only changes color. If you also want to change its shape take a lo ::: ئاگادارکردنەوە -`error_symbol` is not supported on elvish and nu shell. +`error_symbol` is not supported on nu shell. ::: ::: ئاگادارکردنەوە -`vicmd_symbol` is only supported in fish and zsh. +`vicmd_symbol` is only supported in cmd, fish and zsh. ::: @@ -568,7 +580,7 @@ Bash users who need preexec-like functionality can use [rcaloras's bash_preexec ::: tip -Showing desktop notifications requires starship to be built with `rust-notify` support. You check if your starship supports notifications by running `STARSHIP_LOG=debug starship module cmd_duration -d 60000` when `show_notifications` is set to `true`. +Showing desktop notifications requires starship to be built with `notify-rust` support. You check if your starship supports notifications by running `STARSHIP_LOG=debug starship module cmd_duration -d 60000` when `show_notifications` is set to `true`. ::: @@ -713,20 +725,20 @@ format = "via [🔰 $version](bold red) " ## Deno The `deno` module shows you your currently installed version of [Deno](https://deno.land/). By default the module will be shown if any of the following conditions are met: -- The current directory contains a `mod.ts`, `mod.js`, `deps.ts` or `deps.js` file +- The current directory contains a `deno.json`, `deno.jsonc`, `mod.ts`, `mod.js`, `deps.ts` or `deps.js` file ### Options -| Option | Default | Description | -| ------------------- | -------------------------------------------- | ------------------------------------------------------------------------- | -| `format` | `"via [$symbol($version )]($style)"` | The format for the module. | -| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | -| `symbol` | `"🦕 "` | A format string representing the symbol of Deno | -| `detect_extensions` | `[]` | Which extensions should trigger this module. | -| `detect_files` | `["mod.ts", "mod.js", "deps.ts", "deps.js"]` | Which filenames should trigger this module. | -| `detect_folders` | `[]` | Which folders should trigger this module. | -| `style` | `"green bold"` | The style for the module. | -| `disabled` | `false` | Disables the `deno` module. | +| Option | Default | Description | +| ------------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `format` | `"via [$symbol($version )]($style)"` | The format for the module. | +| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | +| `symbol` | `"🦕 "` | A format string representing the symbol of Deno | +| `detect_extensions` | `[]` | Which extensions should trigger this module. | +| `detect_files` | `["deno.json", "deno.jsonc", "mod.ts", "mod.js", "deps.ts", "deps.js"]` | Which filenames should trigger this module. | +| `detect_folders` | `[]` | Which folders should trigger this module. | +| `style` | `"green bold"` | The style for the module. | +| `disabled` | `false` | Disables the `deno` module. | ### Variables @@ -755,18 +767,19 @@ For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, an ### Options -| Option | Default | Description | -| ------------------- | -------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `truncation_length` | `3` | The number of parent folders that the current directory should be truncated to. | -| `truncate_to_repo` | `true` | Whether or not to truncate to the root of the git repo that you're currently in. | -| `format` | `"[$path]($style)[$read_only]($read_only_style) "` | The format for the module. | -| `style` | `"bold cyan"` | The style for the module. | -| `disabled` | `false` | Disables the `directory` module. | -| `read_only` | `"🔒"` | The symbol indicating current directory is read only. | -| `read_only_style` | `"red"` | The style for the read only symbol. | -| `truncation_symbol` | `""` | The symbol to prefix to truncated paths. eg: "…/" | -| `repo_root_style` | `None` | The style for the root of the git repo when `truncate_to_repo` option is set to false. | -| `home_symbol` | `"~"` | The symbol indicating home directory. | +| Option | Default | Description | +| ------------------- | -------------------------------------------------- | --------------------------------------------------------------------------------------- | +| `truncation_length` | `3` | The number of parent folders that the current directory should be truncated to. | +| `truncate_to_repo` | `true` | Whether or not to truncate to the root of the git repo that you're currently in. | +| `format` | `"[$path]($style)[$read_only]($read_only_style) "` | The format for the module. | +| `style` | `"bold cyan"` | The style for the module. | +| `disabled` | `false` | Disables the `directory` module. | +| `read_only` | `"🔒"` | The symbol indicating current directory is read only. | +| `read_only_style` | `"red"` | The style for the read only symbol. | +| `truncation_symbol` | `""` | The symbol to prefix to truncated paths. eg: "…/" | +| `repo_root_style` | `None` | The style for the root of the git repo when `truncate_to_repo` option is set to false. | +| `home_symbol` | `"~"` | The symbol indicating home directory. | +| `use_os_path_sep` | `true` | Use the OS specific path seperator instead of always using `/` (e.g. `\` on Windows) |
This module has a few advanced configuration options that control how the directory is displayed. @@ -1334,22 +1347,23 @@ The `git_status` module shows symbols representing the state of the repo in your ### Options -| Option | Default | Description | -| ------------ | ----------------------------------------------- | ----------------------------------- | -| `format` | `'([\[$all_status$ahead_behind\]]($style) )'` | The default format for `git_status` | -| `conflicted` | `"="` | This branch has merge conflicts. | -| `ahead` | `"⇡"` | The format of `ahead` | -| `behind` | `"⇣"` | The format of `behind` | -| `diverged` | `"⇕"` | The format of `diverged` | -| `up_to_date` | `""` | The format of `up_to_date` | -| `untracked` | `"?"` | The format of `untracked` | -| `stashed` | `"$"` | The format of `stashed` | -| `modified` | `"!"` | The format of `modified` | -| `staged` | `"+"` | The format of `staged` | -| `renamed` | `"»"` | The format of `renamed` | -| `deleted` | `"✘"` | The format of `deleted` | -| `style` | `"bold red"` | The style for the module. | -| `disabled` | `false` | Disables the `git_status` module. | +| Option | Default | Description | +| ------------------- | ----------------------------------------------- | ----------------------------------- | +| `format` | `'([\[$all_status$ahead_behind\]]($style) )'` | The default format for `git_status` | +| `conflicted` | `"="` | This branch has merge conflicts. | +| `ahead` | `"⇡"` | The format of `ahead` | +| `behind` | `"⇣"` | The format of `behind` | +| `diverged` | `"⇕"` | The format of `diverged` | +| `up_to_date` | `""` | The format of `up_to_date` | +| `untracked` | `"?"` | The format of `untracked` | +| `stashed` | `"$"` | The format of `stashed` | +| `modified` | `"!"` | The format of `modified` | +| `staged` | `"+"` | The format of `staged` | +| `renamed` | `"»"` | The format of `renamed` | +| `deleted` | `"✘"` | The format of `deleted` | +| `style` | `"bold red"` | The style for the module. | +| `ignore_submodules` | `false` | Ignore changes to submodules. | +| `disabled` | `false` | Disables the `git_status` module. | ### Variables @@ -1513,10 +1527,10 @@ The `hostname` module shows the system hostname. ### Variables -| گۆڕاو | نموونە | Description | -| --------- | ------ | ------------------------------------ | -| symbol | | Mirrors the value of option `symbol` | -| style\* | | Mirrors the value of option `style` | +| گۆڕاو | نموونە | Description | +| --------- | ---------- | ----------------------------------- | +| hostname | `computer` | The hostname of the computer | +| style\* | | Mirrors the value of option `style` | \*: This variable can only be used as a part of a style string @@ -2133,7 +2147,7 @@ symbol = "☁️ " ## Package Version -The `package` module is shown when the current directory is the repository for a package, and shows its current version. The module currently supports `npm`, `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`, `shards` and `dart` packages. - [**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 @@ -2150,6 +2164,7 @@ The `package` module is shown when the current directory is the repository for a - [**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 - [**SBT**](https://scala-sbt.org) - The `sbt` package version is extracted from the `build.sbt` present in the current directory +- [**Dart**](https://pub.dev/) - The `dart` package version is extracted from the `pubspec.yaml` 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. @@ -2673,6 +2688,8 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y | `elvish_indicator` | `esh` | A format string used to represent elvish. | | `tcsh_indicator` | `tsh` | A format string used to represent tcsh. | | `xonsh_indicator` | `xsh` | A format string used to represent xonsh. | +| `cmd_indicator` | `cmd` | A format string used to represent cmd. | +| `nu_indicator` | `nu` | A format string used to represent nu. | | `unknown_indicator` | | The default value to be displayed when the shell is unknown. | | `format` | `"[$indicator]($style) "` | The format for the module. | | `style` | `"white bold"` | The style for the module. | @@ -2778,7 +2795,7 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y ::: -::: warning This module is not supported on elvish and nu shell. ::: +::: warning This module is not supported on nu shell. ::: ### Options @@ -2804,6 +2821,7 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y | گۆڕاو | نموونە | Description | | -------------- | ------- | ------------------------------------------------------------------------------------------- | | status | `127` | The exit code of the last command | +| hex_status | `0x7F` | The exit code of the last command in hex | | int | `127` | The exit code of the last command | | common_meaning | `ERROR` | Meaning of the code if not a signal | | signal_number | `9` | Signal number corresponding to the exit code, only if signalled | diff --git a/docs/ckb-IR/faq/README.md b/docs/ckb-IR/faq/README.md index 955e95572..3c0b411fb 100644 --- a/docs/ckb-IR/faq/README.md +++ b/docs/ckb-IR/faq/README.md @@ -69,13 +69,13 @@ If you see symbols that you don't recognise you can use `starship explain` to ex You can enable the debug logs by using the `STARSHIP_LOG` env var. These logs can be very verbose so it is often useful to use the `module` command if you are trying to debug a particular module, for example, if you are trying to debug the `rust` module you could run the following command to get the trace logs and output from the module. ```sh -env STARHIP_LOG=trace starship module rust +env STARSHIP_LOG=trace starship module rust ``` If starship is being slow you can try using the `timings` command to see if there is a particular module or command that to blame. ```sh -env STARHIP_LOG=trace starship timings +env STARSHIP_LOG=trace starship timings ``` This will output the trace log and a breakdown of all modules that either took more than 1ms to execute or produced some output. @@ -118,5 +118,5 @@ If Starship was installed using the install script, the following command will d ```sh # Locate and delete the starship binary -sh -c 'rm "$(which starship)"' +sh -c 'rm "$(command -v 'starship')"' ``` diff --git a/docs/ckb-IR/guide/README.md b/docs/ckb-IR/guide/README.md index efb446f20..d32245c9a 100644 --- a/docs/ckb-IR/guide/README.md +++ b/docs/ckb-IR/guide/README.md @@ -68,6 +68,22 @@ height="20" src="https://raw.githubusercontent.com/starship/starship/master/media/flag-fr.png" alt="Français" + /> +   + Bahasa Indonesia +   + Italiano   پورتوگالیی بەڕازیل   @@ -119,7 +119,7 @@ description: Starship ist eine minimale, super schnelle, und extrem anpassbare P #### Elvish - ::: warning Nur elvish v0.15 oder höher ist unterstützt. ::: + ::: warning Only elvish v0.17 or higher is supported. ::: Trage folgendes am Ende von `~/.config/fish/rc.elv` ein: @@ -164,3 +164,14 @@ description: Starship ist eine minimale, super schnelle, und extrem anpassbare P execx($(starship init xonsh)) ``` + + + #### Cmd + + You need to use [Clink](https://chrisant996.github.io/clink/clink.html) (v1.2.30+) with Cmd. Add the following to a file `starship.lua` and place this file in Clink scripts directory: + + ```lua + -- starship.lua + + load(io.popen('starship init cmd'):read("*a"))() + ``` diff --git a/docs/de-DE/advanced-config/README.md b/docs/de-DE/advanced-config/README.md index ed4825039..6d9c68fe6 100644 --- a/docs/de-DE/advanced-config/README.md +++ b/docs/de-DE/advanced-config/README.md @@ -8,11 +8,35 @@ Die hier beschriebenen Konfigurationen werden sich mit kommenden Updates von Sta ::: -## Benutzerdefinierte Pre-Prompt- und Pre-Execution-Befehle in der Bash +## Custom pre-prompt and pre-execution Commands in Cmd -Die Bash Shell hat, im Gegensatz zu vielen anderen Shells, kein konventionelles preexec/precmd Framework. Daher gestaltet es sich schwierig, vollständig anpassbare Hooks für `bash` anzubieten. Starship bietet daher die begrenzte Möglichkeit, eigene Funktionen in das prompt rendering Verfahren einzufügen: +Clink provides extremely flexible APIs to run pre-prompt and pre-exec commands in Cmd shell. It is fairly simple to use with Starship. Make the following changes to your `starship.lua` file as per your requirements: -- Um eine benutzerdefinierte Funktion kurz vor Anzeige der Eingabeaufforderung auszuführen, definiere eine neue Funktion und weise den Namen `starship_precmd_user_func` zu. Um beispielsweise eine Rakete anzuzeigen, bevor die Eingabeaufforderung erscheint, würde man folgendes tun +- To run a custom function right before the prompt is drawn, define a new function called `starship_preprompt_user_func`. This function receives the current prompt as a string that you can utilize. For example, to draw a rocket before the prompt, you would do + +```lua +function starship_preprompt_user_func(prompt) + print("🚀") +end + +load(io.popen('starship init cmd'):read("*a"))() +``` + +- To run a custom function right before a command is executed, define a new function called `starship_precmd_user_func`. This function receives the current commandline as a string that you can utilize. For example, to print the command that's about to be executed, you would do + +```lua +function starship_precmd_user_func(line) + print("Executing: "..line) +end + +load(io.popen('starship init cmd'):read("*a"))() +``` + +## Custom pre-prompt and pre-execution Commands in Bash + +Bash does not have a formal preexec/precmd framework like most other shells. Because of this, it is difficult to provide fully customizable hooks in `bash`. Starship bietet daher die begrenzte Möglichkeit, eigene Funktionen in das prompt rendering Verfahren einzufügen: + +- To run a custom function right before the prompt is drawn, define a new function and then assign its name to `starship_precmd_user_func`. For example, to draw a rocket before the prompt, you would do ```bash function blastoff(){ @@ -21,13 +45,13 @@ function blastoff(){ starship_precmd_user_func="blastoff" ``` -- Um eine benutzerdefinierte Funktion direkt vor der Ausführung eines Befehls auszulösen, kann man den [`DEBUG` trap](https://jichu4n.com/posts/debug-trap-and-prompt_command-in-bash/) Mechanismus verwenden. Allerdings **muss** das DEBUG Signal *vor* der Initialisierung von Starship getrapped werden! Starship kann den Wert der DEBUG-trap speichern. Wenn der Wert der DEBUG-trap überschrieben wird nachdem Starship gestartet ist kann es zu Fehlern im Bezug auf die verwendete DEBUG-trap kommen. +- To run a custom function right before a command runs, you can use the [`DEBUG` trap mechanism](https://jichu4n.com/posts/debug-trap-and-prompt_command-in-bash/). However, you **must** trap the DEBUG signal *before* initializing Starship! Starship can preserve the value of the DEBUG trap, but if the trap is overwritten after starship starts up, some functionality will break. ```bash function blastoff(){ echo "🚀" } -trap blastoff DEBUG # DEBUG-Trap *bevor* Starship läuft +trap blastoff DEBUG # Trap DEBUG *before* running starship eval $(starship init bash) ``` @@ -43,27 +67,27 @@ function Invoke-Starship-PreCommand { } ``` -## Fenstertitel anpassen +## Change Window Title -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. +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`, `zsh`, `cmd` or `powershell`. -Zuerst wird eine Funktion definiert um den Fenstertitel zu ändern ( für bash und zsh ist die Funktion identisch): +First, define a window title change function (identical in bash and zsh): ```bash function set_win_title(){ - echo -ne "\033]0; DEIN_FENSTERTITEL_HIER \007" + echo -ne "\033]0; YOUR_WINDOW_TITLE_HERE \007" } ``` -Sie können Variablen verwenden, um diesen Titel anzupassen (`$USER`, `$HOSTNAME`, `$PWD`). +You can use variables to customize this title (`$USER`, `$HOSTNAME`, and `$PWD` are popular choices). -Für `bash` muss die Funktion als "precmd starship"-Funktion gesetzt werden: +In `bash`, set this function to be the precmd starship function: ```bash starship_precmd_user_func="set_win_title" ``` -Füge dies in `Zsh` zum `precmd_functions`-Array hinzu: +In `zsh`, add this to the `precmd_functions` array: ```bash precmd_functions+=(set_win_title) @@ -71,7 +95,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. -Zum Beispiel, wenn sie ihr aktuelles Verzeichnis als Terminal Title anzeigen wollen, fügen Sie folgenden Code-Schnipsel zu ihrer `~/.bashrc` oder `~/.zshrc` hinzu: +For example, if you want to display your current directory in your terminal tab title, add the following snippet to your `~/.bashrc` or `~/.zshrc`: ```bash function set_win_title(){ @@ -80,6 +104,16 @@ function set_win_title(){ starship_precmd_user_func="set_win_title" ``` +For Cmd, you can change the window title using the `starship_preprompt_user_func` function. + +```lua +function starship_preprompt_user_func(prompt) + console.settitle(os.getenv('USERNAME').."@"..os.getenv('COMPUTERNAME')..": "..os.getcwd()) +end + +load(io.popen('starship init cmd'):read("*a"))() +``` + You can also set a similar output with PowerShell by creating a function named `Invoke-Starship-PreCommand`. ```powershell @@ -97,7 +131,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). -`right_format` is currently supported for the following shells: elvish, fish, zsh. +`right_format` is currently supported for the following shells: elvish, fish, zsh, xonsh, cmd. ### Beispiel @@ -117,10 +151,32 @@ Produces a prompt like the following: ▶ starship on  rprompt [!] is 📦 v0.57.0 via 🦀 v1.54.0 took 17s ``` +## Continuation Prompt + +Some shells support a continuation prompt along with the normal prompt. This prompt is rendered instead of the normal prompt when the user has entered an incomplete statement (such as a single left parenthesis or quote). + +Starship can set the continuation prompt using the `continuation_prompt` option. The default prompt is `"[∙](bright-black) "`. + +Note: `continuation_prompt` should be set to a literal string without any variables. + +Note: Continuation prompts are only available in the following shells: + + - `bash` + - `zsh` + - `PowerShell` + +### Beispiel + +```toml +# ~/.config/starship.toml + +# A continuation prompt that displays two filled in arrows +continuation_prompt = "▶▶" +``` ## Style-Strings -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: +Style strings are a list of words, separated by whitespace. The words are not case sensitive (i.e. `bold` and `BoLd` are considered the same string). Each word can be one of the following: - `bold` - `italic` @@ -132,14 +188,14 @@ Style-String sind Wortlisten, getrennt durch Leerzeichen. Die Wörter haben kein - `` - `none` -wobei `` eine Farbspezifikation ist (siehe unten). `fg:` and `` 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. +where `` is a color specifier (discussed below). `fg:` and `` 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. -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. +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. -Eine Farbspezifikation kann wie folgt aussehen: +A color specifier can be one of the following: - - 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 Zahl zwischen 0-255. Dies ergibt einen [8-bit ANSI-Farbcode](https://i.stack.imgur.com/KTSQa.png). + - One of the standard terminal colors: `black`, `red`, `green`, `blue`, `yellow`, `purple`, `cyan`, `white`. You can optionally prefix these with `bright-` to get the bright version (e.g. `bright-white`). + - A `#` followed by a six-digit hexadecimal number. This specifies an [RGB color hex code](https://www.w3schools.com/colors/colors_hexadecimal.asp). + - A number between 0-255. This specifies an [8-bit ANSI Color Code](https://i.stack.imgur.com/KTSQa.png). -Wenn mehrere Farben für Vordergrund oder Hintergrund angegeben werden, hat die letzte Farbe der Zeichenkette Priorität. +If multiple colors are specified for foreground/background, the last one in the string will take priority. diff --git a/docs/de-DE/config/README.md b/docs/de-DE/config/README.md index c2072c507..ca2d0c12a 100644 --- a/docs/de-DE/config/README.md +++ b/docs/de-DE/config/README.md @@ -1,6 +1,6 @@ # Konfiguration -Um mit der Konfiguration von Starship zu beginnen, musst du die folgende Datei erstellen: `~/.config/starship.toml`. +Um mit der Konfiguration von Starship zu beginnen, muss eine leere Datei in diesem Pfad erstellt werden: `~/.config/starship.toml`. ```sh mkdir -p ~/.config && touch ~/.config/starship.toml @@ -21,49 +21,61 @@ success_symbol = "[➜](bold green)" # Das "succes_symbol" Segment wird zu " disabled = true ``` -Du kannst die voreingestellte Konfigurations-Datei mit der `STARSHIP_CONFIG` Umgebungsvariable verändern: +Die voreingestellte Konfigurations-Datei kann mit der `STARSHIP_CONFIG` Umgebungsvariable verändert werden. Hier z. Bsp. für die BASH shell, hinzuzufügen zur ~/. bashrc: ```sh -export STARSHIP_CONFIG=~/.starship/config.toml +export STARSHIP_CONFIG=~/example/non/default/path/starship.toml ``` -Äquivalent zur PowerShell (Windows) würdest du diese Zeile zu `$PROFILE` hinzufügen: +Für die Windows PowerShell diese Zeile zum `$PROFILE` hinzufügen: ```powershell -$ENV:STARSHIP_CONFIG = "$HOME\.starship\config.toml" +$ENV:STARSHIP_CONFIG = "$HOME\example\non\default\path\starship.toml" +``` + +Or for Cmd (Windows) would be adding this line to your `starship.lua`: + +```lua +os.setenv('STARSHIP_CONFIG', 'C:\\Users\\user\\example\\non\\default\\path\\starship.toml') ``` ### Protokollierung -Standardmäßig protokolliert Starship Warnungen und Fehler in einer Datei names `~/.cache/starship/session_${STARSHIP_SESSION_KEY}.log`, wobei der session key zu der Instanz deines Terminals korrespondiert. Das kann jedoch durch die Nutzung der `STARSHIP_CACHE` Umgebungsvariable verändert werden: +By default starship logs warnings and errors into a file named `~/.cache/starship/session_${STARSHIP_SESSION_KEY}.log`, where the session key is corresponding to a instance of your terminal. This, however can be changed using the `STARSHIP_CACHE` environment variable: ```sh export STARSHIP_CACHE=~/.starship/cache ``` -Äquivalent zur PowerShell (Windows) würdest du diese Zeile zu `$PROFILE` hinzufügen: +Für die Windows PowerShell diese Zeile zum `$PROFILE` hinzufügen: ```powershell $ENV:STARSHIP_CACHE = "$HOME\AppData\Local\Temp" ``` +Or for Cmd (Windows) would be adding this line to your `starship.lua`: + +```lua +os.setenv('STARSHIP_CACHE', 'C:\\Users\\user\\AppData\\Local\\Temp') +``` + ### Terminologie -**Modul**: Eine Komponente in der Eingabeaufforderung, welche Informationen basierend auf Kontextinformationen deines Betriebssystems angibt. Beispielsweise zeigt das "nodejs" Module die Version von Node.js, welches derzeitig auf deinem Computer installiert ist, an, falls dein derzeitiger Ordner ein Node.js Projekt ist. +**Module**: A component in the prompt giving information based on contextual information from your OS. For example, the "nodejs" module shows the version of Node.js that is currently installed on your computer, if your current directory is a Node.js project. -**Variable**: Eine kleinere Unterkomponente, welche Information des Moduls enthält. Zum Beispiel enthält die Variable "version" im Modul "nodejs" die aktuelle Version von Node.js. +**Variable**: Smaller sub-components that contain information provided by the module. For example, the "version" variable in the "nodejs" module contains the current version of Node.js. -Die meisten Module haben einen Präfix der standardmäßigen terminal-Farbe (z.B. `via` in "nodejs") und ein Leerzeichen als Suffix. +By convention, most modules have a prefix of default terminal color (e.g. `via` in "nodejs") and an empty space as a suffix. ### Formatierte Strings -Formatierte Strings sind das Format, mit dem ein Modul all seine Variablen ausgibt. Die meisten Module haben den Eintrag `format`, welcher das anzeige-Format des Moduls konfiguriert. Du kannst Texte, Variablen und Textgruppen in einem formatierten string benutzen. +Format strings are the format that a module prints all its variables with. Most modules have an entry called `format` that configures the display format of the module. You can use texts, variables and text groups in a format string. #### Variable -Eine Variable besteht aus dem `$` Symbol und dem Namen der Variable. The name of a variable can only contain 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 `_`. -Hier sind ein paar Beispiele: +For example: - `$version` ist ein formatierter string mit dem Namen `version`. - `$git_branch$git_commit` ist ein formatierter string mit zwei Variablen, nämlich `git_branch` und `git_commit`. @@ -71,13 +83,13 @@ Hier sind ein paar Beispiele: #### Textgruppe -Eine Textgruppe besteht aus zwei verschiedenen Teilen. +A text group is made up of two different parts. -Der erste Teil, welcher innerhalb eckiger Klammern `[]` ist, ist ein [formatierter string](#format-strings). Du kannst ihm Texte, Variablen oder sogar verschachtelte Textgruppen hinzufügen. +The first part, which is enclosed in a `[]`, is a [format string](#format-strings). You can add texts, variables, or even nested text groups in it. -Der zweite Teil ist innerhalb normaler Klammern `()` und ist ein[style string](#style-strings). Dies kann verwendet werden, um den ersten Teil zu gestalten. +In the second part, which is enclosed in a `()`, is a [style string](#style-strings). This can be used to style the first part. -Hier sind ein paar Beispiele: +For example: - `[on](red bold)` wird einen string `on` mit fettgedrucktem roten Text ausgeben. - `[⌘ $version](bold green)` wird ein Symbol `⌘` gefolgt von dem Inhalt der Variable `version` mit fettgedrucktem grünen Text ausgeben. @@ -85,7 +97,7 @@ Hier sind ein paar Beispiele: #### Style-Strings -Die meisten Module in Starship lassen dich den Darstellungsstil verändern. Dies passiert meistens an einem bestimmten Eintrag (gewöhnlich `style` genannt), der einen String mit den Einstellungen darstellt. Es folgen ein paar Beispiele für solche Strings zusammen der mit Beschreibungen, was sie bewirken. Details zur vollen Syntax findest du im [Erweiterten Konfigurationshandbuch](/advanced-config/). +Most modules in starship allow you to configure their display styles. This is done with an entry (usually called `style`) which is a string specifying the configuration. Here are some examples of style strings along with what they do. For details on the full syntax, consult the [advanced config guide](/advanced-config/). - `"fg:green bg:blue"` setzt grünen Text auf einem blauen Hintergrund - `"bg:blue fg:bright-green"` setzt hell-grünen Text auf einen blauen Hintergrund @@ -94,19 +106,19 @@ Die meisten Module in Starship lassen dich den Darstellungsstil verändern. Dies - `"bold italic fg:purple"` setzt lilane fett-kursive Schrift - `""` deaktiviert explizit jeden Stil -Wie genau sich diese Konfiguration auswirkt liegt an deinem Terminal-Emulator. Einige Emulatoren zum Beispiel werden die Farben erhellen statt Text dick zu machen, und ein paar Farbthemen benutzen dieselben Werte für normale und helle Farben. Für kursiven Text muss dein Terminal Kursivschrift unterstützen. +Note that what styling looks like will be controlled by your terminal emulator. For example, some terminal emulators will brighten the colors instead of bolding text, and some color themes use the same values for the normal and bright colors. Also, to get italic text, your terminal must support italics. -#### Conditional Format Strings +#### Bedingte Formatierung A conditional format string wrapped in `(` and `)` will not render if all variables inside are empty. -Hier sind ein paar Beispiele: +For example: -- `(@$region)` will show nothing if the variable `region` is `None` or empty string, otherwise `@` followed by the value of region. -- `(some text)` will always show nothing since there are no variables wrapped in the braces. -- When `$all` is a shortcut for `\[$a$b\]`, `($all)` will show nothing only if `$a` and `$b` are both `None`. This works the same as `(\[$a$b\] )`. +- `(@$region)` ist die Variable `region` undefiniert (`None`) oder eine leere Zeichenkette (`""`) dann wird nichts angezeigt, ansonsten <0>@ gefolgt von dem Inhalt der Variablen. +- `(some text)` zeigt nichts an, weil der Text in Klammern keine Variablen enthält. +- Wenn `$all` eine Abkürzung für `\[$a$b\]` ist, dann zeigt `($all)` nur nichts an wenn `$a` and `$b` beide undefiniert (`None`) sind. Dasselbe passiert mit `(\[$a$b\] )`. -#### Special characters +#### Spezielle Zeichen The following symbols have special usage in a format string and must be escaped: `$ \ [ ] ( )`. @@ -131,17 +143,17 @@ format = ''' ## Prompt -Dies ist eine Liste mit Prompt-weiten Konfigurationsoptionen. +This is the list of prompt-wide configuration options. ### Optionen -| Option | Standardwert | Beschreibung | -| ----------------- | ------------------------------ | ---------------------------------------------------------------- | -| `format` | [link](#default-prompt-format) | Configure the format of the prompt. | -| `right_format` | `""` | See [Enable Right Prompt](/advanced-config/#enable-right-prompt) | -| `scan_timeout` | `30` | Timeout für das Scannen von Dateien (in Millisekunden). | -| `command_timeout` | `500` | Timeout for commands executed by starship (in milliseconds). | -| `add_newline` | `true` | Inserts blank line between shell prompts. | +| Option | Standardwert | Beschreibung | +| ----------------- | ------------------------------ | ----------------------------------------------------------------- | +| `format` | [link](#default-prompt-format) | Das Aussehen des Prompts festlegen. | +| `right_format` | `""` | Sieh [Enable Right Prompt](/advanced-config/#enable-right-prompt) | +| `scan_timeout` | `30` | Timeout für das Scannen von Dateien (in Millisekunden). | +| `command_timeout` | `500` | Maximale Zeit für von Starship ausgeführte Kommandos. | +| `add_newline` | `true` | Fügt leere Zeilen zwischen Shell Prompts ein. | ### Beispiel @@ -149,22 +161,22 @@ Dies ist eine Liste mit Prompt-weiten Konfigurationsoptionen. ```toml # ~/.config/starship.toml -# Verwende benutzerdefiniertes Format +# Use custom format format = """ [┌───────────────────>](bold green) [│](bold green)$directory$rust$package [└─>](bold green) """ -# Warte 10 Millisekunden damit Starship die Dateien im aktuellen Ordner überprüfen kann. +# Wait 10 milliseconds for starship to check files under the current directory. scan_timeout = 10 -# Deaktiviere die Leerzeile am Anfang der Eingabeaufforderung +# Disable the blank line at the start of the prompt add_newline = false ``` -### Default Prompt Format +### Vordefiniertes Aussehen des Prompts -The default `format` is used to define the format of the prompt, if empty or no `format` is provided. Die Standardwerte sind folgende: +The default `format` is used to define the format of the prompt, if empty or no `format` is provided. The default is as shown: ```toml format = "$all" @@ -248,7 +260,7 @@ format="$all$directory$character" ## AWS -Das `aws`-Modul zeigt das aktuelle AWS-Profil an. Dies basiert auf den Umgebungsvariablen: `AWS_REGION`, `AWS_DEFAULT_REGION`, `AWS_PROFILE` und der `~/.aws/config` Datei. This module also shows an expiration timer when using temporary credentials. +The `aws` module shows the current AWS region and profile. This is based on `AWS_REGION`, `AWS_DEFAULT_REGION`, and `AWS_PROFILE` env var with `~/.aws/config` file. This module also shows an expiration timer when using temporary credentials. When using [aws-vault](https://github.com/99designs/aws-vault) the profile is read from the `AWS_VAULT` env var and the credentials expiration date is read from the `AWS_SESSION_EXPIRATION` env var. @@ -347,7 +359,7 @@ style = "blue bold" ## Akkustand -Das `battery` Modul zeigt, wie hoch der Akku des Geräts geladen ist und den aktuellen Ladestatus. Das Modul ist nur sichtbar, wenn der Akku des Geräts unter 10% geladen ist. +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%. ### Optionen @@ -375,7 +387,7 @@ discharging_symbol = "💀 " ### Anzeige des Akkustandes -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). Wenn `display` nicht angegeben ist. Die Standardwerte sind folgende: +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. The default is as shown: ```toml [[battery.display]] @@ -387,7 +399,7 @@ The default value for the `charging_symbol` and `discharging_symbol` option is r #### Optionen -Die `display`-Option beinhaltet ein Array mit den folgenden Werten. +The `display` option is an array of the following table. | Option | Standardwert | Beschreibung | | -------------------- | ------------ | --------------------------------------------------------------------------------------------------------- | @@ -414,9 +426,9 @@ discharging_symbol = "💦" ## Zeichen -Das `character` Modul zeigt ein Zeichen ( meistens einen Pfeil "❯") vor der Texteingabe an. +The `character` module shows a character (usually an arrow) beside where the text is entered in your terminal. -Das Zeichen zeigt an ob der letzte Befehl erfolgreich war, oder einen Fehler erzeugt hat. 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 shape (`❯`/`✖`) @@ -425,13 +437,13 @@ By default it only changes color. If you also want to change its shape take a lo ::: Warnung -`error_symbol` is not supported on elvish and nu shell. +`error_symbol` is not supported on nu shell. ::: ::: Warnung -`vicmd_symbol` is only supported in fish and zsh. +`vicmd_symbol` is only supported in cmd, fish and zsh. ::: @@ -544,15 +556,15 @@ The `cobol` module shows the currently installed version of COBOL. By default, t ## Befehlsdauer -Das `cmd_duration` Modul zeigt an wie lange der letzte Befehl ausgeführt wurde. Das Modul wird nur angezeigt wenn der letzte Befehl länger als zwei Sekunden ausgeführt wurde. Mit der `min_time` Option kann die Zeit eingestellt werden ab der <0>cmd_duration angezeigt wird. +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 Nicht die DEBUG-trap in der Bash hooken +::: warning Do not hook the DEBUG trap in Bash -Ist `bash` die Konsole der Wahl, dann nicht die `DEBUG`-trap nach der Ausführung von `eval $(starship init $0)` hooken, andernfalls **wird** dieses Modul unweigerlich untergehen. +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 Nutzer, die eine "preexec" ähnliche Funktion benötigen, können [rcaloras bash_preexec Framework](https://github.com/rcaloras/bash-preexec) verwenden. Definieren Sie einfach die Arrays `preexec_functions` und `precmd_functions` bevor sie `eval $(starship init $0)` ausführen, und fahren Sie dann wie gewohnt fort. +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. ### Optionen @@ -568,7 +580,7 @@ Bash Nutzer, die eine "preexec" ähnliche Funktion benötigen, können [rcaloras ::: tip -Showing desktop notifications requires starship to be built with `rust-notify` support. You check if your starship supports notifications by running `STARSHIP_LOG=debug starship module cmd_duration -d 60000` when `show_notifications` is set to `true`. +Showing desktop notifications requires starship to be built with `notify-rust` support. You check if your starship supports notifications by running `STARSHIP_LOG=debug starship module cmd_duration -d 60000` when `show_notifications` is set to `true`. ::: @@ -597,7 +609,7 @@ The `conda` module shows the current [Conda](https://docs.conda.io/en/latest/) e ::: tip -Hinweis: Dies unterdrückt nicht conda's eigenen Prompt-Modifikator, sie können jedoch conda mit `conda config --set changeps1 False` konfigurieren, um die Ausgabe von conda selbst auszuschalten. +This does not suppress conda's own prompt modifier, you may want to run `conda config --set changeps1 False`. ::: @@ -713,20 +725,20 @@ format = "via [🔰 $version](bold red) " ## Deno The `deno` module shows you your currently installed version of [Deno](https://deno.land/). By default the module will be shown if any of the following conditions are met: -- The current directory contains a `mod.ts`, `mod.js`, `deps.ts` or `deps.js` file +- The current directory contains a `deno.json`, `deno.jsonc`, `mod.ts`, `mod.js`, `deps.ts` or `deps.js` file ### Optionen -| Option | Standardwert | Beschreibung | -| ------------------- | -------------------------------------------- | ------------------------------------------------------------------------- | -| `format` | `"via [$symbol($version )]($style)"` | Das Format für das Modul. | -| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | -| `symbol` | `"🦕 "` | A format string representing the symbol of Deno | -| `detect_extensions` | `[]` | Which extensions should trigger this module. | -| `detect_files` | `["mod.ts", "mod.js", "deps.ts", "deps.js"]` | Which filenames should trigger this module. | -| `detect_folders` | `[]` | Which folders should trigger this module. | -| `style` | `"green bold"` | Stil für dieses Modul. | -| `disabled` | `false` | Disables the `deno` module. | +| Option | Standardwert | Beschreibung | +| ------------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `format` | `"via [$symbol($version )]($style)"` | Das Format für das Modul. | +| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | +| `symbol` | `"🦕 "` | A format string representing the symbol of Deno | +| `detect_extensions` | `[]` | Which extensions should trigger this module. | +| `detect_files` | `["deno.json", "deno.jsonc", "mod.ts", "mod.js", "deps.ts", "deps.js"]` | Which filenames should trigger this module. | +| `detect_folders` | `[]` | Which folders should trigger this module. | +| `style` | `"green bold"` | Stil für dieses Modul. | +| `disabled` | `false` | Disables the `deno` module. | ### Variables @@ -747,7 +759,7 @@ format = "via [🦕 $version](green bold) " ## Verzeichnis -Das `directory` -Modul zeigt den Pfad zu Ihrem aktuellen Verzeichnis an, abgeschnitten auf drei übergeordnete Ordner. Your directory will also be truncated to the root of the git repo that you're currently in. +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. 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. @@ -755,21 +767,22 @@ For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, an ### Optionen -| Option | Standardwert | Beschreibung | -| ------------------- | -------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `truncation_length` | `3` | Die Anzahl der übergeordneten Ordner, die angezeigt werden. | -| `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) "` | Das Format für das Modul. | -| `style` | `"bold cyan"` | Stil für dieses Modul. | -| `disabled` | `false` | Deaktiviert das `directory`-Modul. | -| `read_only` | `"🔒"` | The symbol indicating current directory is read only. | -| `read_only_style` | `"red"` | The style for the read only symbol. | -| `truncation_symbol` | `""` | The symbol to prefix to truncated paths. eg: "…/" | -| `repo_root_style` | `None` | The style for the root of the git repo when `truncate_to_repo` option is set to false. | -| `home_symbol` | `"~"` | The symbol indicating home directory. | +| Option | Standardwert | Beschreibung | +| ------------------- | -------------------------------------------------- | --------------------------------------------------------------------------------------- | +| `truncation_length` | `3` | Die Anzahl der übergeordneten Ordner, die angezeigt werden. | +| `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) "` | Das Format für das Modul. | +| `style` | `"bold cyan"` | Stil für dieses Modul. | +| `disabled` | `false` | Deaktiviert das `directory`-Modul. | +| `read_only` | `"🔒"` | The symbol indicating current directory is read only. | +| `read_only_style` | `"red"` | The style for the read only symbol. | +| `truncation_symbol` | `""` | The symbol to prefix to truncated paths. eg: "…/" | +| `repo_root_style` | `None` | The style for the root of the git repo when `truncate_to_repo` option is set to false. | +| `home_symbol` | `"~"` | The symbol indicating home directory. | +| `use_os_path_sep` | `true` | Use the OS specific path seperator instead of always using `/` (e.g. `\` on Windows) |
-Dieses Modul hat einige erweiterte Konfigurationsoptionen, welche die Darstellung von Verzeichnissen steuern. +This module has a few advanced configuration options that control how the directory is displayed. | Advanced Option | Standardwert | Beschreibung | | --------------------------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -1174,7 +1187,7 @@ asia-northeast1 = "an1" ## Git-Branch -Das `git_branch`-Modul zeigt den aktiven Git-Branch des Repositories im aktuellen Verzeichnis an. +The `git_branch` module shows the active branch of the repo in your current directory. ### Optionen @@ -1293,7 +1306,7 @@ The `git_metrics` module will show the number of added and deleted lines in the ::: tip -Dieses Modul ist standardmäßig deaktiviert. Setze in deiner Konfiguration `disabled` auf `false` um es zu aktivieren. +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: @@ -1334,22 +1347,23 @@ The `git_status` module shows symbols representing the state of the repo in your ### Optionen -| Option | Standardwert | Beschreibung | -| ------------ | ----------------------------------------------- | ----------------------------------- | -| `format` | `'([\[$all_status$ahead_behind\]]($style) )'` | The default format for `git_status` | -| `conflicted` | `"="` | This branch has merge conflicts. | -| `ahead` | `"⇡"` | The format of `ahead` | -| `behind` | `"⇣"` | The format of `behind` | -| `diverged` | `"⇕"` | The format of `diverged` | -| `up_to_date` | `""` | The format of `up_to_date` | -| `untracked` | `"?"` | The format of `untracked` | -| `stashed` | `"$"` | The format of `stashed` | -| `modified` | `"!"` | The format of `modified` | -| `staged` | `"+"` | The format of `staged` | -| `renamed` | `"»"` | The format of `renamed` | -| `deleted` | `"✘"` | The format of `deleted` | -| `style` | `"bold red"` | Stil für dieses Modul. | -| `disabled` | `false` | Deaktiviert das `git_status`-Modul. | +| Option | Standardwert | Beschreibung | +| ------------------- | ----------------------------------------------- | ----------------------------------- | +| `format` | `'([\[$all_status$ahead_behind\]]($style) )'` | The default format for `git_status` | +| `conflicted` | `"="` | This branch has merge conflicts. | +| `ahead` | `"⇡"` | The format of `ahead` | +| `behind` | `"⇣"` | The format of `behind` | +| `diverged` | `"⇕"` | The format of `diverged` | +| `up_to_date` | `""` | The format of `up_to_date` | +| `untracked` | `"?"` | The format of `untracked` | +| `stashed` | `"$"` | The format of `stashed` | +| `modified` | `"!"` | The format of `modified` | +| `staged` | `"+"` | The format of `staged` | +| `renamed` | `"»"` | The format of `renamed` | +| `deleted` | `"✘"` | The format of `deleted` | +| `style` | `"bold red"` | Stil für dieses Modul. | +| `ignore_submodules` | `false` | Ignore changes to submodules. | +| `disabled` | `false` | Disables the `git_status` module. | ### Variables @@ -1499,7 +1513,7 @@ format = "via [⎈ $version](bold white) " ## Hostname -Das `hostname`-Modul zeigt den Hostnamen des Systems an. +The `hostname` module shows the system hostname. ### Optionen @@ -1513,10 +1527,10 @@ Das `hostname`-Modul zeigt den Hostnamen des Systems an. ### Variables -| Variable | Beispiel | Beschreibung | -| --------- | -------- | ------------------------------------- | -| symbol | | Spiegelt den Wert der Option `symbol` | -| style\* | | Spiegelt den Wert der Option `style` | +| Variable | Beispiel | Beschreibung | +| --------- | ---------- | ------------------------------------ | +| hostname | `computer` | The hostname of the computer | +| style\* | | Spiegelt den Wert der Option `style` | \*: This variable can only be used as a part of a style string @@ -1722,7 +1736,7 @@ Displays the current [Kubernetes context](https://kubernetes.io/docs/concepts/co ::: tip -Dieses Modul ist standardmäßig deaktiviert. Setze in deiner Konfiguration `disabled` auf `false` um es zu aktivieren. +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: @@ -1784,7 +1798,7 @@ Long and automatically generated cluster names can be identified and shortened u ## Zeilenumbruch -Das `line_break`-Modul unterteilt den Prompt in zwei Zeilen. +The `line_break` module separates the prompt into two lines. ### Optionen @@ -1844,13 +1858,13 @@ format = "via [🌕 $version](bold blue) " ## Speicherauslastung -Das `memory_usage` Modul zeigt den aktuellen Systemspeicher und die swap-Nutzung an. +The `memory_usage` module shows current system memory and swap usage. -Standardmäßig wird die swap-Nutzung angezeigt, wenn der gesamte System-swap nicht Null ist. +By default the swap usage is displayed if the total system swap is non-zero. ::: tip -Dieses Modul ist standardmäßig deaktiviert. Setze in deiner Konfiguration `disabled` auf `false` um es zu aktivieren. +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: @@ -1969,7 +1983,7 @@ symbol = "🎣 " ## Nix-Shell -The `nix_shell` module shows the [nix-shell](https://nixos.org/guides/nix-pills/developing-with-nix-shell.html) environment. Das Modul wird angezeigt, wenn es sich in einer nix-Shell-Umgebung befindet. +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. ### Optionen @@ -2133,7 +2147,7 @@ symbol = "☁️ " ## Paketversion -Das `Package` Modul wird angezeigt, wenn das aktuelle Verzeichnis das Repository für ein Paket ist, und zeigt dessen aktuelle Version an. The module currently supports `npm`, `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`, `shards` and `dart` packages. - [**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 @@ -2150,6 +2164,7 @@ Das `Package` Modul wird angezeigt, wenn das aktuelle Verzeichnis das Repository - [**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 - [**SBT**](https://scala-sbt.org) - The `sbt` package version is extracted from the `build.sbt` present in the current directory +- [**Dart**](https://pub.dev/) - The `dart` package version is extracted from the `pubspec.yaml` present in the current directory > ⚠️ Die angezeigte Version ist die des Pakets, dessen Quellcode im Verzeichnis liegt, nicht die des Paketmanagers. @@ -2657,7 +2672,7 @@ The `shell` module shows an indicator for currently used shell. ::: tip -Dieses Modul ist standardmäßig deaktiviert. Setze in deiner Konfiguration `disabled` auf `false` um es zu aktivieren. +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: @@ -2673,6 +2688,8 @@ Dieses Modul ist standardmäßig deaktiviert. Setze in deiner Konfiguration `dis | `elvish_indicator` | `esh` | A format string used to represent elvish. | | `tcsh_indicator` | `tsh` | A format string used to represent tcsh. | | `xonsh_indicator` | `xsh` | A format string used to represent xonsh. | +| `cmd_indicator` | `cmd` | A format string used to represent cmd. | +| `nu_indicator` | `nu` | A format string used to represent nu. | | `unknown_indicator` | | The default value to be displayed when the shell is unknown. | | `format` | `"[$indicator]($style) "` | Das Format für das Modul. | | `style` | `"white bold"` | Stil für dieses Modul. | @@ -2774,11 +2791,11 @@ The `status` module displays the exit code of the previous command. The module w ::: tip -Dieses Modul ist standardmäßig deaktiviert. Setze in deiner Konfiguration `disabled` auf `false` um es zu aktivieren. +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: -::: warning This module is not supported on elvish and nu shell. ::: +::: warning This module is not supported on nu shell. ::: ### Optionen @@ -2804,6 +2821,7 @@ Dieses Modul ist standardmäßig deaktiviert. Setze in deiner Konfiguration `dis | Variable | Beispiel | Beschreibung | | -------------- | -------- | ------------------------------------------------------------------------------------------- | | status | `127` | The exit code of the last command | +| hex_status | `0x7F` | The exit code of the last command in hex | | int | `127` | The exit code of the last command | | common_meaning | `ERROR` | Meaning of the code if not a signal | | signal_number | `9` | Signal number corresponding to the exit code, only if signalled | @@ -2836,7 +2854,7 @@ The `sudo` module displays if sudo credentials are currently cached. The module ::: tip -Dieses Modul ist standardmäßig deaktiviert. Setze in deiner Konfiguration `disabled` auf `false` um es zu aktivieren. +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: @@ -2980,11 +2998,11 @@ format = "[🏎💨 $workspace]($style) " ## Zeit -Das `time` Modul zeigt die aktuelle **lokale** Zeit an. Der `format` Wert wird von der crate [`chrono`](https://crates.io/crates/chrono) benutzt um die Zeit zu formatieren. Schau dir [die chrono strftime Dokumentation](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) an, um die möglichen Optionen zu sehen. +The `time` module shows the current **local** time. The `format` configuration value is used by the [`chrono`](https://crates.io/crates/chrono) crate to control how the time is displayed. Take a look [at the chrono strftime docs](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) to see what options are available. ::: tip -Dieses Modul ist standardmäßig deaktiviert. Setze in deiner Konfiguration `disabled` auf `false` um es zu aktivieren. +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: @@ -3000,7 +3018,7 @@ Dieses Modul ist standardmäßig deaktiviert. Setze in deiner Konfiguration `dis | `disabled` | `true` | Deaktiviert das `time`-Modul. | | `time_range` | `"-"` | Sets the time range during which the module will be shown. Times must be specified in 24-hours format | -If `use_12hr` is `true`, then `time_format` defaults to `"%r"`. Ansonsten ist der Standardwert hierfür `"%T"`. Manually setting `time_format` will override the `use_12hr` setting. +If `use_12hr` is `true`, then `time_format` defaults to `"%r"`. Otherwise, it defaults to `"%T"`. Manually setting `time_format` will override the `use_12hr` setting. ### Variables @@ -3026,7 +3044,7 @@ time_range = "10:00:00-14:00:00" ## Benutzername -Das Modul `username` zeigt den Benutzernamen des aktiven Benutzers. Das Modul wird nur dann angezeigt, wenn eine der folgenden Bedingungen zutrifft: +The `username` module shows active user's username. Das Modul wird nur dann angezeigt, wenn eine der folgenden Bedingungen zutrifft: - Der aktuelle Benutzer ist root - Der aktuelle Benutzer ist nicht derjenige, der derzeit angemeldet ist diff --git a/docs/de-DE/faq/README.md b/docs/de-DE/faq/README.md index d352e3e3f..7042bece0 100644 --- a/docs/de-DE/faq/README.md +++ b/docs/de-DE/faq/README.md @@ -69,13 +69,13 @@ If you see symbols that you don't recognise you can use `starship explain` to ex You can enable the debug logs by using the `STARSHIP_LOG` env var. These logs can be very verbose so it is often useful to use the `module` command if you are trying to debug a particular module, for example, if you are trying to debug the `rust` module you could run the following command to get the trace logs and output from the module. ```sh -env STARHIP_LOG=trace starship module rust +env STARSHIP_LOG=trace starship module rust ``` If starship is being slow you can try using the `timings` command to see if there is a particular module or command that to blame. ```sh -env STARHIP_LOG=trace starship timings +env STARSHIP_LOG=trace starship timings ``` This will output the trace log and a breakdown of all modules that either took more than 1ms to execute or produced some output. @@ -117,6 +117,6 @@ If Starship was installed using a package manager, please refer to their docs fo Wenn Starship mit Hilfe des Installationsscripts installiert wurde, entfernt der folgende Befehl Starship: ```sh -# Starship binary suchen und löschen -sh -c 'rm "$(which starship)"' +# Locate and delete the starship binary +sh -c 'rm "$(command -v 'starship')"' ``` diff --git a/docs/de-DE/guide/README.md b/docs/de-DE/guide/README.md index f2e6114c9..21439bb1e 100644 --- a/docs/de-DE/guide/README.md +++ b/docs/de-DE/guide/README.md @@ -72,6 +72,22 @@ height="20" src="https://raw.githubusercontent.com/starship/starship/master/media/flag-fr.png" alt="Français" + /> +   + Bahasa Indonesia +   + Italiano   Portugiesisch (Brasilien)   Russisch   Vietnamesisch   @@ -119,7 +119,7 @@ description: '¡Starship es el prompt minimalista, ultrarápido e infinitamente #### Elvish - ::: advertencia Solo se admite Elvish v0.15 o superior. ::: + ::: warning Only elvish v0.17 or higher is supported. ::: Añade el siguiente código al final de `~/.elvish/rc.elv`: @@ -164,3 +164,14 @@ description: '¡Starship es el prompt minimalista, ultrarápido e infinitamente execx($(starship init xonsh)) ``` + + + #### Cmd + + You need to use [Clink](https://chrisant996.github.io/clink/clink.html) (v1.2.30+) with Cmd. Add the following to a file `starship.lua` and place this file in Clink scripts directory: + + ```lua + -- starship.lua + + load(io.popen('starship init cmd'):read("*a"))() + ``` diff --git a/docs/es-ES/advanced-config/README.md b/docs/es-ES/advanced-config/README.md index b5dafca2f..2782fadf0 100644 --- a/docs/es-ES/advanced-config/README.md +++ b/docs/es-ES/advanced-config/README.md @@ -8,11 +8,35 @@ Las configuraciones de esta sección están sujetos a cambios en futuras version ::: -## Comandos pre-prompt y pre-ejecucución personalizados en Bash +## Custom pre-prompt and pre-execution Commands in Cmd -Bash no posee un framework oficial de preexec/precmd como la mayoría de los demás intérpretes de comandos. Debido a esto, es difícil proporcionar "hooks" totalmente personalizables en `Bash`. Sin embargo, Starship te da la posibilidad de insertar de forma limitada tus propias funciones en el proceso de renderizado del prompt: +Clink provides extremely flexible APIs to run pre-prompt and pre-exec commands in Cmd shell. It is fairly simple to use with Starship. Make the following changes to your `starship.lua` file as per your requirements: -- Para ejecutar una función personalizada previa al renderizado del prompt, define una nueva función y asigna su nombre a `starship_precmd_user_func`. Por ejemplo, para dibujar un cohete antes del prompt, se puede realizar así: +- To run a custom function right before the prompt is drawn, define a new function called `starship_preprompt_user_func`. This function receives the current prompt as a string that you can utilize. For example, to draw a rocket before the prompt, you would do + +```lua +function starship_preprompt_user_func(prompt) + print("🚀") +end + +load(io.popen('starship init cmd'):read("*a"))() +``` + +- To run a custom function right before a command is executed, define a new function called `starship_precmd_user_func`. This function receives the current commandline as a string that you can utilize. For example, to print the command that's about to be executed, you would do + +```lua +function starship_precmd_user_func(line) + print("Executing: "..line) +end + +load(io.popen('starship init cmd'):read("*a"))() +``` + +## Custom pre-prompt and pre-execution Commands in Bash + +Bash does not have a formal preexec/precmd framework like most other shells. Because of this, it is difficult to provide fully customizable hooks in `bash`. Sin embargo, Starship te da la posibilidad de insertar de forma limitada tus propias funciones en el proceso de renderizado del prompt: + +- To run a custom function right before the prompt is drawn, define a new function and then assign its name to `starship_precmd_user_func`. For example, to draw a rocket before the prompt, you would do ```bash function blastoff(){ @@ -21,21 +45,21 @@ function blastoff(){ starship_precmd_user_func="blastoff" ``` -- Para ejecutar una función personalizada antes de que un comando sea ejecutado, es posible usar el [mecanismo de trampa `DEBUG`](https://jichu4n.com/posts/debug-trap-and-prompt_command-in-bash/). No obstante, ¡**debes** atrapar la señal DEBUG *antes* de inicializar Starship! Starship puede preservar el valor de la trampa DEBUG, pero si la trampa es reemplazada después de que Starship inicie, alguna funcionalidad fallará. +- To run a custom function right before a command runs, you can use the [`DEBUG` trap mechanism](https://jichu4n.com/posts/debug-trap-and-prompt_command-in-bash/). However, you **must** trap the DEBUG signal *before* initializing Starship! Starship can preserve the value of the DEBUG trap, but if the trap is overwritten after starship starts up, some functionality will break. ```bash function blastoff(){ echo "🚀" } -trap blastoff DEBUG # Trampa DEBUG *antes* de la ejecución de Starship +trap blastoff DEBUG # Trap DEBUG *before* running starship eval $(starship init bash) ``` -## Comandos pre-prompt y pre-ejecución personalizados en PowerShell +## Custom pre-prompt and pre-execution Commands in PowerShell -Powershell no posee un framework oficial de preexec/precmd como la mayoría de los demás intérpretes de comandos. Debido a esto, es difícil proporcionar "hooks" totalmente personalizables en `Powershell`. Sin embargo, Starship te da la posibilidad de insertar de forma limitada tus propias funciones en el proceso de renderizado del prompt: +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`. Sin embargo, Starship te da la posibilidad de insertar de forma limitada tus propias funciones en el proceso de renderizado del prompt: -Crea una función llamada `Invoke-Starship-PreCommand` +Create a function named `Invoke-Starship-PreCommand` ```powershell function Invoke-Starship-PreCommand { @@ -43,35 +67,35 @@ function Invoke-Starship-PreCommand { } ``` -## Cambiar el Título de la Ventana +## Cambiar título de la ventana -Algunos intérpretes de comandos van a cambiar automáticamente el título de la ventana por ti (p. ej., para mostrar tu directorio actual). Fish incluso lo hace por defecto. Starship no hace esto, pero es bastante sencillo añadir esta funcionalidad a `Bash` o `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`, `zsh`, `cmd` or `powershell`. -Primero, define una función para el cambio de título de la ventana (idéntico en Bash y zsh): +First, define a window title change function (identical in bash and zsh): ```bash function set_win_title(){ - echo -ne "\033]0; TU_TITULO_DE_VENTANA_AQUI \007" + echo -ne "\033]0; YOUR_WINDOW_TITLE_HERE \007" } ``` -Puedes usar variables para personalizar este título (`$USER`, `$HOSTNAME` y `$PWD` son opciones populares). +You can use variables to customize this title (`$USER`, `$HOSTNAME`, and `$PWD` are popular choices). -En `Bash`, establece que esta función sea la función precmd de Starship: +In `bash`, set this function to be the precmd starship function: ```bash starship_precmd_user_func="set_win_title" ``` -En `zsh`, añade esto al array `precmd_functions`: +In `zsh`, add this to the `precmd_functions` array: ```bash precmd_functions+=(set_win_title) ``` -Si te gusta el resultado, añade estas líneas a tu archivo de configuración del intérprete de comandos (`~/.bashrc` o `~/.zsrhc`) para hacerlo permanente. +If you like the result, add these lines to your shell configuration file (`~/.bashrc` or `~/.zshrc`) to make it permanent. -Por ejemplo, si quieres mostrar tu directorio actual en el título de la pestaña de la terminal, añade el siguiente fragmento a tu `~/.bashrc` o `~/.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`: ```bash function set_win_title(){ @@ -80,7 +104,17 @@ function set_win_title(){ starship_precmd_user_func="set_win_title" ``` -También puede establecer una salida similar con PowerShell creando una función llamada `Invoke-Starship-PreCommand`. +For Cmd, you can change the window title using the `starship_preprompt_user_func` function. + +```lua +function starship_preprompt_user_func(prompt) + console.settitle(os.getenv('USERNAME').."@"..os.getenv('COMPUTERNAME')..": "..os.getcwd()) +end + +load(io.popen('starship init cmd'):read("*a"))() +``` + +You can also set a similar output with PowerShell by creating a function named `Invoke-Starship-PreCommand`. ```powershell # edit $PROFILE @@ -91,55 +125,77 @@ function Invoke-Starship-PreCommand { Invoke-Expression (&starship init powershell) ``` -## Habilitar Prompt a la Derecha +## Enable Right Prompt -Algunos intérpretes de comandos soportan un prompt derecho que se renderiza en la misma línea que la entrada. Starship puede establecer el contenido del prompt derecho usando la opción `right_format`. Cualquier módulo que pueda ser usado en `format` también es soportado en `right_format`. La variable `$all` solo contendrá módulos no utilizados explícitamente en `format` o `right_format`. +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`. -Nota: El prompt derecho es una sola línea siguiendo la ubicación de entrada. Para alinear módulos arriba de la línea de entrada en un prompt multi-línea, vea el [módulo fill](/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` está actualmente soportado para los siguientes intérpretes de comandos: elvish, fish, zsh. +`right_format` is currently supported for the following shells: elvish, fish, zsh, xonsh, cmd. ### Ejemplo ```toml -# ~/.config/starship. oml +# ~/.config/starship.toml -# Un prompt izquierdo mínimo +# A minimal left prompt format = """$character""" -# mueve el resto del mensaje a la derecha +# move the rest of the prompt to the right right_format = """$all""" ``` -Produce un prompt como el siguiente: +Produces a prompt like the following: ``` ▶ starship on  rprompt [!] is 📦 v0.57.0 via 🦀 v1.54.0 took 17s ``` +## Continuation Prompt + +Some shells support a continuation prompt along with the normal prompt. This prompt is rendered instead of the normal prompt when the user has entered an incomplete statement (such as a single left parenthesis or quote). + +Starship can set the continuation prompt using the `continuation_prompt` option. The default prompt is `"[∙](bright-black) "`. + +Note: `continuation_prompt` should be set to a literal string without any variables. + +Note: Continuation prompts are only available in the following shells: + + - `bash` + - `zsh` + - `PowerShell` + +### Ejemplo + +```toml +# ~/.config/starship.toml + +# A continuation prompt that displays two filled in arrows +continuation_prompt = "▶▶" +``` ## Cadenas de estilo -Las cadenas de estilo son una lista de palabras, separadas por espacios en blanco. Las palabras no son sensibles a mayúsculas (es decir, `bold` y `BoLd` se consideran la misma cadena). Cada palabra puede ser una de las siguientes: +Style strings are a list of words, separated by whitespace. The words are not case sensitive (i.e. `bold` and `BoLd` are considered the same string). Each word can be one of the following: - - `bold` - - `italic` - - `underline` - - `dimmed` - - `inverted` + - `negrita` + - `cursiva` + - `subrayado` + - `atenuado` + - `invertido` - `bg:` - `fg:` - `` - - `none` + - `ninguno` -donde `` es un especificador de color (discutido a continuación). `fg:` y `` hacen actualmente lo mismo, aunque esto puede cambiar en el futuro. `inverted` cambia el fondo y los colores de primer plano. El orden de las palabras en la cadena no importa. +where `` is a color specifier (discussed below). `fg:` and `` 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. -El token `none` anula todos los demás tokens en una cadena si no es parte de un especificador `bg:`, de modo que por ejemplo `fg:red none fg:blue` creará una cadena sin ningún estilo. `bg:none` establece el fondo al color por defecto, así que `fg:red bg:none` es equivalente a `red` o `fg:red` y `bg:green fg:red bg:none` también es equivalente a `fg:red` o `red`. Puede convertirse en un error usar `none` junto con otros tokens en el futuro. +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. -Un especificador de color puede ser uno de los siguientes: +A color specifier can be one of the following: - - Uno de los colores estándar del terminal: `black`, `red`, `green`, `blue`, `yellow`, `purple`, `cyan`, `white`. Opcionalmente puedes agregar el prefijo `bright-` para obtener la versión brillante (por ejemplo, `bright-white`). - - Un `#` seguido de un número hexadecimal de seis dígitos. Esto especifica un [código hexadecimal de color RGB](https://www.w3schools.com/colors/colors_hexadecimal.asp). - - Un número entre 0-255. Esto especifica un [Código de color ANSI de 8-bits](https://i.stack.imgur.com/KTSQa.png). + - One of the standard terminal colors: `black`, `red`, `green`, `blue`, `yellow`, `purple`, `cyan`, `white`. You can optionally prefix these with `bright-` to get the bright version (e.g. `bright-white`). + - A `#` followed by a six-digit hexadecimal number. This specifies an [RGB color hex code](https://www.w3schools.com/colors/colors_hexadecimal.asp). + - A number between 0-255. This specifies an [8-bit ANSI Color Code](https://i.stack.imgur.com/KTSQa.png). -Si se especifican varios colores para el primer plano/fondo, el último en la cadena tendrá prioridad. +If multiple colors are specified for foreground/background, the last one in the string will take priority. diff --git a/docs/es-ES/config/README.md b/docs/es-ES/config/README.md index 895ce024f..dbfab79f4 100644 --- a/docs/es-ES/config/README.md +++ b/docs/es-ES/config/README.md @@ -24,18 +24,24 @@ disabled = true Puedes cambiar la ubicación por defecto del archivo de configuración con la variable de entorno `STARSHIP_CONFIG`: ```sh -export STARSHIP_CONFIG=~/.starship/config.toml +export STARSHIP_CONFIG=~/example/non/default/path/starship.toml ``` El equivalente en PowerShell (Windows) es añadir esta línea a tu `$PROFILE`: ```powershell -$ENV:STARSHIP_CONFIG = "$HOME\.starship\config.toml" +$ENV:STARSHIP_CONFIG = "$HOME\example\non\default\path\starship.toml" +``` + +Or for Cmd (Windows) would be adding this line to your `starship.lua`: + +```lua +os.setenv('STARSHIP_CONFIG', 'C:\\Users\\user\\example\\non\\default\\path\\starship.toml') ``` ### Registros -Starship registra por defecto los mensajes de advertencia y error en un fichero con nombre `~/.cache/starship/session_${STARSHIP_SESSION_KEY}.log`, en el que la clave de sesión corresponde con una instancia de tu terminal. Esto, sin embargo, puede ser cambiado usando la variable de entorno `STARSHIP_CACHE`: +By default starship logs warnings and errors into a file named `~/.cache/starship/session_${STARSHIP_SESSION_KEY}.log`, where the session key is corresponding to a instance of your terminal. This, however can be changed using the `STARSHIP_CACHE` environment variable: ```sh export STARSHIP_CACHE=~/.starship/cache @@ -47,21 +53,27 @@ El equivalente en PowerShell (Windows) es añadir esta línea a tu `$PROFILE`: $ENV:STARSHIP_CACHE = "$HOME\AppData\Local\Temp" ``` +Or for Cmd (Windows) would be adding this line to your `starship.lua`: + +```lua +os.setenv('STARSHIP_CACHE', 'C:\\Users\\user\\AppData\\Local\\Temp') +``` + ### Terminología -**Módulo**: un componente en el promt que provee información basada en información contextual de tu sistema operativo. Por ejemplo, el módulo "nodejs" muestra la versión de NodeJS que tienes actualmente instalada en tu ordenador, si el directorio actual es un proyecto NodeJS. +**Module**: A component in the prompt giving information based on contextual information from your OS. For example, the "nodejs" module shows the version of Node.js that is currently installed on your computer, if your current directory is a Node.js project. -**Variable**: subcomponentes más pequeños que contienen información proporcionada por el módulo. Por ejemplo, la variable "version" en el módulo "nodejs" contiene la versión actual de NodeJS. +**Variable**: Smaller sub-components that contain information provided by the module. For example, the "version" variable in the "nodejs" module contains the current version of Node.js. -Por convención, la mayoría de los módulos tienen un prefijo del color por defecto de la terminal (por ejemplo, `vía` en "nodejs") y un espacio vacío como sufijo. +By convention, most modules have a prefix of default terminal color (e.g. `via` in "nodejs") and an empty space as a suffix. ### Cadenas de Formato -Es el formato con el que un módulo imprime todas sus variables. La mayoría de los módulos tienen una entrada llamada `format` que configura el formato de visualización del módulo. Se puede utilizar textos, variables y grupos de texto. +Format strings are the format that a module prints all its variables with. Most modules have an entry called `format` that configures the display format of the module. You can use texts, variables and text groups in a format string. #### Variable -Una variable contiene un símbolo `$` seguido por el nombre de la variable. The name of a variable can only contain 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 `_`. Por ejemplo: @@ -71,11 +83,11 @@ Por ejemplo: #### Grupo de Texto -Un grupo de texto se compone de dos partes diferentes. +A text group is made up of two different parts. -La primera parte, que está encerrada en un `[]`, es una [cadena de formato](#format-strings). Se puede agregar textos, variables, o incluso grupos de texto anidados. +The first part, which is enclosed in a `[]`, is a [format string](#format-strings). You can add texts, variables, or even nested text groups in it. -En la segunda parte, que está encerrada entre `()`, es una [cadena de estilo](#style-strings). Esto se puede utilizar para diseñar la primera parte. +In the second part, which is enclosed in a `()`, is a [style string](#style-strings). This can be used to style the first part. Por ejemplo: @@ -85,7 +97,7 @@ Por ejemplo: #### Cadenas de estilo -La mayoría de los módulos de starship permiten configurar los estilos de su cadenas texto. Esto se consigue con una entrada (normalmente llamada `style` - estilo) que no es más que un texto donde se especifica la configuración. A continuación mostramos algunos ejemplos de cadenas de estilo junto con su funcionalidad. Para más detalles sobre la sintaxis completa, consulta [la guía de configuración avanzada](/advanced-config/). +Most modules in starship allow you to configure their display styles. This is done with an entry (usually called `style`) which is a string specifying the configuration. Here are some examples of style strings along with what they do. For details on the full syntax, consult the [advanced config guide](/advanced-config/). - `"fg:green bg:blue"` pone texto verde sobre un fondo azul - `"bg:blue fg:bright-green"` pone texto verde claro sobre un fondo azul @@ -94,11 +106,11 @@ La mayoría de los módulos de starship permiten configurar los estilos de su ca - `"bold italic fg:purple"` pone texto color morado, en negrita y cursiva - `""` desactiva explícitamente cualquier estilo -Nótese que el estilo es similar a como se controlaría por el emulador de su terminal. Por ejemplo, algunos emuladores de terminal harán los colores más brillantes en lugar de más gruesos, y algunos temas usan los mismos valores para texto normal y colores brillantes. Además, para mostrar textos en cursiva tu terminal debe tener soporte para hacerlo. +Note that what styling looks like will be controlled by your terminal emulator. For example, some terminal emulators will brighten the colors instead of bolding text, and some color themes use the same values for the normal and bright colors. Also, to get italic text, your terminal must support italics. #### Cadenas de Formato Condicional -Una cadena de formato condicional envuelto en `(` y `)` no se renderizará si todas las variables dentro están vacías. +A conditional format string wrapped in `(` and `)` will not render if all variables inside are empty. Por ejemplo: @@ -112,18 +124,18 @@ 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 `\\`). -Por ejemplo, cuando se desea imprimir un símbolo `$` en una nueva línea, las siguientes configuraciones para la variable `format` son equivalentes: +For example, when you want to print a `$` symbol on a new line, the following configs for `format` are equivalent: ```toml -# con cadena básica +# with basic string format = "\n\\$" -# con cadena básica multilínea +# with multiline basic string format = """ \\$""" -# con cadena literal +# with literal string format = ''' \$''' @@ -131,7 +143,7 @@ format = ''' ## Prompt -Esta es la lista de opciones de configuración del prompt. +This is the list of prompt-wide configuration options. ### Opciones @@ -149,22 +161,22 @@ Esta es la lista de opciones de configuración del prompt. ```toml # ~/.config/starship.toml -# Usar formato personalizado +# Use custom format format = """ [┌───────────────────>](bold green) [│](bold green)$directory$rust$package [└─>](bold green) """ -# Espera 10 milisegundos para que starship revise los archivos del directorio actual. +# Wait 10 milliseconds for starship to check files under the current directory. scan_timeout = 10 -# Deshabilita la línea en blanco al inicio del prompt +# Disable the blank line at the start of the prompt add_newline = false ``` ### Formato por Defecto del Prompt -La varieble `format` por defecto se utiliza para definir el formato del prompt, si está vacía o `format` no se proporciona. El valor por defecto es el siguiente: +The default `format` is used to define the format of the prompt, if empty or no `format` is provided. The default is as shown: ```toml format = "$all" @@ -239,22 +251,22 @@ $shell\ $character""" ``` -Si solo quieres extender el formato predeterminado, puedes usar `$all`; los módulos que se añaden explícitamente al formato no serán duplicados. Por ejemplo. +If you just want to extend the default format, you can use `$all`; modules you explicitly add to the format will not be duplicated. Ej. ```toml -# Mueve el directorio a la segunda línea +# Move the directory to the second line format="$all$directory$character" ``` ## AWS -El módulo `aws` muestra la región y el perfil AWS actuales. Éste se basa en las variables de entorno `AWS_REGION`, `AWS_DEFAULT_REGION`, y `AWS_PROFILE` del fichero `~/.aws/config`. Este módulo también muestra un temporizador de caducidad al usar credenciales temporales. +The `aws` module shows the current AWS region and profile. This is based on `AWS_REGION`, `AWS_DEFAULT_REGION`, and `AWS_PROFILE` env var with `~/.aws/config` file. This module also shows an expiration timer when using temporary credentials. -Cuando se utiliza [aws-vault](https://github.com/99designs/aws-vault), el perfil se lee de la variable de entorno `AWS_VAULT` y la fecha de expiración de credenciales se lee de la variable de entorno `AWS_SESSION_EXPIRATION`. +When using [aws-vault](https://github.com/99designs/aws-vault) the profile is read from the `AWS_VAULT` env var and the credentials expiration date is read from the `AWS_SESSION_EXPIRATION` env var. -Cuando se utiliza [awsu](https://github.com/kreuzwerker/awsu) el perfil se lee de la variable de entorno `AWSU_PROFILE`. +When using [awsu](https://github.com/kreuzwerker/awsu) the profile is read from the `AWSU_PROFILE` env var. -Cuando se utiliza [AWSume](https://awsu.me), el perfil se lee de la variable de entorno `AWSUME_PROFILE` y la fecha de expiración de credenciales se lee de la variable de entorno `AWSUME_EXPIRATION`. +When using [AWSume](https://awsu.me) the profile is read from the `AWSUME_PROFILE` env var and the credentials expiration date is read from the `AWSUME_EXPIRATION` env var. ### Opciones @@ -347,7 +359,7 @@ style = "blue bold" ## Battery -El módulo `battery` muestra la cantidad de batería y si está cargando o no. El módulo es solo visible cuando la batería está por debajo del 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%. ### Opciones @@ -375,7 +387,7 @@ discharging_symbol = "💀 " ### Indicador de batería -La opción de configuración `display` se utiliza para definir cuándo debe mostrarse el indicador de batería (threshold), qué symbol se utilizaría (symbol), y cómo sería (style). Si no se provee ningún valor para `display` El valor por defecto es el siguiente: +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. The default is as shown: ```toml [[battery.display]] @@ -383,11 +395,11 @@ threshold = 10 style = "bold red" ``` -El valor por defecto para las opciones `charging_symbol` y `discharging_symbol` son respectivamente los valores `charging_symbol` y `discharging_symbol` de las opción de `battery`. +The default value for the `charging_symbol` and `discharging_symbol` option is respectively the value of `battery`'s `charging_symbol` and `discharging_symbol` option. #### Opciones -La opción `display` es un array de la siguiente tabla. +The `display` option is an array of the following table. | Opción | Por defecto | Descripción | | -------------------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------- | @@ -414,24 +426,24 @@ discharging_symbol = "💦" ## Character -El módulo `character` muestra un carater (normalmente una flecha) tras el texto que introduces en el terminal. +The `character` module shows a character (usually an arrow) beside where the text is entered in your terminal. -El carácter te dirá si el último comando funcionó o no. Se puede hacer de dos maneras: +The character will tell you whether the last command was successful or not. It can do this in two ways: - Cambiando el color (`red`/`green`) - Cambiando la forma (`.`/`✖`) -Por defecto sólo cambia el color. Si también se quiere cambiar su forma, ver [este ejemplo](#with-custom-error-shape). +By default it only changes color. If you also want to change its shape take a look at [this example](#with-custom-error-shape). ::: aviso -`error_symbol` no es compatible con el intérprete de comandos Elvish y Nu. +`error_symbol` is not supported on nu shell. ::: ::: aviso -`vicmd_symbol` sólo es compatible con fish y zsh. +`vicmd_symbol` is only supported in cmd, fish and zsh. ::: @@ -484,7 +496,7 @@ vicmd_symbol = "[V](bold green) " ## CMake -El módulo `cmake` muestra la versión actualmente instalada de [CMake](https://cmake.org/). Por defecto el módulo se activará si se cumplen cualquiera de las siguientes condiciones: +The `cmake` module shows the currently installed version of [CMake](https://cmake.org/). By default the module will be activated if any of the following conditions are met: - El directorio actual contiene un archivo `CMakeLists.txt` - The current directory contains a `CMakeCache.txt` file @@ -514,7 +526,7 @@ El módulo `cmake` muestra la versión actualmente instalada de [CMake](https:// ## COBOL / GNUCOBOL -El módulo `cobol` muestra la versión instalada de COBOL. Por defecto, el módulo se mostrará si se cumplen cualquiera de las siguientes condiciones: +The `cobol` module shows the currently installed version of COBOL. By default, the module will be shown if any of the following conditions are met: - El directorio actual contiene cualquier archivo que termine en `.cob` o `.COB` - El directorio actual contiene cualquier archivo que termine en `.cbl` o `.CBL` @@ -544,15 +556,15 @@ El módulo `cobol` muestra la versión instalada de COBOL. Por defecto, el módu ## Tiempo de Ejecución -El módulo `cmd_duration` muestra cuánto tiempo tardó el último comando en ejecutarse. El módulo se mostrará solo si el comando llevó dos segundos o más, o el valor de `min_time`, si existe. +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 No utilizar DEBUG en Bash +::: warning Do not hook the DEBUG trap in Bash -Si estás usando Starship con `bash`, no uses `DEBUG` después de ejecutar `eval $(starship init $0)`, o el módulo **se romperá**. +If you are running Starship in `bash`, do not hook the `DEBUG` trap after running `eval $(starship init $0)`, or this module **will** break. ::: -Los usuarios de bash que necesiten la funcionalidad preexec-like pueden usar el framework rcaloras's bash_preexec. Simplemente define los arrays preexec_functions y precmd_functions antes de ejecutar eval $(starship init $0), y continúa con normalidad. Basta con definir los arrays `preexec_functions` y `precmd_functions` antes de ejecutar `eval $(starship init $0)`, y luego proceder como siempre. +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. ### Opciones @@ -566,9 +578,9 @@ Los usuarios de bash que necesiten la funcionalidad preexec-like pueden usar el | `show_notifications` | `false` | Muestra notificaciones de escritorio cuando se complete el comando. | | `min_time_to_notify` | `45_000` | Duración mínima para mostrar el tiempo de ejecución (en milisegundos). | -::: consejo +::: tip -Mostrar notificaciones de escritorio requiere que se construya starship con soporte de `rust-notify`. Comprueba si tu Starship soporta notificaciones ejecutando `STARSHIP_LOG=debug starship module cmd_duration -d 60000` cuando `show_notifications` está establecido en `true`. +Showing desktop notifications requires starship to be built with `notify-rust` support. You check if your starship supports notifications by running `STARSHIP_LOG=debug starship module cmd_duration -d 60000` when `show_notifications` is set to `true`. ::: @@ -593,11 +605,11 @@ format = "underwent [$duration](bold yellow)" ## Conda -El módulo `conda` muestra el entorno actual [Conda](https://docs.conda.io/en/latest/), si `$CONDA_DEFAULT_ENV` está configurado. +The `conda` module shows the current [Conda](https://docs.conda.io/en/latest/) environment, if `$CONDA_DEFAULT_ENV` is set. ::: consejo -Esto no modifica el propio símbolo de sistema de conda. En caso de querer suprimirlo, ejecuta `conda config --set changeps1 False`. +This does not suppress conda's own prompt modifier, you may want to run `conda config --set changeps1 False`. ::: @@ -633,7 +645,7 @@ format = "[$symbol$environment](dimmed green) " ## Crystal -El módulo `cristal` muestra la versión instalada de [Crystal](https://crystal-lang.org/). Por defecto, el módulo se mostrará si se cumplen cualquiera de las siguientes condiciones: +The `crystal` module shows the currently installed version of [Crystal](https://crystal-lang.org/). Por defecto, el módulo se mostrará si se cumplen cualquiera de las siguientes condiciones: - El directorio actual contiene un fichero `shard.yml` - El directorio actual contiene un fichero `.cr` @@ -672,7 +684,7 @@ format = "via [✨ $version](bold blue) " ## Dart -El módulo `dart` muestra la versión instalada de [Dart](https://dart.dev/). Por defecto, el módulo se mostrará si se cumplen cualquiera de las siguientes condiciones: +The `dart` module shows the currently installed version of [Dart](https://dart.dev/). Por defecto, el módulo se mostrará si se cumplen cualquiera de las siguientes condiciones: - El directorio actual contiene un archivo con la extensión `.dart` - El directorio actual contiene un directorio `.dart_tool` @@ -712,21 +724,21 @@ format = "via [🔰 $version](bold red) " ## Deno -El módulo `deno` le muestra la versión instalada de [Deno](https://deno.land/). Por defecto, el módulo se mostrará si se cumplen cualquiera de las siguientes condiciones: -- El directorio actual contiene un archivo `mod.ts`, `mod.js`, `deps.ts` o `deps.js` +The `deno` module shows you your currently installed version of [Deno](https://deno.land/). Por defecto, el módulo se mostrará si se cumplen cualquiera de las siguientes condiciones: +- The current directory contains a `deno.json`, `deno.jsonc`, `mod.ts`, `mod.js`, `deps.ts` or `deps.js` file ### Opciones -| Opción | Por defecto | Descripción | -| ------------------- | -------------------------------------------- | --------------------------------------------------------------------------------------- | -| `format` | `"via [$symbol($version )]($style)"` | El formato del módulo. | -| `version_format` | `"v${raw}"` | El formato de versión. Las variables disponibles son `raw`, `major`, `minor`, & `patch` | -| `symbol` | `"🦕 "` | Una cadena de formato que representa el símbolo de Deno | -| `detect_extensions` | `[]` | Qué extensiones deberían activar este módulo. | -| `detect_files` | `["mod.ts", "mod.js", "deps.ts", "deps.js"]` | Qué nombres de archivo deberían activar este módulo. | -| `detect_folders` | `[]` | Qué carpetas deberían activar este módulo. | -| `style` | `"green bold"` | El estilo del módulo. | -| `disabled` | `false` | Deshabilita el módulo `deno`. | +| Opción | Por defecto | Descripción | +| ------------------- | ----------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | +| `format` | `"via [$symbol($version )]($style)"` | El formato del módulo. | +| `version_format` | `"v${raw}"` | El formato de versión. Las variables disponibles son `raw`, `major`, `minor`, & `patch` | +| `symbol` | `"🦕 "` | Una cadena de formato que representa el símbolo de Deno | +| `detect_extensions` | `[]` | Qué extensiones deberían activar este módulo. | +| `detect_files` | `["deno.json", "deno.jsonc", "mod.ts", "mod.js", "deps.ts", "deps.js"]` | Qué nombres de archivo deberían activar este módulo. | +| `detect_folders` | `[]` | Qué carpetas deberían activar este módulo. | +| `style` | `"green bold"` | El estilo del módulo. | +| `disabled` | `false` | Deshabilita el módulo `deno`. | ### Variables @@ -747,29 +759,30 @@ format = "via [🦕 $version](green bold) " ## Directory -El módulo `directory` muestra la ruta hasta el directorio actual, mostrando tres directorios padre como máximo. Tu directorio se truncará a la raíz del repositorio git en el que estés. +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. -Cuando usas el estilo fish de la opción pwd, en lugar de ocultar la ruta truncada, verás una versión acortada del nombre de cada directorio basada en el número que activa la opción. +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. -Por ejemplo, dado `~/Dev/Nix/nixpkgs/pkgs` donde `nixpkgs` es la raíz del repositorio y el valor de la opción es `1`. En ese caso, verás `~/D/N/nixpkgs/pkgs`, cuando antes hubiera sido `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`. ### Opciones -| Opción | Por defecto | Descripción | -| ------------------- | -------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `truncation_length` | `3` | El número de directorios padre a los que se debe truncar el directorio actual. | -| `truncate_to_repo` | `true` | Trunca o no hasta la raíz del repositorio git en el que estés. | -| `format` | `"[$path]($style)[$read_only]($read_only_style) "` | El formato del módulo. | -| `style` | `"bold cyan"` | El estilo del módulo. | -| `disabled` | `false` | Desactiva el módulo `directory`. | -| `read_only` | `"🔒"` | El símbolo que indica si el directorio actual es de sólo lectura. | -| `read_only_style` | `"red"` | El estilo para el símbolo de sólo lectura. | -| `truncation_symbol` | `""` | El símbolo a prefijar a las rutas truncadas. ej: "…/" | -| `repo_root_style` | `None` | The style for the root of the git repo when `truncate_to_repo` option is set to false. | -| `home_symbol` | `"~"` | El símbolo que indica el directorio personal. | +| Opción | Por defecto | Descripción | +| ------------------- | -------------------------------------------------- | --------------------------------------------------------------------------------------- | +| `truncation_length` | `3` | El número de directorios padre a los que se debe truncar el directorio actual. | +| `truncate_to_repo` | `true` | Trunca o no hasta la raíz del repositorio git en el que estés. | +| `format` | `"[$path]($style)[$read_only]($read_only_style) "` | El formato del módulo. | +| `style` | `"bold cyan"` | El estilo del módulo. | +| `disabled` | `false` | Desactiva el módulo `directory`. | +| `read_only` | `"🔒"` | El símbolo que indica si el directorio actual es de sólo lectura. | +| `read_only_style` | `"red"` | El estilo para el símbolo de sólo lectura. | +| `truncation_symbol` | `""` | El símbolo a prefijar a las rutas truncadas. ej: "…/" | +| `repo_root_style` | `None` | The style for the root of the git repo when `truncate_to_repo` option is set to false. | +| `home_symbol` | `"~"` | El símbolo que indica el directorio personal. | +| `use_os_path_sep` | `true` | Use the OS specific path seperator instead of always using `/` (e.g. `\` on Windows) |
-Este módulo tiene algunas opciones avanzadas de configuración que controlan cómo se muestra el directorio. +This module has a few advanced configuration options that control how the directory is displayed. | Opciones avanzadas | Por defecto | Descripción | | --------------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -777,7 +790,7 @@ Por ejemplo, dado `~/Dev/Nix/nixpkgs/pkgs` donde `nixpkgs` es la raíz del repos | `fish_style_pwd_dir_length` | `0` | El número de caracteres a usar al aplicar la lógica de ruta pwd de la shell de fish. | | `use_logical_path` | `true` | Si `true` renderiza la ruta lógica originada desde el intérprete de comandos a través de `PWD` o `--logical-path`. Si `false` en su lugar renderiza la ruta física del sistema de archivos con enlaces simbólicos resueltos. | -`substitutions` permite definir reemplazos arbitrarios para cadenas literales que ocurren en la ruta, por ejemplo prefijos largos de red o directorios de desarrollo (p. ej. Java). Ten en cuenta que esto desactivará el estilo PWD de fish. +`substitutions` allows you to define arbitrary replacements for literal strings that occur in the path, for example long network prefixes or development directories (i.e. Java). Note that this will disable the fish style PWD. ```toml [directory.substitutions] @@ -785,7 +798,7 @@ Por ejemplo, dado `~/Dev/Nix/nixpkgs/pkgs` donde `nixpkgs` es la raíz del repos "src/com/long/java/path" = "mypath" ``` -`fish_style_pwd_dir_length` interactúa con las opciones de truncamiento estándar de una manera que puede sorprenderse primero: si no es cero, los componentes de la ruta que normalmente se truncarían se muestran con esa cantidad de caracteres. Por ejemplo, la ruta `/built/this/city/on/rock/and/roll`, que normalmente se mostraría como `rock/and/roll`, se mostraría como `/b/t/c/o/rock/and/roll` con `fish_style_pwd_dir_length = 1`--los componentes de ruta que normalmente se eliminarían se muestran con un solo carácter. Para `fish_style_pwd_dir_length = 2`, sería `/bu/th/ci/on/rock/and/roll`. +`fish_style_pwd_dir_length` interacts with the standard truncation options in a way that can be surprising at first: if it's non-zero, the components of the path that would normally be truncated are instead displayed with that many characters. For example, the path `/built/this/city/on/rock/and/roll`, which would normally be displayed as as `rock/and/roll`, would be displayed as `/b/t/c/o/rock/and/roll` with `fish_style_pwd_dir_length = 1`--the path components that would normally be removed are displayed with a single character. For `fish_style_pwd_dir_length = 2`, it would be `/bu/th/ci/on/rock/and/roll`.
@@ -846,9 +859,9 @@ format = "via [🐋 $context](blue bold)" ## Dotnet -El módulo `dotnet` muestra la versión usada de .NET Core SDK para el directorio actual. Si el SDK ha sido anclado en el directorio actual, se mostrará la versión fijada. De lo contrario, el módulo muestra la última versión instalada del 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. -Por defecto, este módulo solo se mostrará en tu prompt cuando uno o más de de los siguientes archivos estén presentes en el directorio actual: +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: - `global.json` - `project.json` @@ -859,11 +872,11 @@ Por defecto, este módulo solo se mostrará en tu prompt cuando uno o más de de - `*.fsproj` - `*.xproj` -También necesitará tener instalado .NET Core SDK para poder usarlo correctamente. +You'll also need the .NET Core SDK installed in order to use it correctly. -Internamente, este módulo utiliza su propio mecanismo para la detección de versiones. Normalmente es el doble de rápido que ejecutar `dotnet --version`, pero puede mostrar una versión incorrecta si tu proyecto .NET tiene un diseño de directorio inusual. Si la precisión es más importante que la velocidad, puede desactivar el mecanismo estableciendo `heuristic = false` en las opciones del módulo. +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. -El módulo también mostrará el Target Framework Moniker ([https://docs.microsoft. om/es/dotnet/standard/frameworks#supported-target-framework-versions](https://docs.microsoft.com/en-us/dotnet/standard/frameworks#supported-target-framework-versions)) cuando exista un archivo csproj en el directorio actual. +The module will also show the Target Framework Moniker () when there is a csproj file in the current directory. ### Opciones @@ -903,7 +916,7 @@ heuristic = false ## Elixir -El módulo `elixir` muestra la versión instalada de [Elixir](https://elixir-lang.org/) y [Erlang/OTP](https://erlang.org/doc/). Por defecto, el módulo se mostrará si se cumplen cualquiera de las siguientes condiciones: +The `elixir` module shows the currently installed version of [Elixir](https://elixir-lang.org/) and [Erlang/OTP](https://erlang.org/doc/). Por defecto, el módulo se mostrará si se cumplen cualquiera de las siguientes condiciones: - El directorio actual contiene un archivo `mix.exs`. @@ -942,7 +955,7 @@ symbol = "🔮 " ## Elm -El módulo `elm` muestra la versión instalada de [Elm](https://elm-lang.org/). Por defecto, el módulo se mostrará si se cumplen cualquiera de las siguientes condiciones: +The `elm` module shows the currently installed version of [Elm](https://elm-lang.org/). Por defecto, el módulo se mostrará si se cumplen cualquiera de las siguientes condiciones: - El directorio actual contiene un archivo `elm.json` - El directorio actual contiene un archivo `elm-package.json` @@ -984,15 +997,15 @@ format = "via [ $version](cyan bold) " ## Variable de entorno -El módulo `env_var` muestra el valor actual de una variable de entorno seleccionada. El módulo se mostrará sólo si se cumplen cualquiera de las siguientes condiciones: +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: - La opción de configuración de `variable` coincide con una variable de entorno existente - La opción de configuración de `variable` no está definida, pero la opción de configuración se encuentra `por defecto` -::: consejo Múltiples variables de entorno pueden mostrarse usando un `.`. (ver ejemplo) Si la opción de configuración de la `variable` no está definida, el módulo mostrará el valor de la variable bajo el nombre del texto después del caracter `.`. +::: 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. -Ejemplo: la siguiente configuración mostrará el valor de la variable de entorno USER +Example: following configuration will display value of USER environment variable ```toml # ~/.config/starship.toml @@ -1031,7 +1044,7 @@ variable = "SHELL" default = "unknown shell" ``` -Mostrando múltiples variables de entorno: +Displaying multiple environmental variables: ```toml # ~/.config/starship.toml @@ -1044,7 +1057,7 @@ default = "unknown user" ## Erlang -El módulo `erlang` muestra la versión instalada de [Erlang/OTP](https://erlang.org/doc/). Por defecto, el módulo se mostrará si se cumplen cualquiera de las siguientes condiciones: +The `erlang` module shows the currently installed version of [Erlang/OTP](https://erlang.org/doc/). Por defecto, el módulo se mostrará si se cumplen cualquiera de las siguientes condiciones: - El directorio actual contiene un fichero `rebar.config`. - El directorio actual contiene un fichero `erlang.mk`. @@ -1083,7 +1096,7 @@ format = "via [e $version](bold red) " ## Llenar -El módulo `fill` llena cualquier espacio extra en la línea con un símbolo. Si múltiples módulos `fill` están presentes en una línea, dividirán el espacio equitativamente entre ellos. Esto es útil para alinear otros módulos. +The `fill` module fills any extra space on the line with a symbol. If multiple `fill` modules are present in a line they will split the space evenly between them. This is useful for aligning other modules. ### Opciones @@ -1104,7 +1117,7 @@ symbol = "-" style = "bold green" ``` -Produce un prompt que se ve como: +Produces a prompt that looks like: ``` AA -------------------------------------------- BB -------------------------------------------- CC @@ -1113,7 +1126,7 @@ AA -------------------------------------------- BB ----------------------------- ## Google Cloud (`gcloud`) -El módulo `gcloud` muestra la configuración actual para el CLI de [`gcloud`](https://cloud.google.com/sdk/gcloud). Esto se basa en el archivo `~/.config/gcloud/active_config`, el archivo `~/.config/gcloud/configurations/config_{CONFIG NAME}` y la variable de entorno `CLOUDSDK_CONFIG`. +The `gcloud` module shows the current configuration for [`gcloud`](https://cloud.google.com/sdk/gcloud) CLI. This is based on the `~/.config/gcloud/active_config` file and the `~/.config/gcloud/configurations/config_{CONFIG NAME}` file and the `CLOUDSDK_CONFIG` env var. ### Opciones @@ -1174,7 +1187,7 @@ asia-northeast1 = "an1" ## Git Branch -El módulo `git_branch` muestra la rama activa del repositorio en tu directorio actual. +The `git_branch` module shows the active branch of the repo in your current directory. ### Opciones @@ -1214,7 +1227,7 @@ truncation_symbol = "" ## Git commit -El módulo `git_commit` muestra el hash de la confirmación actual y también la etiqueta (si existe) del repositorio en su directorio actual. +The `git_commit` module shows the current commit hash and also the tag (if any) of the repo in your current directory. ### Opciones @@ -1249,7 +1262,7 @@ tag_symbol = "🔖 " ## Git state -El módulo `git_state` se mostrará en directorios que son parte de un repositorio git, y donde hay una operación en curso, tales como: _REBASING_, _BISECTING_, etc. Si hay información de progreso (por ejemplo, REBASING 3/10), esa información será mostrada también. +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. ### Opciones @@ -1289,11 +1302,11 @@ cherry_pick = "[🍒 PICKING](bold red)" ## Métricas de Git -El módulo `git_metrics` mostrará el número de líneas añadidas y eliminadas en el repositorio git actual. +The `git_metrics` module will show the number of added and deleted lines in the current git repository. ::: consejo -Este módulo está deshabilitado por defecto. Para activarlo, establece `disabled` a `false` en tu archivo de configuración. +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: @@ -1330,30 +1343,31 @@ format = '[+$added]($added_style)/[-$deleted]($deleted_style) ' ## Git status -El módulo `git_status` muestra símbolos que representan el estado del repositorio en su directorio actual. +The `git_status` module shows symbols representing the state of the repo in your current directory. ### Opciones -| Opción | Por defecto | Descripción | -| ------------ | ----------------------------------------------- | ---------------------------------------- | -| `format` | `'([\[$all_status$ahead_behind\]]($style) )'` | El formato por defecto para `git_status` | -| `conflicted` | `"="` | Esta rama tiene conflictos de fusión. | -| `ahead` | `"⇡"` | El formato de `ahead` | -| `behind` | `"⇣"` | El formato de `behind` | -| `diverged` | `"⇕"` | El formato de `diverged` | -| `up_to_date` | `""` | El formato de `up_to_date` | -| `untracked` | `"?"` | El formato de `untracked` | -| `stashed` | `"$"` | El formato de `stashed` | -| `modified` | `"!"` | El formato de `modified` | -| `staged` | `"+"` | El formato de `staged` | -| `renamed` | `"»"` | El formato de `renamed` | -| `deleted` | `"✘"` | El formato de `deleted` | -| `style` | `"bold red"` | El estilo del módulo. | -| `disabled` | `false` | Desactiva el módulo `git_status`. | +| Opción | Por defecto | Descripción | +| ------------------- | ----------------------------------------------- | ---------------------------------------- | +| `format` | `'([\[$all_status$ahead_behind\]]($style) )'` | El formato por defecto para `git_status` | +| `conflicted` | `"="` | Esta rama tiene conflictos de fusión. | +| `ahead` | `"⇡"` | El formato de `ahead` | +| `behind` | `"⇣"` | El formato de `behind` | +| `diverged` | `"⇕"` | El formato de `diverged` | +| `up_to_date` | `""` | El formato de `up_to_date` | +| `untracked` | `"?"` | El formato de `untracked` | +| `stashed` | `"$"` | El formato de `stashed` | +| `modified` | `"!"` | El formato de `modified` | +| `staged` | `"+"` | El formato de `staged` | +| `renamed` | `"»"` | El formato de `renamed` | +| `deleted` | `"✘"` | El formato de `deleted` | +| `style` | `"bold red"` | El estilo del módulo. | +| `ignore_submodules` | `false` | Ignore changes to submodules. | +| `disabled` | `false` | Disables the `git_status` module. | ### Variables -Las siguientes variables se pueden utilizar en `format`: +The following variables can be used in `format`: | Variable | Descripción | | -------------- | ------------------------------------------------------------------------------------------------------------------------ | @@ -1370,14 +1384,14 @@ Las siguientes variables se pueden utilizar en `format`: \*: Esta variable sólo puede ser usada como parte de una cadena de estilo -Las siguientes variables pueden ser usadas en `diverged`: +The following variables can be used in `diverged`: | Variable | Descripción | | -------------- | ------------------------------------------------------- | | `ahead_count` | Número de commits por delante de la rama de seguimiento | | `behind_count` | Número de commits detrás de la rama de seguimiento | -Las siguientes variales pueden ser usadas en `conflicted`, `ahead`, `behind`, `untracked`, `stashed`, `modified`, `staged`, `renamed` y `deleted`: +The following variables can be used in `conflicted`, `ahead`, `behind`, `untracked`, `stashed`, `modified`, `staged`, `renamed` and `deleted`: | Variable | Descripción | | -------- | ----------------------------- | @@ -1402,7 +1416,7 @@ renamed = "👅" deleted = "🗑" ``` -Mostrar el recuento delante/detrás de la rama que está siendo rastreada +Show ahead/behind count of the branch being tracked ```toml # ~/.config/starship.toml @@ -1415,7 +1429,7 @@ behind = "⇣${count}" ## Go -El módulo `golang` muestra la versión instalada de [Go](https://golang.org/). Por defecto, el módulo se mostrará si se cumplen cualquiera de las siguientes condiciones: +The `golang` module shows the currently installed version of [Go](https://golang.org/). Por defecto, el módulo se mostrará si se cumplen cualquiera de las siguientes condiciones: - El directorio actual contiene un archivo `go.mod` - El directorio actual contiene un archivo `go.sum` @@ -1460,7 +1474,7 @@ format = "via [🏎💨 $version](bold cyan) " ## Helm -El módulo `helm` muestra la versión instalada de [Helm](https://helm.sh/). Por defecto, el módulo se mostrará si se cumplen cualquiera de las siguientes condiciones: +The `helm` module shows the currently installed version of [Helm](https://helm.sh/). Por defecto, el módulo se mostrará si se cumplen cualquiera de las siguientes condiciones: - El directorio actual contiene un fichero `helmfile.yaml` - El directorio actual contiene un archivo `Chart.yaml` @@ -1499,7 +1513,7 @@ format = "via [⎈ $version](bold white) " ## Hostname -El módulo `hostname` muestra el nombre de host del sistema. +The `hostname` module shows the system hostname. ### Opciones @@ -1513,10 +1527,10 @@ El módulo `hostname` muestra el nombre de host del sistema. ### Variables -| Variable | Ejemplo | Descripción | -| --------- | ------- | -------------------------------------- | -| symbol | | Refleja el valor de la opción `symbol` | -| style\* | | Refleja el valor de la opción `style` | +| Variable | Ejemplo | Descripción | +| --------- | ---------- | ------------------------------------- | +| hostname | `computer` | The hostname of the computer | +| style\* | | Refleja el valor de la opción `style` | \*: Esta variable sólo puede ser usada como parte de una cadena de estilo @@ -1534,7 +1548,7 @@ disabled = false ## Java -El módulo `java` muestra la versión instalada de [Java](https://www.oracle.com/java/). Por defecto, el módulo se mostrará si se cumplen cualquiera de las siguientes condiciones: +The `java` module shows the currently installed version of [Java](https://www.oracle.com/java/). Por defecto, el módulo se mostrará si se cumplen cualquiera de las siguientes condiciones: - El directorio actual contiene un archivo `pom.xml`, `build.gradle.kts`, `build.sbt`, `.java-version`, `.deps.edn`, `project.clj`, o `build.boot` - El directorio actual contiene un archivo con la extensión `.java`, `.class`, `.gradle` o `.jar`, `.clj` o `.cljc` @@ -1573,9 +1587,9 @@ symbol = "🌟 " ## Jobs -El módulo `jobs` muestra el número actual de tareas en ejecución. El módulo se mostrará sólo si hay tareas en segundo plano ejecutándose. El módulo mostrará el número de tareas ejecutados si hay al menos 2 tareas, o más del valor de configuración de `number_threshold`, si existe. El módulo mostrará un símbolo si hay al menos 1 tarea, o más del valor de configuración de `symbol_threshold`, si existe. Puedes establecer ambos valores a 0 para *siempre* mostrar el símbolo y el número de tareas, incluso si hay 0 tareas en ejecución. +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. -La funcionalidad por defecto es: +The default functionality is: - 0 tareas -> Nada se muestra. - 1 tarea -> `symbol` se muestra. @@ -1583,13 +1597,13 @@ La funcionalidad por defecto es: ::: aviso -Este módulo no está soportado por tcsh y nu. +This module is not supported on tcsh and nu. ::: ::: aviso -La opción `threshold` está obsoleta, pero si deseas usarla, el módulo mostrará el número de tareas en ejecución si hay más de 1 tarea, o más que el valor de configuración `threshold`, si existe. Si `threshold` se establece en 0, entonces el módulo también se mostrará cuando haya 0 tareas en ejecución. +The `threshold` option is deprecated, but if you want to use it, the module will show the number of jobs running if there is more than 1 job, or more than the `threshold` config value, if it exists. If `threshold` is set to 0, then the module will also show when there are 0 jobs running. ::: @@ -1604,9 +1618,9 @@ La opción `threshold` está obsoleta, pero si deseas usarla, el módulo mostrar | `symbol` | `"✦"` | La cadena utilizada para representar la variable `symbol`. | | `style` | `"bold blue"` | El estilo del módulo. | | `disabled` | `false` | Desactiva el módulo `jobs`. | - \*: Esta opción está desaprobada, por favor utiliza las opciones + \*: This option is deprecated, please use the -`number_threshold` y `symbol_threshold` en su lugar. +`number_threshold` and `symbol_threshold` options instead. ### Variables @@ -1631,7 +1645,7 @@ symbol_threshold = 0 ## Julia -El módulo `julia` muestra la versión instalada de [Julia](https://julialang.org/). Por defecto, el módulo se mostrará si se cumplen cualquiera de las siguientes condiciones: +The `julia` module shows the currently installed version of [Julia](https://julialang.org/). Por defecto, el módulo se mostrará si se cumplen cualquiera de las siguientes condiciones: - El directorio actual contiene un archivo `Project.toml` - El directorio actual contiene un archivo `Manifest.toml` @@ -1671,7 +1685,7 @@ symbol = "∴ " ## Kotlin -El módulo `kotlin` muestra la versión instalada de [Kotlin](https://kotlinlang.org/). Por defecto, el módulo se mostrará si se cumplen cualquiera de las siguientes condiciones: +The `kotlin` module shows the currently installed version of [Kotlin](https://kotlinlang.org/). Por defecto, el módulo se mostrará si se cumplen cualquiera de las siguientes condiciones: - El directorio actual contiene un archivo `.kt` o `.kts` @@ -1712,17 +1726,17 @@ symbol = "🅺 " # ~/.config/starship.toml [kotlin] -# Utiliza el binario del Compilador de Kotlin para obtener la versión instalada +# Uses the Kotlin Compiler binary to get the installed version kotlin_binary = "kotlinc" ``` ## Kubernetes -Muestra el nombre actual del [contexto de Kubernetes](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#context) y, si se establece, el espacio de nombres del archivo kubeconfig. El espacio de nombres necesita establecerse en el archivo kubeconfig, esto puede hacerse mediante `kubectl config set-context starship-cluster --namespace astronaut`. Si se establece la variable de entorno `$KUBECONFIG`, el módulo usará eso si no usará el `~/.kube/config`. +Displays the current [Kubernetes context](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#context) name and, if set, the namespace from the kubeconfig file. The namespace needs to be set in the kubeconfig file, this can be done via `kubectl config set-context starship-cluster --namespace astronaut`. If the `$KUBECONFIG` env var is set the module will use that if not it will use the `~/.kube/config`. ::: consejo -Este módulo está deshabilitado por defecto. Para activarlo, establece `disabled` a `false` en tu archivo de configuración. +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: @@ -1763,28 +1777,28 @@ disabled = false #### Busqueda por Regex -Adicional al alias simple, `context_aliases` también soporta coincidencias extendidas y renombradas usando expresiones regulares. +Additional to simple aliasing, `context_aliases` also supports extended matching and renaming using regular expressions. -La expresión regular debe coincidir en todo el contexto de kube. los grupos de captura pueden ser referenciados usando `$name` y `$N` en el reemplazo. Esto está más explicado en la documentación del [crate regex](https://docs.rs/regex/1.5.4/regex/struct.Regex.html#method.replace). +The regular expression must match on the entire kube context, capture groups can be referenced using `$name` and `$N` in the replacement. This is more explained in the [regex crate](https://docs.rs/regex/1.5.4/regex/struct.Regex.html#method.replace) documentation. -Los nombres de cluster generados de forma larga y automática pueden ser identificados y abreviados usando expresiones regulares: +Long and automatically generated cluster names can be identified and shortened using regular expressions: ```toml [kubernetes.context_aliases] -# los contextos de OpenShift llevan el espacio de nombres y el usuario en el contexto de kube: `namespace/name/user`: +# OpenShift contexts carry the namespace and user in the kube context: `namespace/name/user`: ".*/openshift-cluster/.*" = "openshift" # Or better, to rename every OpenShift cluster at once: ".*/(?P[\\w-]+)/.*" = "$cluster" -# Los contextos de GKE, AWS y otros proveedores de nube normalmente llevan información adicional, como la región/zona. -# La siguiente entrada coincide con el formato GKE (`gke_projectname_zone_cluster-name`) -# y renombra cada contexto de kube coincidente a un formato más legible (`gke-cluster-name`): +# Contexts from GKE, AWS and other cloud providers usually carry additional information, like the region/zone. +# The following entry matches on the GKE format (`gke_projectname_zone_cluster-name`) +# and renames every matching kube context into a more readable format (`gke-cluster-name`): "gke_.*_(?P[\\w-]+)" = "gke-$cluster" ``` ## Salto de línea -El módulo `line_break` separa el indicador en dos líneas. +The `line_break` module separates the prompt into two lines. ### Opciones @@ -1803,7 +1817,7 @@ disabled = true ## Lua -El módulo `lua` muestra la versión instalada de [Lua](http://www.lua.org/). Por defecto, el módulo se mostrará si se cumplen cualquiera de las siguientes condiciones: +The `lua` module shows the currently installed version of [Lua](http://www.lua.org/). Por defecto, el módulo se mostrará si se cumplen cualquiera de las siguientes condiciones: - El directorio actual contiene un archivo `.lua-version` - El directorio actual contiene un directorio `lua` @@ -1844,13 +1858,13 @@ format = "via [🌕 $version](bold blue) " ## Memoria utilizada -El módulo `memory_usage` muestra la memoria del sistema actual y el uso de memoria de intercambio. +The `memory_usage` module shows current system memory and swap usage. -Por defecto, el uso de swap se muestra si el intercambio total del sistema no es cero. +By default the swap usage is displayed if the total system swap is non-zero. ::: consejo -Este módulo está deshabilitado por defecto. Para activarlo, establece `disabled` a `false` en tu archivo de configuración. +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: @@ -1875,7 +1889,7 @@ Este módulo está deshabilitado por defecto. Para activarlo, establece `disable | symbol | `🐏` | Refleja el valor de la opción `symbol` | | style\* | | Refleja el valor de la opción `style` | -\*: Esta variable sólo puede utilizarse como parte de una cadena de estilo \*\*: La información del archivo SWAP sólo se muestra si se detecta en el sistema actual +\*: This variable can only be used as a part of a style string \*\*: The SWAP file information is only displayed if detected on the current system ### Ejemplo @@ -1891,7 +1905,7 @@ style = "bold dimmed green" ## Mercurial Branch -El módulo `hg_branch` muestra la rama activa del repositorio en su directorio actual. +The `hg_branch` module shows the active branch of the repo in your current directory. ### Opciones @@ -1927,7 +1941,7 @@ truncation_symbol = "" ## Nim -El módulo `nim` muestra la versión instalada de [Nim](https://nim-lang.org/). Por defecto, el módulo se mostrará si se cumplen cualquiera de las siguientes condiciones: +The `nim` module shows the currently installed version of [Nim](https://nim-lang.org/). Por defecto, el módulo se mostrará si se cumplen cualquiera de las siguientes condiciones: - El directorio actual contiene un archivo `nim.cfg` - El directorio actual contiene un archivo con la extensión `.nim` @@ -1969,7 +1983,7 @@ symbol = "🎣 " ## Nix-shell -El módulo `nix_shell` muestra el entorno [nix-shell](https://nixos.org/guides/nix-pills/developing-with-nix-shell.html). El módulo se mostrará dentro de un entorno 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. ### Opciones @@ -2007,7 +2021,7 @@ format = 'via [☃️ $state( \($name\))](bold blue) ' ## Node.js -El módulo `nodejs` muestra la versión instalada de [Node.js](https://nodejs.org/). Por defecto, el módulo se mostrará si se cumplen cualquiera de las siguientes condiciones: +The `nodejs` module shows the currently installed version of [Node.js](https://nodejs.org/). Por defecto, el módulo se mostrará si se cumplen cualquiera de las siguientes condiciones: - El directorio actual contiene un archivo `package.json` - El directorio actual contiene un archivo `.node-version` @@ -2051,7 +2065,7 @@ format = "via [🤖 $version](bold green) " ## OCaml -El módulo `ocaml` muestra la versión instalada de [OCaml](https://ocaml.org/). Por defecto, el módulo se mostrará si se cumplen cualquiera de las siguientes condiciones: +The `ocaml` module shows the currently installed version of [OCaml](https://ocaml.org/). Por defecto, el módulo se mostrará si se cumplen cualquiera de las siguientes condiciones: - El directorio actual contiene un archivo con extensión `.opam` o directorio `_opam` - El directorio actual contiene un directorio `esy.lock` @@ -2098,7 +2112,7 @@ format = "via [🐪 $version]($style) " ## OpenStack -El módulo `openstack` muestra la nube OpenStack actual y el proyecto. El módulo solo está activo cuando la variable env `OS_CLOUD` está definida en cuyo caso leerá el archivo `nubes. aml` desde cualquiera de las [ubicaciones por defecto](https://docs.openstack.org/python-openstackclient/latest/configuration/index.html#configuration-files) para obtener el proyecto actual en uso. +The `openstack` module shows the current OpenStack cloud and project. The module only active when the `OS_CLOUD` env var is set, in which case it will read `clouds.yaml` file from any of the [default locations](https://docs.openstack.org/python-openstackclient/latest/configuration/index.html#configuration-files). to fetch the current project in use. ### Opciones @@ -2133,7 +2147,7 @@ symbol = "☁️ " ## Versión del paquete -El módulo `package` se muestra cuando el directorio actual es el repositorio de un paquete, y muestra su versión actual. 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`, `shards` and `dart` packages. - [**npm**](https://docs.npmjs.com/cli/commands/npm) – La versión del paquete `npm` se extrae del `package.json` presente en el directorio actual - [**Cargo**](https://doc.rust-lang.org/cargo/) – La versión del paquete `cargo` se extrae del `Cargo.toml` presente en el directorio actual @@ -2150,6 +2164,7 @@ El módulo `package` se muestra cuando el directorio actual es el repositorio de - [**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) - La versión del paquete `vlang` se extrae del `v.mod` presente en el directorio actual - [**SBT**](https://scala-sbt.org) - The `sbt` package version is extracted from the `build.sbt` present in the current directory +- [**Dart**](https://pub.dev/) - The `dart` package version is extracted from the `pubspec.yaml` present in the current directory > ⚠️ La versión que se muestra es la del paquete cuyo código fuente está en tu directorio actual, no en tu gestor de paquetes. @@ -2185,7 +2200,7 @@ format = "via [🎁 $version](208 bold) " ## Perl -El módulo `perl` muestra la versión instalada de [Perl](https://www.perl.org/). Por defecto, el módulo se mostrará si se cumplen cualquiera de las siguientes condiciones: +The `perl` module shows the currently installed version of [Perl](https://www.perl.org/). Por defecto, el módulo se mostrará si se cumplen cualquiera de las siguientes condiciones: - El directorio actual contiene un archivo `Makefile.PL` o `Build.PL` - El directorio actual contiene un archivo `cpanfile` o `cpanfile.snapshot` @@ -2225,7 +2240,7 @@ format = "via [🦪 $version]($style) " ## PHP -El módulo `php` muestra la versión instalada de [PHP](https://www.php.net/). Por defecto, el módulo se mostrará si se cumplen cualquiera de las siguientes condiciones: +The `php` module shows the currently installed version of [PHP](https://www.php.net/). Por defecto, el módulo se mostrará si se cumplen cualquiera de las siguientes condiciones: - El directorio actual contiene un archivo `composer.json` - El directorio actual contiene un archivo `.php-version` @@ -2265,11 +2280,11 @@ format = "via [🔹 $version](147 bold) " ## Pulumi -El módulo `pulumi` muestra la pila [Pulumi](https://www.pulumi.com/docs/intro/concepts/stack/) y la versión seleccionados actualmente. +The `pulumi` module shows the currently selected [Pulumi Stack](https://www.pulumi.com/docs/intro/concepts/stack/) and version. -::: consejo +::: tip -Por defecto la versión de Pulumi no se muestra, ya que toma un orden de magnitud más largo para cargar que la mayoría de los plugins (~70ms). Si aún deseas activarlo, [sigue el ejemplo que se muestra a continuación](#with-pulumi-version). +By default the Pulumi version is not shown, since it takes an order of magnitude longer to load then most plugins (~70ms). If you still want to enable it, [follow the example shown below](#with-pulumi-version). ::: @@ -2322,7 +2337,7 @@ format = "[$symbol$stack]($style) " ## PureScript -El módulo `purescript` muestra la versión instalada de [PureScript](https://www.purescript.org/). Por defecto, el módulo se mostrará si se cumplen cualquiera de las siguientes condiciones: +The `purescript` module shows the currently installed version of [PureScript](https://www.purescript.org/) version. Por defecto, el módulo se mostrará si se cumplen cualquiera de las siguientes condiciones: - El directorio actual contiene un archivo `spago.dhall` - El directorio actual contiene un archivo con la extensión `.purs` @@ -2361,9 +2376,9 @@ format = "via [$symbol$version](bold white)" ## Python -El módulo `python` muestra la versión instalada de [Python](https://www.python.org/) y el entorno virtual actual [Python](https://docs.python.org/tutorial/venv.html) si uno está activado. +The `python` module shows the currently installed version of [Python](https://www.python.org/) and the current [Python virtual environment](https://docs.python.org/tutorial/venv.html) if one is activated. -Si `pyenv_version_name` se establece en `true`, mostrará el nombre de la versión de pyenv. De lo contrario, se mostrará el número de versión de `python --version`. +If `pyenv_version_name` is set to `true`, it will display the pyenv version name. Otherwise, it will display the version number from `python --version`. Por defecto, el módulo se mostrará si se cumplen cualquiera de las siguientes condiciones: @@ -2393,11 +2408,11 @@ Por defecto, el módulo se mostrará si se cumplen cualquiera de las siguientes | `detect_folders` | `[]` | Qué carpetas deben activar este módulo | | `disabled` | `false` | Desactiva el módulo `python`. | -::: consejo +::: tip -La variable `python_binary` acepta una cadena o una lista de cadenas. Starship intentará ejecutar cada binario hasta que obtenga un resultado. Ten en cuenta que sólo puedes cambiar el binario que Starship ejecuta para obtener la versión de Python no los argumentos que se utilizan. +The `python_binary` variable accepts either a string or a list of strings. Starship will try executing each binary until it gets a result. Note you can only change the binary that Starship executes to get the version of Python not the arguments that are used. -Los valores por defecto y el orden para `python_binary` fue elegido para identificar primero la versión de Python en un entorno virtualenv/conda (que actualmente añade un `python`, no importa si apunta a `pithon3` o `pithon2`). Esto tiene el efecto secundario que si todavía tienes un sistema de Python 2 instalado, puede ser recogido antes de cualquier Python 3 (al menos en las Distros de Linux que siempre enlazan `/usr/bin/python` a Python 2). Si ya no trabajas con Python 2 pero no puedes removerlo del sistema, cambiando esto a `"python3"` ocultará cualquier versión de Python 2, ver ejemplo a continuación. +The default values and order for `python_binary` was chosen to first identify the Python version in a virtualenv/conda environments (which currently still add a `python`, no matter if it points to `python3` or `python2`). This has the side effect that if you still have a system Python 2 installed, it may be picked up before any Python 3 (at least on Linux Distros that always symlink `/usr/bin/python` to Python 2). If you do not work with Python 2 anymore but cannot remove the system Python 2, changing this to `"python3"` will hide any Python version 2, see example below. ::: @@ -2425,7 +2440,7 @@ pyenv_version_name = true # ~/.config/starship.toml [python] -# Solo usa el binario `python3` para obtener la versión. +# Only use the `python3` binary to get the version. python_binary = "python3" ``` @@ -2433,7 +2448,7 @@ python_binary = "python3" # ~/.config/starship.toml [python] -# No se dispara con archivos con extensión py +# Don't trigger for files with the py extension detect_extensions = [] ``` @@ -2441,16 +2456,16 @@ detect_extensions = [] # ~/.config/starship.toml [python] -# Muestra la versión de python desde dentro de un entorno virtual local. +# Display the version of python from inside a local venv. # -# Ten en cuenta que esto solo funcionará cuando el venv esté dentro del proyecto y sólo -# funcionará en el directorio que contiene el directorio venv dir pero ¿tal vez esté bien? +# Note this will only work when the venv is inside the project and it will only +# work in the directory that contains the venv dir but maybe this is ok? python_binary = ["./venv/bin/python", "python", "python3", "python2"] ``` ## R -El módulo `rlang` muestra la versión instalada de [R](https://www.r-project.org/). El módulo se mostrará si se cumplen cualquiera de las siguientes condiciones: +The `rlang` module shows the currently installed version of [R](https://www.r-project.org/). The module will be shown if any of the following conditions are met: - El directorio actual contiene un archivo con la extensión `.R`. - El directorio actual contiene un archivo con la extensión `.Rd`. @@ -2492,7 +2507,7 @@ format = "with [📐 $version](blue bold) " ## Red -Por defecto, el módulo `red` muestra la versión actualmente instalada de [Red](https://www.red-lang.org/). El módulo se muestra si algunas de las siguientes condiciones se cumplen: +By default the `red` module shows the currently installed version of [Red](https://www.red-lang.org/). El módulo se muestra si algunas de las siguientes condiciones se cumplen: - El directorio actual contiene un archivo con extensión `.red` o `.Red` @@ -2530,7 +2545,7 @@ symbol = "🔴 " ## Ruby -Por defecto, el módulo `ruby` muestra la versión actualmente instalada de [Ruby](https://www.ruby-lang.org/). El módulo se muestra si algunas de las siguientes condiciones se cumplen: +By default the `ruby` module shows the currently installed version of [Ruby](https://www.ruby-lang.org/). El módulo se muestra si algunas de las siguientes condiciones se cumplen: - El directorio actual contiene un archivo `Gemfile` - El directorio actual contiene un archivo `.ruby-version` @@ -2574,7 +2589,7 @@ symbol = "🔺 " ## Rust -Por defecto, el módulo `rust` muestra la versión instalada de [Rust](https://www.rust-lang.org/). El módulo se muestra si algunas de las siguientes condiciones se cumplen: +By default the `rust` module shows the currently installed version of [Rust](https://www.rust-lang.org/). El módulo se muestra si algunas de las siguientes condiciones se cumplen: - El directorio actual contiene un archivo `Cargo.toml` - El directorio actual contiene un archivo con la extensión `.rs` @@ -2613,7 +2628,7 @@ format = "via [⚙️ $version](red bold)" ## Scala -El módulo `scala` muestra la versión actualmente instalada de [Scala](https://www.scala-lang.org/). Por defecto, el módulo se mostrará si se cumplen cualquiera de las siguientes condiciones: +The `scala` module shows the currently installed version of [Scala](https://www.scala-lang.org/). Por defecto, el módulo se mostrará si se cumplen cualquiera de las siguientes condiciones: - El directorio actual contiene un archivo `build.sbt`, `.scalaenv` o `.sbtenv` - El directorio actual contiene un archivo con la extensión `.scala` o `.sbt` @@ -2653,30 +2668,32 @@ symbol = "🌟 " ## Shell -El módulo `shell` muestra un indicador para el intérprete de comandos actualmente utilizado. +The `shell` module shows an indicator for currently used shell. -::: consejo +::: tip -Este módulo está deshabilitado por defecto. Para activarlo, establece `disabled` a `false` en tu archivo de configuración. +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: ### Opciones -| Opción | Por defecto | Descripción | -| ---------------------- | ------------------------- | -------------------------------------------------------------------- | -| `bash_indicator` | `bsh` | Una cadena de formato usada para representar Bash. | -| `fish_indicator` | `fsh` | Una cadena de formato usada para representar Fish. | -| `zsh_indicator` | `zsh` | Una cadena de formato usada para representar Zsh. | -| `powershell_indicator` | `psh` | Una cadena de formato usada para representar Powershell. | -| `ion_indicator` | `ion` | Una cadena de formato usada para representar Ion. | -| `elvish_indicator` | `esh` | Una cadena de formato usada para representar Elvish. | -| `tcsh_indicator` | `tsh` | Una cadena de formato usada para representar tcsh. | -| `xonsh_indicator` | `xsh` | Una cadena de formato usada para representar xonsh. | -| `unknown_indicator` | | El valor por defecto que se mostrará cuando se desconoce el comando. | -| `format` | `"[$indicator]($style) "` | El formato del módulo. | -| `style` | `"white bold"` | El estilo del módulo. | -| `disabled` | `true` | Deshabilita el módulo `shell`. | +| Opción | Por defecto | Descripción | +| ---------------------- | ------------------------- | ------------------------------------------------------------ | +| `bash_indicator` | `bsh` | Una cadena de formato usada para representar Bash. | +| `fish_indicator` | `fsh` | Una cadena de formato usada para representar Fish. | +| `zsh_indicator` | `zsh` | Una cadena de formato usada para representar Zsh. | +| `powershell_indicator` | `psh` | Una cadena de formato usada para representar Powershell. | +| `ion_indicator` | `ion` | Una cadena de formato usada para representar Ion. | +| `elvish_indicator` | `esh` | Una cadena de formato usada para representar Elvish. | +| `tcsh_indicator` | `tsh` | Una cadena de formato usada para representar tcsh. | +| `xonsh_indicator` | `xsh` | Una cadena de formato usada para representar xonsh. | +| `cmd_indicator` | `cmd` | A format string used to represent cmd. | +| `nu_indicator` | `nu` | A format string used to represent nu. | +| `unknown_indicator` | | The default value to be displayed when the shell is unknown. | +| `format` | `"[$indicator]($style) "` | El formato del módulo. | +| `style` | `"white bold"` | El estilo del módulo. | +| `disabled` | `true` | Disables the `shell` module. | ### Variables @@ -2702,7 +2719,7 @@ disabled = false ## SHLVL -El módulo `shlvl` muestra la variable de entorno [`SHLVL`](https://tldp.org/LDP/abs/html/internalvariables.html#SHLVLREF) ("shell level") actual, si está establecido en un número y reúne o supera el umbral especificado. +The `shlvl` module shows the current [`SHLVL`](https://tldp.org/LDP/abs/html/internalvariables.html#SHLVLREF) ("shell level") environment variable, if it is set to a number and meets or exceeds the specified threshold. ### Opciones @@ -2738,7 +2755,7 @@ threshold = 3 ## Singularity -El módulo `singularity` muestra la imagen de [singularity](https://sylabs.io/singularity/) actual, si se encuentra dentro de un contenedor y `$SINGULARITY_NAME` está establecido. +The `singularity` module shows the current [Singularity](https://sylabs.io/singularity/) image, if inside a container and `$SINGULARITY_NAME` is set. ### Opciones @@ -2770,15 +2787,15 @@ format = '[📦 \[$env\]]($style) ' ## Status -El módulo `status` muestra el código de salida del comando anterior. El módulo se mostrará sólo si el código de salida no es `0`. +The `status` module displays the exit code of the previous command. The module will be shown only if the exit code is not `0`. -::: consejo +::: tip -Este módulo está deshabilitado por defecto. Para activarlo, establece `disabled` a `false` en tu archivo de configuración. +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: -::: advertencia Este módulo no es compatible con los intérpretes de comandos Elvish y Nu. ::: +::: warning This module is not supported on nu shell. ::: ### Opciones @@ -2801,17 +2818,18 @@ Este módulo está deshabilitado por defecto. Para activarlo, establece `disable ### Variables -| Variable | Ejemplo | Descripción | -| -------------- | ------- | ------------------------------------------------------------------------------------------------------------------ | -| status | `127` | El código de salida del último comando | -| int | `127` | El código de salida del último comando | -| common_meaning | `ERROR` | Comprobación del código si no es una señal | -| signal_number | `9` | Número de señal correspondiente al código de salida, sólo si está señalizada | -| signal_name | `KILL` | Nombre de la señal correspondiente al código de salida, sólo si está señalizada | -| maybe_int | `7` | Contiene el número de código de salida cuando no se ha encontrado ningún significado | -| pipestatus | | Renderizado en los códigos de salida de los programas del pipeline, esto sólo está disponible en pipestatus_format | -| symbol | | Refleja el valor de la opción `symbol` | -| style\* | | Refleja el valor de la opción `style` | +| Variable | Ejemplo | Descripción | +| -------------- | ------- | ------------------------------------------------------------------------------------------- | +| status | `127` | El código de salida del último comando | +| hex_status | `0x7F` | The exit code of the last command in hex | +| int | `127` | El código de salida del último comando | +| common_meaning | `ERROR` | Meaning of the code if not a signal | +| signal_number | `9` | Signal number corresponding to the exit code, only if signalled | +| signal_name | `KILL` | Name of the signal corresponding to the exit code, only if signalled | +| maybe_int | `7` | Contains the exit code number when no meaning has been found | +| pipestatus | | Rendering of in pipeline programs's exit codes, this is only available in pipestatus_format | +| symbol | | Refleja el valor de la opción `symbol` | +| style\* | | Refleja el valor de la opción `style` | \*: Esta variable sólo puede ser usada como parte de una cadena de estilo @@ -2834,9 +2852,9 @@ disabled = false The `sudo` module displays if sudo credentials are currently cached. The module will only be shown if credentials are cached. -::: consejo +::: tip -Este módulo está deshabilitado por defecto. Para activarlo, establece `disabled` a `false` en tu archivo de configuración. +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: @@ -2882,7 +2900,7 @@ disabled = false ## Swift -Por defecto, el módulo `swift` muestra la versión instalada de [Swift](https://swift.org/). El módulo se muestra si algunas de las siguientes condiciones se cumplen: +By default the `swift` module shows the currently installed version of [Swift](https://swift.org/). El módulo se muestra si algunas de las siguientes condiciones se cumplen: - El directorio actual contiene un archivo `Package.swift` - El directorio actual contiene un archivo con la extensión `.swift` @@ -2921,11 +2939,11 @@ format = "via [🏎 $version](red bold)" ## Terraform -El módulo `Terraform` muestra el espacio de trabajo de [Terraform](https://www.terraform.io/docs/language/state/workspaces.html) y la versión seleccionados actualmente. +The `terraform` module shows the currently selected [Terraform workspace](https://www.terraform.io/docs/language/state/workspaces.html) and version. -::: consejo +::: tip -Por defecto no se muestra la versión de Terraform, ya que esto es lento para las versiones actuales de Terraform cuando hay muchos complementos en uso. Si aún deseas activarlo, [sigue el ejemplo que se muestra a continuación](#with-terraform-version). +By default the Terraform version is not shown, since this is slow for current versions of Terraform when a lot of plugins are in use. If you still want to enable it, [follow the example shown below](#with-terraform-version). ::: @@ -2980,11 +2998,11 @@ format = "[🏎💨 $workspace]($style) " ## Hora -El módulo `time` muestra la hora **local** actual. El valor de configuración de `format` es usado por la caja de [`chrono`](https://crates.io/crates/chrono) para controlar cómo se muestra la hora. Echa un vistazo a [los documentos de chrono strftime](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) para ver qué opciones están disponibles. +The `time` module shows the current **local** time. The `format` configuration value is used by the [`chrono`](https://crates.io/crates/chrono) crate to control how the time is displayed. Take a look [at the chrono strftime docs](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) to see what options are available. -::: consejo +::: tip -Este módulo está deshabilitado por defecto. Para activarlo, establece `disabled` a `false` en tu archivo de configuración. +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: @@ -3000,7 +3018,7 @@ Este módulo está deshabilitado por defecto. Para activarlo, establece `disable | `disabled` | `true` | Desactiva el módulo `time`. | | `time_range` | `"-"` | Establece el intervalo de tiempo durante el cual el módulo se mostrará. La hora debe ser especificada en formato de 24 horas | -Si `use_12hr` es `true`, entonces `time_format` por defecto `"%r"`. De lo contrario, el valor por defecto es `"%T"`. Configurar manualmente `time_format` sobrescribirá la configuración `use_12hr`. +If `use_12hr` is `true`, then `time_format` defaults to `"%r"`. Otherwise, it defaults to `"%T"`. Manually setting `time_format` will override the `use_12hr` setting. ### Variables @@ -3026,16 +3044,16 @@ time_range = "10:00:00-14:00:00" ## Nombre de usuario -El módulo `username` muestra el nombre de usuario activo. El módulo se muestra si algunas de las siguientes condiciones se cumplen: +The `username` module shows active user's username. El módulo se muestra si algunas de las siguientes condiciones se cumplen: - El usuario actual es root - El usuario actual no es el mismo que el que está conectado - El usuario está actualmente conectado como una sesión SSH - La variable `show_always` se establece en true -::: consejo +::: tip -La conexión SSH se detecta comprobando las variables de entorno `SSH_CONNECTION`, `SSH_CLIENT`, y `SSH_TTY`. Si su host SSH no configura estas variables, una solución es establecer una de ellas con un valor tonto. +SSH connection is detected by checking environment variables `SSH_CONNECTION`, `SSH_CLIENT`, and `SSH_TTY`. If your SSH host does not set up these variables, one workaround is to set one of them with a dummy value. ::: @@ -3071,7 +3089,7 @@ show_always = true ## Vagrant -El módulo `vagrant` muestra la versión instalada de [Vagrant](https://www.vagrantup.com/). Por defecto, el módulo se mostrará si se cumplen cualquiera de las siguientes condiciones: +The `vagrant` module shows the currently installed version of [Vagrant](https://www.vagrantup.com/). Por defecto, el módulo se mostrará si se cumplen cualquiera de las siguientes condiciones: - El directorio actual contiene un archivo `Vagrantfile` @@ -3109,7 +3127,7 @@ format = "via [⍱ $version](bold white) " ## V -El módulo `vlang` te muestra la versión instalada de [V](https://vlang.io/). Por defecto, el módulo se mostrará si se cumplen cualquiera de las siguientes condiciones: +The `vlang` module shows you your currently installed version of [V](https://vlang.io/). Por defecto, el módulo se mostrará si se cumplen cualquiera de las siguientes condiciones: - El directorio actual contiene un archivo con la extensión `.v` - El directorio actual contiene un archivo `v.mod`, `vpkg.json` o `.vpkg-lock.json` @@ -3144,7 +3162,7 @@ format = "via [V $version](blue bold) " ## VCSH -El módulo `vcsh` muestra el repositorio activo [VCSH](https://github.com/RichiH/vcsh) actual. El módulo sólo se mostrará si un repositorio está actualmente en uso. +The `vcsh` module displays the current active [VCSH](https://github.com/RichiH/vcsh) repository. The module will be shown only if a repository is currently in use. ### Opciones @@ -3176,7 +3194,7 @@ format = "[🆅 $repo](bold blue) " ## Zig -Por defecto, el módulo `zig` muestra la versión instalada de [Zig](https://ziglang.org/). El módulo se muestra si algunas de las siguientes condiciones se cumplen: +By default the the `zig` module shows the currently installed version of [Zig](https://ziglang.org/). El módulo se muestra si algunas de las siguientes condiciones se cumplen: - El directorio actual contiene un archivo `.zig` @@ -3214,9 +3232,9 @@ symbol = "⚡️ " ## Comandos personalizados -Los módulos `personalizados` muestran la salida de algunos comandos arbitrarios. +The `custom` modules show the output of some arbitrary commands. -Estos módulos se mostrarán si se cumplen alguna de las siguientes condiciones: +These modules will be shown if any of the following conditions are met: - El directorio actual contiene un archivo cuyo nombre está en `files` - El directorio actual contiene un directorio cuyo nombre está en `directories` @@ -3224,21 +3242,21 @@ Estos módulos se mostrarán si se cumplen alguna de las siguientes condiciones: - El comando `when` devuelve 0 - El sistema operativo actual (std::env::consts::OS) coincide con el campo `os` si está definido. -::: consejo +::: tip -Múltiples módulos personalizados pueden definirse usando una `.`. +Multiple custom modules can be defined by using a `.`. ::: -::: consejo +::: tip -El orden en el que se muestran los módulos personalizados se puede establecer individualmente incluyendo `${custom.foo}` en el `format` de nivel superior (ya que incluye un punto, necesita usar `${...}`). Por defecto, el módulo `custom` simplemente mostrará todos los módulos personalizados en el orden en que fueron definidos. +The order in which custom modules are shown can be individually set by including `${custom.foo}` in the top level `format` (as it includes a dot, you need to use `${...}`). By default, the `custom` module will simply show all custom modules in the order they were defined. ::: -::: consejo +::: tip -[El issue #1252](https://github.com/starship/starship/discussions/1252) contiene ejemplos de módulos personalizados. Si tiene un ejemplo interesante no cubierto allí, no dude en compartirlo allí! +[Issue #1252](https://github.com/starship/starship/discussions/1252) contains examples of custom modules. If you have an interesting example not covered there, feel free to share it there! ::: @@ -3279,30 +3297,30 @@ Format strings can also contain shell specific prompt sequences, e.g. [Bash](htt #### Comando personalizado del intérprete de comandos -`shell` acepta una lista no vacía de cadenas, donde: +`shell` accepts a non-empty list of strings, where: - La primera cadena es la ruta al intérprete de comandos a usar para ejecutar el comando. - Otros argumentos siguientes son pasados al shell. -Si no está activado, se retornará a STARSHIP_SHELL y luego a "sh" en Linux, y "cmd /C" en Windows. +If unset, it will fallback to STARSHIP_SHELL and then to "sh" on Linux, and "cmd /C" on Windows. -El `comando` será pasado en stdin. +The `command` will be passed in on stdin. -Si no se da el `shell` o solo contiene un elemento y Starship detecta PowerShell los siguientes argumentos se añadirán automáticamente: `-NoProfile -Command -`. Este comportamiento puede evitarse pasando explícitamente argumentos al intérprete, p.ej. +If `shell` is not given or only contains one element and Starship detects PowerShell will be used, the following arguments will automatically be added: `-NoProfile -Command -`. This behavior can be avoided by explicitly passing arguments to the shell, e.g. ```toml shell = ["pwsh", "-Command", "-"] ``` -::: advertencia Asegúrate de que tu configuración personalizada de shell salga con éxito +::: warning Make sure your custom shell configuration exits gracefully -Si establece un comando personalizado, asegúrese de que el Shell por defecto usado por starship ejecutará correctamente el comando con una salida elgante (a través de la opción `shell`). +If you set a custom command, make sure that the default Shell used by starship will properly execute the command with a graceful exit (via the `shell` option). -Por ejemplo, PowerShell requiere el parámetro `-Command` para ejecutar una sola línea. Omitir este parámetro puede arrojar a starchip a un bucle recursivo donde el shell podría intentar cargar un entorno de perfil completo con starship en sí misma y volver a ejecutar el comando personalizado, entrando en un bucle infinito. +For example, PowerShell requires the `-Command` parameter to execute a one liner. Omitting this parameter might throw starship into a recursive loop where the shell might try to load a full profile environment with starship itself again and hence re-execute the custom command, getting into a never ending loop. -Se recomiendan parámetros similares a `-NoProfile` en PowerShell para otros shells para evitar tiempo extra de carga de un perfil personalizado en cada invocación de starship. +Parameters similar to `-NoProfile` in PowerShell are recommended for other shells as well to avoid extra loading time of a custom profile on every starship invocation. -La detección automática de shells y la adición adecuada de parámetros están actualmente implementados, pero es posible que no todos los shells estén cubiertos. Por favor, [abre un issue](https://github.com/starship/starship/issues/new/choose) con los detalles del intérprete de comandos y la configuración de Starship si te encuentras en tal escenario. +Automatic detection of shells and proper parameters addition are currently implemented, but it's possible that not all shells are covered. [Please open an issue](https://github.com/starship/starship/issues/new/choose) with shell details and starship configuration if you hit such scenario. ::: @@ -3312,8 +3330,8 @@ La detección automática de shells y la adición adecuada de parámetros están # ~/.config/starship.toml [custom.foo] -command = "echo foo" # muestra la salida del comando -files = ["foo"] # se puede especificar filtros pero los wildcards no son soportados +command = "echo foo" # shows output of command +files = ["foo"] # can specify filters but wildcards are not supported when = """ test "$HOME" == "$PWD" """ format = " transcending [$output]($style)" diff --git a/docs/es-ES/faq/README.md b/docs/es-ES/faq/README.md index a955ff597..6e1bd35dd 100644 --- a/docs/es-ES/faq/README.md +++ b/docs/es-ES/faq/README.md @@ -69,13 +69,13 @@ Si ves símbolos que no reconoces, puedes usar `starship explain` para explicar You can enable the debug logs by using the `STARSHIP_LOG` env var. These logs can be very verbose so it is often useful to use the `module` command if you are trying to debug a particular module, for example, if you are trying to debug the `rust` module you could run the following command to get the trace logs and output from the module. ```sh -env STARHIP_LOG=trace starship module rust +env STARSHIP_LOG=trace starship module rust ``` If starship is being slow you can try using the `timings` command to see if there is a particular module or command that to blame. ```sh -env STARHIP_LOG=trace starship timings +env STARSHIP_LOG=trace starship timings ``` This will output the trace log and a breakdown of all modules that either took more than 1ms to execute or produced some output. @@ -117,6 +117,6 @@ Si Starship fue instalado usando un gestor de paquetes, por favor refiérete a s Si Starship fue instalado usando el guión de instalación, el siguiente comando eliminará el binario: ```sh -# Localiza y elimina el binario de starship -sh -c 'rm "$(which starship)"' +# Locate and delete the starship binary +sh -c 'rm "$(command -v 'starship')"' ``` diff --git a/docs/es-ES/guide/README.md b/docs/es-ES/guide/README.md index 5cbd930c6..8598cc680 100644 --- a/docs/es-ES/guide/README.md +++ b/docs/es-ES/guide/README.md @@ -72,6 +72,22 @@ height="20" src="https://raw.githubusercontent.com/starship/starship/master/media/flag-fr.png" alt="Français" + />
+   + Bahasa indonesio +   + Italiano   日本語   Português do Brasil   Русский   Tiếng Việt   简体中文   繁體中文

@@ -252,7 +268,7 @@ #### Elvish - **Advertencia** Sólo se admite Elvish v0.15 o superior. Añade el siguiente código al final de `~/.elvish/rc.elv`: + **Warning** Only elvish v0.17 or higher is supported. Añade el siguiente código al final de `~/.elvish/rc.elv`: ```sh # ~/.elvish/rc.elv @@ -283,9 +299,20 @@ ``` + #### Cmd + + You need to use [Clink](https://chrisant996.github.io/clink/clink.html) (v1.2.30+) with Cmd. Add the following to a file `starship.lua` and place this file in Clink scripts directory: + + ```lua + -- starship.lua + + load(io.popen('starship init cmd'):read("*a"))() + ``` + + #### Nushell - **Advertencia** Esto cambiará en el futuro. Sólo se admite la versión nu v0.33 o superior. Añade lo siguiente a tu archivo de configuración nu. Puedes comprobar la ubicación de este archivo ejecutando `ruta de configuración` en nu. + **Warning** This will change in the future. Sólo se admite la versión nu v0.33 o superior. Add the following to your nu config file. Puedes comprobar la ubicación de este archivo ejecutando `ruta de configuración` en nu. ```toml startup = [ diff --git a/docs/es-ES/presets/README.md b/docs/es-ES/presets/README.md index fb1d86849..fd177a1ed 100644 --- a/docs/es-ES/presets/README.md +++ b/docs/es-ES/presets/README.md @@ -224,7 +224,7 @@ format = '\[[$symbol($version)]($style)\]' format = '\[[$symbol($version)]($style)\]' [sudo] -format = '\[[as $symbol]\] +format = '\[[as $symbol]\]' [swift] format = '\[[$symbol($version)]($style)\]' diff --git a/docs/fr-FR/README.md b/docs/fr-FR/README.md index e609a4527..6c6d731f8 100644 --- a/docs/fr-FR/README.md +++ b/docs/fr-FR/README.md @@ -18,7 +18,7 @@ features: footer: Licence ISC | Copyright © 2019-présent Contributeurs Starship #Used for the description meta tag, for SEO metaTitle: "Starship : Invite Multi-Shell" -description: Starship est une invite minimaliste, ultra-rapide et hautement personnalisable pour n'importe quel shell ! Montre les informations dont vous avez besoin tout en restant élégante et minimaliste. Quick installation available for Bash, Fish, ZSH, Ion, Tcsh, Elvish, Nu, Xonsh, and PowerShell. +description: Starship est une invite minimaliste, ultra-rapide et hautement personnalisable pour n'importe quel shell ! Montre les informations dont vous avez besoin tout en restant élégante et minimaliste. Quick installation available for Bash, Fish, ZSH, Ion, Tcsh, Elvish, Nu, Xonsh, Cmd, and PowerShell. ---
@@ -119,7 +119,7 @@ description: Starship est une invite minimaliste, ultra-rapide et hautement pers #### Elvish - ::: warning Seul elvish v0.15 ou supérieur est pris en charge. ::: + ::: warning Seul elvish v0.17 ou supérieur est pris en charge. ::: Ajoutez ce qui suit à la fin de `~/.elvish/rc.elv`: @@ -143,7 +143,7 @@ description: Starship est une invite minimaliste, ultra-rapide et hautement pers #### Nushell - ::: warning This will change in the future. Seule la version nu v0.33 ou supérieure est prise en charge. ::: Add the following to your nu config file. Vous pouvez vérifier l'emplacement de ce fichier en exécutant `config path` dans 'nu'. + ::: warning Cela va changer dans le futur. Seule la version nu v0.33 ou supérieure est prise en charge. Ajoutez ce qui suit à votre fichier de configuration nu. Vous pouvez vérifier l'emplacement de ce fichier en exécutant `config path` dans 'nu'. ```toml startup = [ @@ -164,3 +164,14 @@ description: Starship est une invite minimaliste, ultra-rapide et hautement pers execx($(starship init xonsh)) ``` + + + #### Cmd + + You need to use [Clink](https://chrisant996.github.io/clink/clink.html) (v1.2.30+) with Cmd. Add the following to a file `starship.lua` and place this file in Clink scripts directory: + + ```lua + -- starship.lua + + load(io.popen('starship init cmd'):read("*a"))() + ``` diff --git a/docs/fr-FR/advanced-config/README.md b/docs/fr-FR/advanced-config/README.md index 2c8ca104c..52c6f94ed 100644 --- a/docs/fr-FR/advanced-config/README.md +++ b/docs/fr-FR/advanced-config/README.md @@ -8,11 +8,35 @@ Les configurations dans cette section sont sujettes à modification dans les fut ::: -## Commandes pré-commande et pré-exécution personnalisées en Bash +## Custom pre-prompt and pre-execution Commands in Cmd -Bash n'a pas de structure officielle préexec/précmd comme la plupart des autres shells. C'est pourquoi il est difficile de fournir des hooks entièrement personnalisables dans `bash`. Cependant, Starship vous permet dans une certaine mesure d'insérer vos propres fonctions dans la procédure de rendu du prompt : +Clink provides extremely flexible APIs to run pre-prompt and pre-exec commands in Cmd shell. It is fairly simple to use with Starship. Make the following changes to your `starship.lua` file as per your requirements: -- Pour exécuter une fonction personnalisée juste avant que le prompt ne soit dessiné, définissez une nouvelle fonction et assignez son nom à `starship_precmd_user_func`. Par exemple, pour dessiner une fusée avant la commande, vous feriez +- To run a custom function right before the prompt is drawn, define a new function called `starship_preprompt_user_func`. This function receives the current prompt as a string that you can utilize. For example, to draw a rocket before the prompt, you would do + +```lua +function starship_preprompt_user_func(prompt) + print("🚀") +end + +load(io.popen('starship init cmd'):read("*a"))() +``` + +- To run a custom function right before a command is executed, define a new function called `starship_precmd_user_func`. This function receives the current commandline as a string that you can utilize. For example, to print the command that's about to be executed, you would do + +```lua +function starship_precmd_user_func(line) + print("Executing: "..line) +end + +load(io.popen('starship init cmd'):read("*a"))() +``` + +## Custom pre-prompt and pre-execution Commands in Bash + +Bash does not have a formal preexec/precmd framework like most other shells. Because of this, it is difficult to provide fully customizable hooks in `bash`. Cependant, Starship vous permet dans une certaine mesure d'insérer vos propres fonctions dans la procédure de rendu du prompt : + +- To run a custom function right before the prompt is drawn, define a new function and then assign its name to `starship_precmd_user_func`. For example, to draw a rocket before the prompt, you would do ```bash function blastoff(){ @@ -21,13 +45,13 @@ function blastoff(){ starship_precmd_user_func="blastoff" ``` -- Pour exécuter une fonction personnalisée juste avant l'exécution d'une commande, vous pouvez utiliser le [ mécanisme d'interruption du signal ` DEBUG`](https://jichu4n.com/posts/debug-trap-and-prompt_command-in-bash/). Cependant, vous **devez** piéger le signal DEBUG *avant* l'initialisation de Starship ! Starship peut préserver la valeur du piège DEBUG, mais si le piège est écrasé après le démarrage de Starship, certaines fonctionnalités vont casser. +- To run a custom function right before a command runs, you can use the [`DEBUG` trap mechanism](https://jichu4n.com/posts/debug-trap-and-prompt_command-in-bash/). However, you **must** trap the DEBUG signal *before* initializing Starship! Starship can preserve the value of the DEBUG trap, but if the trap is overwritten after starship starts up, some functionality will break. ```bash function blastoff(){ echo "🚀" } -trap blastoff DEBUG # Pièger DEBUG *avant* l'initialisation de starship +trap blastoff DEBUG # Trap DEBUG *before* running starship eval $(starship init bash) ``` @@ -43,35 +67,35 @@ function Invoke-Starship-PreCommand { } ``` -## Modifier le titre des fenêtres +## Change Window Title -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`. +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`, `zsh`, `cmd` or `powershell`. -Tout d'abord, définissez une fonction de changement de titre de fenêtre (identique en bash et zsh) : +First, define a window title change function (identical in bash and zsh): ```bash -function set_titre_fenetre(){ - echo -ne "\033]0; VOTRE_TITRE_ICI\007" +function set_win_title(){ + echo -ne "\033]0; YOUR_WINDOW_TITLE_HERE \007" } ``` -Vous pouvez utiliser des variables pour personnaliser ce titre (`$USER`, `$HOSTNAME`, et `$PWD` sont des choix populaires). +You can use variables to customize this title (`$USER`, `$HOSTNAME`, and `$PWD` are popular choices). -Dans `bash`, définissez cette fonction comme la fonction précommande Starship : +In `bash`, set this function to be the precmd starship function: ```bash -starship_precmd_user_func="set_titre_fenetre" +starship_precmd_user_func="set_win_title" ``` -Dans `zsh`, ajoutez ceci au tableau `precmd_functions` : +In `zsh`, add this to the `precmd_functions` array: ```bash -precmd_functions+=(set_titre_fenetre) +precmd_functions+=(set_win_title) ``` -Si vous aimez le résultat, ajoutez ces lignes à votre fichier de configuration shell (`~/.bashrc` ou `~/.zshrc`) pour le rendre permanent. +If you like the result, add these lines to your shell configuration file (`~/.bashrc` or `~/.zshrc`) to make it permanent. -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`: +For example, if you want to display your current directory in your terminal tab title, add the following snippet to your `~/.bashrc` or `~/.zshrc`: ```bash function set_win_title(){ @@ -80,6 +104,16 @@ function set_win_title(){ starship_precmd_user_func="set_win_title" ``` +For Cmd, you can change the window title using the `starship_preprompt_user_func` function. + +```lua +function starship_preprompt_user_func(prompt) + console.settitle(os.getenv('USERNAME').."@"..os.getenv('COMPUTERNAME')..": "..os.getcwd()) +end + +load(io.popen('starship init cmd'):read("*a"))() +``` + You can also set a similar output with PowerShell by creating a function named `Invoke-Starship-PreCommand`. ```powershell @@ -97,7 +131,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). -`right_format` is currently supported for the following shells: elvish, fish, zsh. +`right_format` is currently supported for the following shells: elvish, fish, zsh, xonsh, cmd. ### Exemple @@ -117,29 +151,51 @@ Produces a prompt like the following: ▶ starship on  rprompt [!] is 📦 v0.57.0 via 🦀 v1.54.0 took 17s ``` +## Continuation Prompt + +Some shells support a continuation prompt along with the normal prompt. This prompt is rendered instead of the normal prompt when the user has entered an incomplete statement (such as a single left parenthesis or quote). + +Starship can set the continuation prompt using the `continuation_prompt` option. The default prompt is `"[∙](bright-black) "`. + +Note: `continuation_prompt` should be set to a literal string without any variables. + +Note: Continuation prompts are only available in the following shells: + + - `bash` + - `zsh` + - `PowerShell` + +### Exemple + +```toml +# ~/.config/starship.toml + +# A continuation prompt that displays two filled in arrows +continuation_prompt = "▶▶" +``` ## Chaînes de style -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 : +Style strings are a list of words, separated by whitespace. The words are not case sensitive (i.e. `bold` and `BoLd` are considered the same string). Each word can be one of the following: - `bold` - `italic` - `underline` - `dimmed` - `inverted` - - `bg:` - - `fg:` - - `` + - `bg:` + - `fg:` + - `` - `none` -où `` est un spécificateur de couleur (discuté ci-dessous). `fg:` et `` 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. +where `` is a color specifier (discussed below). `fg:` and `` 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. -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. +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. -Un spécificateur de couleur peut être l'un des éléments suivants : +A color specifier can be one of the following: - - 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 nombre entre 0 et 255. Ceci spécifie un [code de couleur ANSI 8 bits](https://i.stack.imgur.com/KTSQa.png). + - One of the standard terminal colors: `black`, `red`, `green`, `blue`, `yellow`, `purple`, `cyan`, `white`. You can optionally prefix these with `bright-` to get the bright version (e.g. `bright-white`). + - A `#` followed by a six-digit hexadecimal number. This specifies an [RGB color hex code](https://www.w3schools.com/colors/colors_hexadecimal.asp). + - A number between 0-255. This specifies an [8-bit ANSI Color Code](https://i.stack.imgur.com/KTSQa.png). -Si plusieurs couleurs sont spécifiées pour le premier plan/arrière-plan, la dernière dans le string prendra la priorité. +If multiple colors are specified for foreground/background, the last one in the string will take priority. diff --git a/docs/fr-FR/config/README.md b/docs/fr-FR/config/README.md index 6cac176df..94ca10c23 100644 --- a/docs/fr-FR/config/README.md +++ b/docs/fr-FR/config/README.md @@ -24,18 +24,24 @@ disabled = true Vous pouvez changer l'emplacement par défaut du fichier avec la variable d'environnement `STARSHIP_CONFIG` : ```sh -export STARSHIP_CONFIG=~/.starship/config.toml +export STARSHIP_CONFIG=~/example/non/default/path/starship.toml ``` De manière équivalente, pour Powershell (Windows), ajoutez la ligne suivante à votre `$PROFILE`: ```powershell -$ENV:STARSHIP_CONFIG = "$HOME\.starship\config.toml" +$ENV:STARSHIP_CONFIG = "$HOME\example\non\default\path\starship.toml" +``` + +Or for Cmd (Windows) would be adding this line to your `starship.lua`: + +```lua +os.setenv('STARSHIP_CONFIG', 'C:\\Users\\user\\example\\non\\default\\path\\starship.toml') ``` ### Journalisation -Par défaut, Starship enregistre les avertissements et les erreurs dans un fichier nommé `~/.cache/starship/session_${STARSHIP_SESSION_KEY}.log`, où la clé de session correspond à une instance de votre terminal. Ceci peut cependant être modifié en utilisant la variable d'environnement `STARSHIP_CACHE`: +By default starship logs warnings and errors into a file named `~/.cache/starship/session_${STARSHIP_SESSION_KEY}.log`, where the session key is corresponding to a instance of your terminal. This, however can be changed using the `STARSHIP_CACHE` environment variable: ```sh export STARSHIP_CACHE=~/.starship/cache @@ -47,23 +53,29 @@ De manière équivalente, pour Powershell (Windows), ajoutez la ligne suivante $ENV:STARSHIP_CACHE = "$HOME\AppData\Local\Temp" ``` +Or for Cmd (Windows) would be adding this line to your `starship.lua`: + +```lua +os.setenv('STARSHIP_CACHE', 'C:\\Users\\user\\AppData\\Local\\Temp') +``` + ### Terminologie -**Module**: Un composant dans l'invite donnant des informations basées sur des informations contextuelles à propos de votre Système d'Exploitation. Par exemple, le module "nodejs" montre la version de Node.js qui est actuellement installée sur votre ordinateur, si votre répertoire actuel est un projet Node.js. +**Module**: A component in the prompt giving information based on contextual information from your OS. For example, the "nodejs" module shows the version of Node.js that is currently installed on your computer, if your current directory is a Node.js project. -**Variable**: Petits sous-composants qui contiennent des informations fournies par le module. Par exemple, la variable "version" dans le module "nodejs" contient la version actuelle de Node.js. +**Variable**: Smaller sub-components that contain information provided by the module. For example, the "version" variable in the "nodejs" module contains the current version of Node.js. -Par convention, la plupart des modules ont un préfixe de la couleur par défaut du terminal (par exemple `via` dans "nodejs") et un espace vide comme suffixe. +By convention, most modules have a prefix of default terminal color (e.g. `via` in "nodejs") and an empty space as a suffix. ### Chaîne de formatage -Les chaînes de formatage sont le format avec lequel un module affiche toutes ses variables. La plupart des modules ont une entrée appelée `format` qui configure le format d'affichage du module. Vous pouvez utiliser des textes, des variables et des groupes de texte dans une chaîne de format. +Format strings are the format that a module prints all its variables with. Most modules have an entry called `format` that configures the display format of the module. You can use texts, variables and text groups in a format string. #### Variable -Une variable contient un symbole `$` suivi du nom de la variable. The name of a variable can only contain 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 `_`. -Par exemple : +For example: - `$version` est une chaîne de formatage avec une variable nommée `version`. - `$git_branch$git_commit` est une chaîne de formatage avec deux variables appelées `git_branch` et `git_commit`. @@ -71,13 +83,13 @@ Par exemple : #### Groupe de texte -Un groupe de texte se compose de deux parties différentes. +A text group is made up of two different parts. -La première partie, qui est entourée dans un `[]`, est une [chaîne de formatage](#format-strings). Vous pouvez y ajouter des textes, des variables, ou même des groupes de texte imbriqués. +The first part, which is enclosed in a `[]`, is a [format string](#format-strings). You can add texts, variables, or even nested text groups in it. -La deuxième partie, qui est entourée par `()`, est une [chaîne de style](#style-strings). This can be used to style the first part. +In the second part, which is enclosed in a `()`, is a [style string](#style-strings). This can be used to style the first part. -Par exemple : +For example: - `[on](red bold)` affichera une chaîne de caractères `on` avec un texte gras de couleur rouge. - `[⌘ $version](bold green)` affichera le symbole `⌘` suivi par le contenu de la variable `version`, en texte gras de couleur verte. @@ -85,7 +97,7 @@ Par exemple : #### Chaînes de style -La plupart des modules de Starship vous permettent de configurer leurs styles d'affichage. Cela se fait avec une entrée (généralement appelée `style`) qui est une chaîne de caractères spécifiant la configuration. Voici quelques exemples de chaînes de style avec ce qu'elles font. Pour plus de détails sur la syntaxe complète, consultez le [guide de configuration avancé](/advanced-config/). +Most modules in starship allow you to configure their display styles. This is done with an entry (usually called `style`) which is a string specifying the configuration. Here are some examples of style strings along with what they do. For details on the full syntax, consult the [advanced config guide](/advanced-config/). - `"fg:green bg:blue"` définit un texte vert sur un fond bleu - `"bg:blue fg:bright-green"` définit un texte vert clair sur un fond bleu @@ -94,36 +106,36 @@ La plupart des modules de Starship vous permettent de configurer leurs styles d' - `"bold italic fg:purple"` définit le texte en italique et gras sur un fond violet - `""` désactive explicitement tous les styles -Notez que ce style sera contrôlé par votre émulateur de terminal. Par exemple, certains émulateurs de terminal éclairciront les couleurs au lieu de mettre le texte en gras, et certains thèmes de couleurs utilisent les mêmes valeurs pour les couleurs normales et claires. De plus, pour obtenir du texte italique, votre terminal doit prendre en charge l'italique. +Note that what styling looks like will be controlled by your terminal emulator. For example, some terminal emulators will brighten the colors instead of bolding text, and some color themes use the same values for the normal and bright colors. Also, to get italic text, your terminal must support italics. #### Chaînes de formatage conditionnel -Une chaîne de formatage conditionnel enveloppée dans `(` et `)` ne sera pas rendue si toutes les variables à l'intérieur sont vides. +A conditional format string wrapped in `(` and `)` will not render if all variables inside are empty. -Par exemple : +For example: -- `(@$region)` will show nothing if the variable `region` is `None` or empty string, otherwise `@` followed by the value of region. +- `(@$region)` n’affichera rien si la variable `region` est `None` or une chaine vide, sinon `@` suivi par la valeur de region. - `(some text)` ne montrera toujours rien puisqu'il n'y a pas de variables enveloppées dans les accolades. - Lorsque `$all` est un raccourci pour `\[$a$b\]`, `($all)` ne montrera rien que si `$a` et `$b` sont tous les deux `None`. Cela fonctionne comme `(\[$a$b\] )`. -#### Special characters +#### Caractères spéciaux 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 `\\`). -Par exemple, lorsque vous voulez imprimer un symbole `$` sur une nouvelle ligne, les configurations suivantes pour le `formatage` sont équivalentes : +For example, when you want to print a `$` symbol on a new line, the following configs for `format` are equivalent: ```toml -# avec la chaîne de base +# with basic string format = "\n\\$" -# avec la chaîne de caractères de base multiligne +# with multiline basic string format = """ \\$""" -# avec la chaîne littérale +# with literal string format = ''' \$''' @@ -131,7 +143,7 @@ format = ''' ## Invite -Voici la liste des options de configuration de l'invite en lui-même. +This is the list of prompt-wide configuration options. ### Options @@ -147,24 +159,24 @@ Voici la liste des options de configuration de l'invite en lui-même. ### Exemple ```toml -# ~/.config/starship. oml +# ~/.config/starship.toml -# Utilisez un format personnalisé +# Use custom format format = """ [┌───────────────────>](bold green) [│](bold green)$directory$rust$package [└─>](bold green) """ -# Attendez 10 millisecondes pour que starship vérifie les fichiers dans le répertoire de travail. +# Wait 10 milliseconds for starship to check files under the current directory. scan_timeout = 10 -# Désactive la nouvelle ligne au début de l'invite +# Disable the blank line at the start of the prompt add_newline = false ``` ### Format par Défaut -Le `format` par défaut est utilisé pour définir le format de l'invite, si il est vide ou mal `formaté`. La valeur par défaut est la suivante : +The default `format` is used to define the format of the prompt, if empty or no `format` is provided. The default is as shown: ```toml format = "$all" @@ -248,13 +260,13 @@ format="$all$directory$character" ## AWS -Le module `aws` affiche la région et le profil AWS courant. Ces informations sont basées sur les variables d'environnement `AWS_REGION`, `AWS_DEFAULT_REGION`, et `AWS_PROFILE` ainsi que le fichier `~/.aws/config`. Ce module affiche également un minuteur d'expiration lorsque vous utilisez des identifiants temporaires. +The `aws` module shows the current AWS region and profile. This is based on `AWS_REGION`, `AWS_DEFAULT_REGION`, and `AWS_PROFILE` env var with `~/.aws/config` file. This module also shows an expiration timer when using temporary credentials. -Lorsque vous utilisez [aws-vault](https://github.com/99designs/aws-vault) le profil est lu à partir de la variable d'environnement `AWS_VAULT` et la date d'expiration des identifiants est lue à partir de la variable d'environnement `AWS_SESSION_EXPIRATION`. +When using [aws-vault](https://github.com/99designs/aws-vault) the profile is read from the `AWS_VAULT` env var and the credentials expiration date is read from the `AWS_SESSION_EXPIRATION` env var. -Lorsque vous utilisez [awsu](https://github.com/kreuzwerker/awsu) le profil est lu depuis la variable d'environnement `AWSU_PROFILE`. +When using [awsu](https://github.com/kreuzwerker/awsu) the profile is read from the `AWSU_PROFILE` env var. -Lorsque vous utilisez [AWSume](https://awsu.me) le profil est lu à partir de la variable d'environnement `AWSUME_PROFILE` et la date d'expiration des identifiants est lue à partir de la variable d'environnement `AWSUME_EXPIRATION`. +When using [AWSume](https://awsu.me) the profile is read from the `AWSUME_PROFILE` env var and the credentials expiration date is read from the `AWSUME_EXPIRATION` env var. ### Options @@ -326,12 +338,12 @@ The `azure` module shows the current Azure Subscription. This is based on showin ### Options -| Variable | Default | Description | -| ---------- | ---------------------------------------- | ------------------------------------------ | -| `format` | `"on [$symbol($subscription)]($style) "` | The format for the Azure module to render. | -| `symbol` | `"ﴃ "` | The symbol used in the format. | -| `style` | `"blue bold"` | The style used in the format. | -| `disabled` | `true` | Disables the `azure` module. | +| Variable | Default | Description | +| ---------- | ---------------------------------------- | ------------------------------------------------------ | +| `format` | `"on [$symbol($subscription)]($style) "` | Le format utilisé pour faire le rendu du module Azure. | +| `symbol` | `"ﴃ "` | Le symbole utilisé dans le format. | +| `style` | `"blue bold"` | Le style utilisé dans le format. | +| `disabled` | `true` | Désactive le module `azure`. | ### Exemple @@ -347,7 +359,7 @@ style = "blue bold" ## Battery -Le module `battery` montre à quel point la batterie de l'appareil est chargée et son état de charge actuel. Ce module n'est visible que lorsque la batterie de l'appareil est inférieure à 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%. ### Options @@ -375,7 +387,7 @@ discharging_symbol = "💀 " ### Indicateur de batterie -L'option de configuration `display` est utilisée pour définir quand l'indicateur de batterie doit être affiché (threshold), quel symbole doit être utilisé (symbol) et à quoi il ressemble (style). Si aucun `display` n'est fourni. La valeur par défaut est la suivante : +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. The default is as shown: ```toml [[battery.display]] @@ -383,11 +395,11 @@ threshold = 10 style = "bold red" ``` -La valeur par défaut pour les options `charging_symbol` et `discharging_symbol` est respectivement la valeur des options `charging_symbol` et `discharging_symbol` du module `battery`. +The default value for the `charging_symbol` and `discharging_symbol` option is respectively the value of `battery`'s `charging_symbol` and `discharging_symbol` option. #### Options -L'option `display` est une array de la table suivante. +The `display` option is an array of the following table. | Option | Défaut | Description | | -------------------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------- | @@ -414,24 +426,24 @@ discharging_symbol = "💦" ## Character -Le module `character` affiche un caractère (habituellement une flèche) à côté de l'endroit où le texte est entré dans votre terminal. +The `character` module shows a character (usually an arrow) beside where the text is entered in your terminal. -Le caractère vous dira si la dernière commande a été réussie ou pas. Cela peut être fait de deux manières: +The character will tell you whether the last command was successful or not. It can do this in two ways: - changement de couleur (`red`/`green`) - changement de forme (`❯`/`✖`) -Par défaut, il ne change que la couleur. Si vous désirez également changer sa forme, jetez un œil à [cet exemple](#with-custom-error-shape). +By default it only changes color. If you also want to change its shape take a look at [this example](#with-custom-error-shape). ::: warning -`error_symbol` is not supported on elvish and nu shell. +`error_symbol` is not supported on nu shell. ::: ::: warning -`vicmd_symbol` n'est supporté qu'avec fish et zsh. +`vicmd_symbol` is only supported in cmd, fish and zsh. ::: @@ -484,7 +496,7 @@ vicmd_symbol = "[V](bold green) " ## CMake -Le module `cmake` affiche la version actuellement installée de [CMake](https://cmake.org/). Par défaut le module sera activé si au moins l'une des conditions suivantes est remplie: +The `cmake` module shows the currently installed version of [CMake](https://cmake.org/). By default the module will be activated if any of the following conditions are met: - Le répertoire actuel contient un fichier `CMakeLists.txt` - Le répertoire actuel contient un fichier ` CMakeCache.txt` @@ -516,27 +528,27 @@ Le module `cmake` affiche la version actuellement installée de [CMake](https:// The `cobol` module shows the currently installed version of COBOL. By default, the module will be shown if any of the following conditions are met: -- The current directory contains any files ending in `.cob` or `.COB` -- The current directory contains any files ending in `.cbl` or `.CBL` +- Le répertoire courant contient un fichier finissant par `.cob` ou `.COB` +- Le répertoire courant contiens un fichier finissant par `.cbl` ou `.CBL` ### Options | Option | Défaut | Description | | ------------------- | ------------------------------------ | ------------------------------------------------------------------------------------------ | -| `symbol` | `"⚙️ "` | The symbol used before displaying the version of COBOL. | +| `symbol` | `"⚙️ "` | Le symbole utilisé avant d’afficher la version de COBOL. | | `format` | `"via [$symbol($version )]($style)"` | Format du module. | | `version_format` | `"v${raw}"` | Le format de la version. Les variables disponibles sont `raw`, `major`, `minor`, & `patch` | | `style` | `"bold blue"` | Le style du module. | | `detect_extensions` | `["cbl", "cob", "CBL", "COB"]` | Quelles extensions devraient activer ce module. | | `detect_files` | `[]` | Quels fichiers devraient activer ce module. | | `detect_folders` | `[]` | Quels dossiers devraient activer ce module. | -| `disabled` | `false` | Disables the `cobol` module. | +| `disabled` | `false` | Désactive le module `cobol`. | ### Variables | Variable | Exemple | Description | | --------- | ---------- | -------------------------------------- | -| version | `v3.1.2.0` | The version of `cobol` | +| version | `v3.1.2.0` | La version de `cobol` | | symbol | | Reflète la valeur de l'option `symbol` | | style\* | | Reflète la valeur de l'option `style` | @@ -544,15 +556,15 @@ The `cobol` module shows the currently installed version of COBOL. By default, t ## Temps d'exécution -Le module `cmd_duration` montre le temps qu'a pris la dernière commande a pris pour s'exécuter. Le module ne sera affiché que si la commande a pris plus de deux secondes, ou si la valeur de configuration `min_time` existe. +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. -::: attention, n'accrochez pas la trappe DEBUG en Bash +::: warning Do not hook the DEBUG trap in Bash -Si vous utilisez starship en `bash`, n'accrochez pas `DEBUG` après avoir exécuté `eval $(starship init $0)`, ou ce module **cassera**. +If you are running Starship in `bash`, do not hook the `DEBUG` trap after running `eval $(starship init $0)`, or this module **will** break. ::: -Les utilisateurs de Bash qui ont besoin de fonctionnalité pré-exec peuvent utiliser [rcaloras's bash_preexec framework](https://github.com/rcaloras/bash-preexec). Définissez simplement les array `preexec_functions` et `precmd_functions` avant d'éxécuter `eval $(starship init $0)`, puis procédez comme d'habitude. +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. ### Options @@ -568,7 +580,7 @@ Les utilisateurs de Bash qui ont besoin de fonctionnalité pré-exec peuvent uti ::: tip -L'affichage des notifications de bureau nécessite que starship soit compilé avec la prise en charge de `rust-notify`. Vérifiez si starship supporte les notifications en exécutant `STARSHIP_LOG=debug starship module cmd_duration -d 60000` lorsque `show_notifications` est défini à `true`. +Showing desktop notifications requires starship to be built with `notify-rust` support. You check if your starship supports notifications by running `STARSHIP_LOG=debug starship module cmd_duration -d 60000` when `show_notifications` is set to `true`. ::: @@ -597,7 +609,7 @@ The `conda` module shows the current [Conda](https://docs.conda.io/en/latest/) e ::: tip -Cela ne supprime pas le modificateur d'invite de conda, vous pouvez exécuter `conda config --set changeps1 False`. +This does not suppress conda's own prompt modifier, you may want to run `conda config --set changeps1 False`. ::: @@ -633,7 +645,7 @@ format = "[$symbol$environment](dimmed green) " ## Crystal -Le module `crystal` affiche la version actuellement installée de [Crystal](https://crystal-lang.org/). Par défaut le module sera activé si au moins l'une des conditions suivantes est remplie: +The `crystal` module shows the currently installed version of [Crystal](https://crystal-lang.org/). Par défaut le module sera activé si au moins l'une des conditions suivantes est remplie: - Le répertoire courant contient un fichier `shard.yml` - Le répertoire courant contient un fichier `.cr` @@ -672,7 +684,7 @@ format = "via [✨ $version](bold blue) " ## Dart -Le module `dart` affiche la version actuellement installée de [Dart](https://dart.dev/). Par défaut le module sera activé si au moins l'une des conditions suivantes est remplie: +The `dart` module shows the currently installed version of [Dart](https://dart.dev/). Par défaut le module sera activé si au moins l'une des conditions suivantes est remplie: - Le répertoire courant contient un fichier `.dart` - Le répertoire courant contient un répertoire `.dart_tool` @@ -712,21 +724,21 @@ format = "via [🔰 $version](bold red) " ## Deno -Le module `deno` affiche la version actuellement installée de [Deno](https://deno.land/). Par défaut le module sera activé si au moins l'une des conditions suivantes est remplie: -- Le répertoire courant contient un fichier `mod.ts`, `mod.js`, `deps.ts` ou `deps.ts` +The `deno` module shows you your currently installed version of [Deno](https://deno.land/). Par défaut le module sera activé si au moins l'une des conditions suivantes est remplie: +- The current directory contains a `deno.json`, `deno.jsonc`, `mod.ts`, `mod.js`, `deps.ts` or `deps.js` file ### Options -| Option | Défaut | Description | -| ------------------- | -------------------------------------------- | ------------------------------------------------------------------------------------------ | -| `format` | `"via [$symbol($version )]($style)"` | Format du module. | -| `version_format` | `"v${raw}"` | Le format de la version. Les variables disponibles sont `raw`, `major`, `minor`, & `patch` | -| `symbol` | `"🦕 "` | Une chaîne de caractères représentant le symbole de Deno | -| `detect_extensions` | `[]` | Quelles extensions devraient activer ce module. | -| `detect_files` | `["mod.ts", "mod.js", "deps.ts", "deps.js"]` | Quels fichiers devraient activer ce module. | -| `detect_folders` | `[]` | Quels dossiers devraient activer ce module. | -| `style` | `"green bold"` | Le style du module. | -| `disabled` | `false` | Désactive le module `deno`. | +| Option | Défaut | Description | +| ------------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ | +| `format` | `"via [$symbol($version )]($style)"` | Format du module. | +| `version_format` | `"v${raw}"` | Le format de la version. Les variables disponibles sont `raw`, `major`, `minor`, & `patch` | +| `symbol` | `"🦕 "` | Une chaîne de caractères représentant le symbole de Deno | +| `detect_extensions` | `[]` | Quelles extensions devraient activer ce module. | +| `detect_files` | `["deno.json", "deno.jsonc", "mod.ts", "mod.js", "deps.ts", "deps.js"]` | Quels fichiers devraient activer ce module. | +| `detect_folders` | `[]` | Quels dossiers devraient activer ce module. | +| `style` | `"green bold"` | Le style du module. | +| `disabled` | `false` | Désactive le module `deno`. | ### Variables @@ -747,29 +759,30 @@ format = "via [🦕 $version](green bold) " ## Dossier -Le mode `directory` montre le chemin de votre dossier actuel, tronqué aux 3 dossiers parents. Votre répertoire sera également tronqué à la racine du repo git dans lequel vous vous trouvez actuellement. +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. -Quand vous utilisez le style pwd de fish, au lieu de cacher le chemin qui est tronqué, vous verrez un nom raccourci de chaque dossier basé sur le nombre établi pour l'option. +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. -Par exemple, donné `~/Dev/Nix/nixpkgs/pkgs` où `nixpkgs` est la racine du repo, et l'option définie à `1`. Vous verrez maintenant `~/D/N/nixpkgs/pkgs`, alors que vous auriez vu `nixpkgs/pkgs` avant. +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`. ### Options -| Option | Défaut | Description | -| ------------------- | -------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `truncation_length` | `3` | Le nombre de dossiers parents selon lesquels le répertoire courant doit être tronqué. | -| `truncate_to_repo` | `true` | Si oui ou non tronquer à la racine du repo git dans lequel vous vous trouvez. | -| `format` | `"[$path]($style)[$read_only]($read_only_style) "` | Format du module. | -| `style` | `"bold cyan"` | Le style du module. | -| `disabled` | `false` | Désactive le module `directory`. | -| `read_only` | `"🔒"` | Le symbole indiquant que le répertoire courant est en lecture seule. | -| `read_only_style` | `"red"` | Le style du symbole en lecture seule. | -| `truncation_symbol` | `""` | Le symbole en préfixe aux chemins tronqués. eg: "…/" | -| `repo_root_style` | `None` | The style for the root of the git repo when `truncate_to_repo` option is set to false. | -| `home_symbol` | `"~"` | Le symbole indiquant le répertoire personnel. | +| Option | Défaut | Description | +| ------------------- | -------------------------------------------------- | --------------------------------------------------------------------------------------- | +| `truncation_length` | `3` | Le nombre de dossiers parents selon lesquels le répertoire courant doit être tronqué. | +| `truncate_to_repo` | `true` | Si oui ou non tronquer à la racine du repo git dans lequel vous vous trouvez. | +| `format` | `"[$path]($style)[$read_only]($read_only_style) "` | Format du module. | +| `style` | `"bold cyan"` | Le style du module. | +| `disabled` | `false` | Désactive le module `directory`. | +| `read_only` | `"🔒"` | Le symbole indiquant que le répertoire courant est en lecture seule. | +| `read_only_style` | `"red"` | Le style du symbole en lecture seule. | +| `truncation_symbol` | `""` | Le symbole en préfixe aux chemins tronqués. eg: "…/" | +| `repo_root_style` | `None` | Le style pour la racine du dépôt git quand l’option `truncate_to_repo` est à false. | +| `home_symbol` | `"~"` | Le symbole indiquant le répertoire personnel. | +| `use_os_path_sep` | `true` | Use the OS specific path seperator instead of always using `/` (e.g. `\` on Windows) |
-Ce module possède quelques options de configuration avancées qui contrôlent l'affichage du répertoire. +This module has a few advanced configuration options that control how the directory is displayed. | Options avancées | Défaut | Description | | --------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -777,7 +790,7 @@ Par exemple, donné `~/Dev/Nix/nixpkgs/pkgs` où `nixpkgs` est la racine du repo | `fish_style_pwd_dir_length` | `0` | Le nombre de caractères à utiliser lors de l'application de la logique de troncature du pwd de fish. | | `use_logical_path` | `true` | Si `true` affiche le chemin logique issu du shell via `PWD` ou `--logical-path`. Si `false` renvoie plutôt le chemin du système de fichiers physique avec les liens symboliques résolus. | -`substitutions` vous permet de définir des remplacements arbitraires pour les chaînes littérales qui apparaissent dans le chemin, par exemple pour de longs préfixes de réseau ou des répertoires de développement (ex. Java). Notez que cela désactivera la PWD de style fish. +`substitutions` allows you to define arbitrary replacements for literal strings that occur in the path, for example long network prefixes or development directories (i.e. Java). Note that this will disable the fish style PWD. ```toml [directory.substitutions] @@ -785,7 +798,7 @@ Par exemple, donné `~/Dev/Nix/nixpkgs/pkgs` où `nixpkgs` est la racine du repo "src/com/long/java/path" = "mypath" ``` -`fish_style_pwd_dir_leng` interagit avec les options de troncature d'une manière qui peut être surprenante au début : si elle n'est pas nulle, les composantes du chemin qui seraient normalement tronquées sont affichées à la place avec autant de caractères. Par exemple, le chemin `/built/this/city/on/rock/and/roll`, qui devrait normalement être affiché comme `rock/and/roll`, sera affiché sous la forme de `/b/t/c/o/rock/and/roll` avec `fish_style_pwd_dir_length = 1`--les composants de chemin qui seraient normalement supprimés sont affichés avec un caractère unique. Pour `fish_style_pwd_dir_length = 2`, ce serait `/bu/th/ci/on/rock/and/roll`. +`fish_style_pwd_dir_length` interacts with the standard truncation options in a way that can be surprising at first: if it's non-zero, the components of the path that would normally be truncated are instead displayed with that many characters. For example, the path `/built/this/city/on/rock/and/roll`, which would normally be displayed as as `rock/and/roll`, would be displayed as `/b/t/c/o/rock/and/roll` with `fish_style_pwd_dir_length = 1`--the path components that would normally be removed are displayed with a single character. For `fish_style_pwd_dir_length = 2`, it would be `/bu/th/ci/on/rock/and/roll`.
@@ -846,9 +859,9 @@ format = "via [🐋 $context](blue bold)" ## Dotnet -Le module `dotnet` montre la version pertinente du [SDK .NET Core](https://dotnet.microsoft.com/) pour le répertoire courant. Si le SDK a été épinglé dans le répertoire courant, la version épinglée est affichée. Sinon, le module affiche la dernière version installée du 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. -Par défaut, ce module ne sera affiché dans votre invite que lorsqu'un ou plusieurs des fichiers suivants sont présents dans le répertoire courant : +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: - `global.json` - `project.json` @@ -859,9 +872,9 @@ Par défaut, ce module ne sera affiché dans votre invite que lorsqu'un ou plusi - `*.fsproj` - `*.xproj` -Vous aurez également besoin du SDK .NET Core pour pouvoir l'utiliser correctement. +You'll also need the .NET Core SDK installed in order to use it correctly. -En interne, ce module utilise son propre mécanisme de détection de version. Généralement, il est deux fois plus rapide que d'exécuter `dotnet --version`, mais il peut afficher une version incorrecte si votre projet .NET a une arborescence inhabituelle. Si la précision est plus importante que la vitesse, vous pouvez désactiver le mécanisme en définissant `heuristic = false` dans les options du module. +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 () when there is a csproj file in the current directory. @@ -903,7 +916,7 @@ heuristic = false ## Elixir -Le module `elixir` montre la version actuellement installée de [Elixir](https://elixir-lang.org/) et [Erlang/OTP](https://erlang.org/doc/). Par défaut le module sera activé si au moins l'une des conditions suivantes est remplie: +The `elixir` module shows the currently installed version of [Elixir](https://elixir-lang.org/) and [Erlang/OTP](https://erlang.org/doc/). Par défaut le module sera activé si au moins l'une des conditions suivantes est remplie: - Le répertoire courant contient un fichier `mix.exs`. @@ -942,7 +955,7 @@ symbol = "🔮 " ## Elm -Le module `elm` montre la version actuellement installée de [Elm](https://elm-lang.org/). Par défaut le module sera activé si au moins l'une des conditions suivantes est remplie: +The `elm` module shows the currently installed version of [Elm](https://elm-lang.org/). Par défaut le module sera activé si au moins l'une des conditions suivantes est remplie: - Le répertoire courant contient un fichier `elm.json` - Le répertoire courant contient un fichier `elm-package.json` @@ -984,7 +997,7 @@ format = "via [ $version](cyan bold) " ## Variable d'environnement -The `env_var` module displays the current value of a selected environment variables. Le module est affiché si l'une de ces conditions est remplie : +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: - L'option `variable` correspond à une variable d'environnement existante - L'option `variable` n'est pas définie, mais l'option `default` l'est @@ -1044,7 +1057,7 @@ default = "unknown user" ## Erlang -Le module `erlang` montre la version actuellement installée de [Erlang/OTP](https://erlang.org/doc/). Par défaut le module sera activé si au moins l'une des conditions suivantes est remplie: +The `erlang` module shows the currently installed version of [Erlang/OTP](https://erlang.org/doc/). Par défaut le module sera activé si au moins l'une des conditions suivantes est remplie: - Le répertoire courant contient un fichier `rebar.config`. - Le répertoire courant contient un fichier `erlang.mk`. @@ -1081,17 +1094,17 @@ Le module `erlang` montre la version actuellement installée de [Erlang/OTP](htt format = "via [e $version](bold red) " ``` -## Fill +## Remplissage The `fill` module fills any extra space on the line with a symbol. If multiple `fill` modules are present in a line they will split the space evenly between them. This is useful for aligning other modules. ### Options -| Option | Défaut | Description | -| ---------- | -------------- | --------------------------------- | -| `symbol` | `"."` | The symbol used to fill the line. | -| `style` | `"bold black"` | Le style du module. | -| `disabled` | `false` | Disables the `fill` module | +| Option | Défaut | Description | +| ---------- | -------------- | ----------------------------------------- | +| `symbol` | `"."` | Le symbole utilisé pour remplir la ligne. | +| `style` | `"bold black"` | Le style du module. | +| `disabled` | `false` | Désactive le module `fill` | ### Exemple @@ -1113,7 +1126,7 @@ AA -------------------------------------------- BB ----------------------------- ## Google Cloud (`gcloud`) -Le module `gcloud` affiche la configuration actuelle pour [`gcloud`](https://cloud.google.com/sdk/gcloud) CLI. Ceci est basé sur les fichiers `~/.config/gcloud/active_config` et `~/.config/gcloud/configurations/config_{CONFIG NAME}` et la variable d'environnement `CLOUDSDK_CONFIG`. +The `gcloud` module shows the current configuration for [`gcloud`](https://cloud.google.com/sdk/gcloud) CLI. This is based on the `~/.config/gcloud/active_config` file and the `~/.config/gcloud/configurations/config_{CONFIG NAME}` file and the `CLOUDSDK_CONFIG` env var. ### Options @@ -1174,7 +1187,7 @@ asia-northeast1 = "an1" ## Branche Git -Le module `git_branch` affiche la branche active du dépôt dans votre répertoire courant. +The `git_branch` module shows the active branch of the repo in your current directory. ### Options @@ -1214,7 +1227,7 @@ truncation_symbol = "" ## Commit Git -Le module `git_commit` affiche le hash du commit actuel ainsi que le tag (le cas échéant) du dépôt dans votre répertoire courant. +The `git_commit` module shows the current commit hash and also the tag (if any) of the repo in your current directory. ### Options @@ -1249,7 +1262,7 @@ tag_symbol = "🔖 " ## État Git -Le module `git_state` s'affichera dans les répertoires qui font partie d'un dépôt git, dans lesquels une opération est en cours, comme : _REBASING_, _BISECTING_, etc. S'il y a des informations de progression (par exemple, REBASING 3/10), ces informations seront également affichées. +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. ### Options @@ -1293,7 +1306,7 @@ The `git_metrics` module will show the number of added and deleted lines in the ::: tip -Ce module est désactivé par défaut. Pour l'activer, configurez `disabled` sur `false` dans votre fichier de configuration. +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: @@ -1330,30 +1343,31 @@ format = '[+$added]($added_style)/[-$deleted]($deleted_style) ' ## Statut Git -Le module `git_status` affiche des symboles représentant l'état du dépôt dans votre répertoire courant. +The `git_status` module shows symbols representing the state of the repo in your current directory. ### Options -| Option | Défaut | Description | -| ------------ | ----------------------------------------------- | ------------------------------------------- | -| `format` | `'([\[$all_status$ahead_behind\]]($style) )'` | Le format par défaut du module `git_status` | -| `conflicted` | `"="` | Cette branche a des conflits de fusion. | -| `ahead` | `"⇡"` | Le format de `ahead` | -| `behind` | `"⇣"` | Le format de `behind` | -| `diverged` | `"⇕"` | Le format de `diverged` | -| `up_to_date` | `""` | The format of `up_to_date` | -| `untracked` | `"?"` | Le format de `untracked` | -| `stashed` | `"$"` | Le format de `stashed` | -| `modified` | `"!"` | Le format de `modified` | -| `staged` | `"+"` | Le format de `staged` | -| `renamed` | `"»"` | Le format de `renamed` | -| `deleted` | `"✘"` | Le format de `deleted` | -| `style` | `"bold green"` | Le style du module. | -| `disabled` | `false` | Désactive le module `git_status`. | +| Option | Défaut | Description | +| ------------------- | ----------------------------------------------- | ------------------------------------------- | +| `format` | `'([\[$all_status$ahead_behind\]]($style) )'` | Le format par défaut du module `git_status` | +| `conflicted` | `"="` | Cette branche a des conflits de fusion. | +| `ahead` | `"⇡"` | Le format de `ahead` | +| `behind` | `"⇣"` | Le format de `behind` | +| `diverged` | `"⇕"` | Le format de `diverged` | +| `up_to_date` | `""` | The format of `up_to_date` | +| `untracked` | `"?"` | Le format de `untracked` | +| `stashed` | `"$"` | Le format de `stashed` | +| `modified` | `"!"` | Le format de `modified` | +| `staged` | `"+"` | Le format de `staged` | +| `renamed` | `"»"` | Le format de `renamed` | +| `deleted` | `"✘"` | Le format de `deleted` | +| `style` | `"bold green"` | Le style du module. | +| `ignore_submodules` | `false` | Ignore changes to submodules. | +| `disabled` | `false` | Disables the `git_status` module. | ### Variables -Les variables suivantes peuvent être utilisées pour la valeur de `format`: +The following variables can be used in `format`: | Variable | Description | | -------------- | ------------------------------------------------------------------------------------------------------------- | @@ -1370,14 +1384,14 @@ Les variables suivantes peuvent être utilisées pour la valeur de `format`: \* : Cette variable ne peut être utilisée que comme partie d'une chaîne de style -Les variables suivantes peuvent être utilisées pour la valeur de `diverged`: +The following variables can be used in `diverged`: | Variable | Description | | -------------- | ------------------------------------------------- | | `ahead_count` | Nombre de commits en avance sur la branche suivie | | `behind_count` | Nombre de commits en retard sur la branche suivie | -Les variables suivantes peuvent êtres utilisées dans `conflicted`, `ahead`, `behind`, `untracked`, `stashed`, `modified`, `staged`, `renamed` et `deleted`: +The following variables can be used in `conflicted`, `ahead`, `behind`, `untracked`, `stashed`, `modified`, `staged`, `renamed` and `deleted`: | Variable | Description | | -------- | --------------------------------------- | @@ -1402,7 +1416,7 @@ renamed = "👅" deleted = "🗑" ``` -Afficher le nombre de commits en avance/en retard par rapport à la branche suivie +Show ahead/behind count of the branch being tracked ```toml # ~/.config/starship.toml @@ -1460,7 +1474,7 @@ format = "via [🏎💨 $version](bold cyan) " ## Helm -Le module `helm` montre la version actuellement installée de [Helm](https://helm.sh/). Par défaut le module sera activé si au moins l'une des conditions suivantes est remplie: +The `helm` module shows the currently installed version of [Helm](https://helm.sh/). Par défaut le module sera activé si au moins l'une des conditions suivantes est remplie: - Le répertoire courant contient un fichier `helmfile.yaml` - Le répertoire courant contient un fichier `Chart.yml` @@ -1499,7 +1513,7 @@ format = "via [⎈ $version](bold white) " ## Nom d'hôte -Le module `hostname` affiche le nom d'hôte du système. +The `hostname` module shows the system hostname. ### Options @@ -1513,10 +1527,10 @@ Le module `hostname` affiche le nom d'hôte du système. ### Variables -| Variable | Exemple | Description | -| --------- | ------- | -------------------------------------- | -| symbol | | Reflète la valeur de l'option `symbol` | -| style\* | | Reflète la valeur de l'option `style` | +| Variable | Exemple | Description | +| --------- | ---------- | ------------------------------------- | +| hostname | `computer` | The hostname of the computer | +| style\* | | Reflète la valeur de l'option `style` | \* : Cette variable ne peut être utilisée que comme partie d'une chaîne de style @@ -1534,7 +1548,7 @@ disabled = false ## Java -Le module `java` affiche la version actuellement installée de [Java](https://www.oracle.com/java/). Par défaut le module sera activé si au moins l'une des conditions suivantes est remplie: +The `java` module shows the currently installed version of [Java](https://www.oracle.com/java/). Par défaut le module sera activé si au moins l'une des conditions suivantes est remplie: - Le répertoire actuel contient un fichier `pom.xml`, `build.gradle.kts`, `build.sbt`, `.java-version`, `.deps.edn`, `project.clj`, ou `build.boot` - Le répertoire actuel contient un fichier avec l'extension `.java`, `.class`, `. gradle`, `.jar`, `.clj`, ou `.cljc` @@ -1573,7 +1587,7 @@ symbol = "🌟 " ## Jobs -Le module `jobs` affiche le nombre de tâches en cours d'exécution. Le module ne sera affiché que s'il y a des tâches de fond. 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: @@ -1589,7 +1603,7 @@ This module is not supported on tcsh and nu. ::: warning -The `threshold` option is deprecated, but if you want to use it, the module will show the number of jobs running if there is more than 1 job, or more than the `threshold` config value, if it exists. Si `threshold` est définie à 0, alors le module s'affichera également lorsqu'il n'y a pas de tâches de fond en cours. +The `threshold` option is deprecated, but if you want to use it, the module will show the number of jobs running if there is more than 1 job, or more than the `threshold` config value, if it exists. If `threshold` is set to 0, then the module will also show when there are 0 jobs running. ::: @@ -1631,7 +1645,7 @@ symbol_threshold = 0 ## Julia -Le module `julia` affiche la version actuellement installée de [Julia](https://julialang.org/). Par défaut le module sera activé si au moins l'une des conditions suivantes est remplie: +The `julia` module shows the currently installed version of [Julia](https://julialang.org/). Par défaut le module sera activé si au moins l'une des conditions suivantes est remplie: - Le répertoire courant contient un fichier `Project.toml` - Le répertoire courant contient un fichier `Manifest.toml` @@ -1671,7 +1685,7 @@ symbol = "∴ " ## Kotlin -Le module `kotlin` affiche la version actuellement installée de [Kotlin](https://kotlinlang.org/). Par défaut le module sera activé si au moins l'une des conditions suivantes est remplie: +The `kotlin` module shows the currently installed version of [Kotlin](https://kotlinlang.org/). Par défaut le module sera activé si au moins l'une des conditions suivantes est remplie: - Le répertoire courant contient un fichier `.kt` ou `.kts` @@ -1718,11 +1732,11 @@ kotlin_binary = "kotlinc" ## Kubernetes -Affiche le nom du [contexte Kubernets](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#context) actuel et, si défini, l'espace de noms du fichier kubeconfig. L'espace de noms doit être défini dans le fichier kubeconfig, cela peut être fait via `kubectl config set-context starship-cluster --namespace astronaut`. Si la variable d'environnement `$KUBECONFIG` est définie, le module l'utilisera sinon il utilisera le fichier `~/.kube/config`. +Displays the current [Kubernetes context](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#context) name and, if set, the namespace from the kubeconfig file. The namespace needs to be set in the kubeconfig file, this can be done via `kubectl config set-context starship-cluster --namespace astronaut`. If the `$KUBECONFIG` env var is set the module will use that if not it will use the `~/.kube/config`. ::: tip -Ce module est désactivé par défaut. Pour l'activer, configurez `disabled` sur `false` dans votre fichier de configuration. +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: @@ -1784,7 +1798,7 @@ Long and automatically generated cluster names can be identified and shortened u ## Saut de ligne -Le module `line_break` sépare l'invite en deux lignes. +The `line_break` module separates the prompt into two lines. ### Options @@ -1803,7 +1817,7 @@ disabled = true ## Lua -Le module `lua` affiche la version actuellement installée de [Lua](http://www.lua.org/). Par défaut le module sera activé si au moins l'une des conditions suivantes est remplie: +The `lua` module shows the currently installed version of [Lua](http://www.lua.org/). Par défaut le module sera activé si au moins l'une des conditions suivantes est remplie: - Le répertoire courant contient un fichier `.lua-version` - Le répertoire courant contient un répertoire `lua` @@ -1844,13 +1858,13 @@ format = "via [🌕 $version](bold blue) " ## Utilisation mémoire -Le module `memory_usage` affiche la mémoire système actuelle et l'utilisation de swap. +The `memory_usage` module shows current system memory and swap usage. -Par défaut, l'utilisation du swap est affichée si le swap total du système n'est pas nul. +By default the swap usage is displayed if the total system swap is non-zero. ::: tip -Ce module est désactivé par défaut. Pour l'activer, configurez `disabled` sur `false` dans votre fichier de configuration. +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: @@ -1875,7 +1889,7 @@ Ce module est désactivé par défaut. Pour l'activer, configurez `disabled` sur | symbol | `🐏` | Reflète la valeur de l'option `symbol` | | style\* | | Reflète la valeur de l'option `style` | -\* : Cette variable ne peut être utilisée que comme partie d'une chaîne de style \*\* : Les informations sur le fichier SWAP ne sont affichées que si détectées sur le système actuel +\*: This variable can only be used as a part of a style string \*\*: The SWAP file information is only displayed if detected on the current system ### Exemple @@ -1891,7 +1905,7 @@ style = "bold dimmed green" ## Branche Mercurial -Le module `hg_branch` affiche la branche active du dépôt dans votre répertoire courant. +The `hg_branch` module shows the active branch of the repo in your current directory. ### Options @@ -1927,7 +1941,7 @@ truncation_symbol = "" ## Nim -Le module `nim` affiche la version actuellement installée de [Nim](https://nim-lang.org/). Par défaut le module sera activé si au moins l'une des conditions suivantes est remplie: +The `nim` module shows the currently installed version of [Nim](https://nim-lang.org/). Par défaut le module sera activé si au moins l'une des conditions suivantes est remplie: - Le répertoire courant contient un fichier `nim.cfg` - Le répertoire actuel contient un fichier avec l'extension `.nim` @@ -2007,7 +2021,7 @@ format = 'via [☃️ $state( \($name\))](bold blue) ' ## Node.js -Le module `nodejs` affiche la version actuellement installée de [Node.js](https://nodejs.org/). Par défaut le module sera activé si au moins l'une des conditions suivantes est remplie: +The `nodejs` module shows the currently installed version of [Node.js](https://nodejs.org/). Par défaut le module sera activé si au moins l'une des conditions suivantes est remplie: - Le répertoire courant contient un fichier `package.json` - Le répertoire courant contient un fichier `.node-version` @@ -2051,7 +2065,7 @@ format = "via [🤖 $version](bold green) " ## OCaml -Le module `ocaml` affiche la version actuellement installée de [OCaml](https://ocaml.org/). Par défaut le module sera activé si au moins l'une des conditions suivantes est remplie: +The `ocaml` module shows the currently installed version of [OCaml](https://ocaml.org/). Par défaut le module sera activé si au moins l'une des conditions suivantes est remplie: - Le répertoire courant contient un fichier avec l'extension `.opam` ou le répertoire `_opam` - Le répertoire courant contient un répertoire `esy.lock` @@ -2131,16 +2145,16 @@ style = "bold yellow" symbol = "☁️ " ``` -## Version du package +## Version du paquet -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. +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`, `shards` and `dart` packages. -- [**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 -- [**Nimble**](https://github.com/nim-lang/nimble) - The `nimble` package version is extracted from the `*.nimble` file present in the current directory with the `nimble dump` command -- [**Poetry**](https://python-poetry.org/) – The `poetry` package version is extracted from the `pyproject.toml` present in the current directory -- [**Python**](https://www.python.org) - The `python` package version is extracted from the `setup.cfg` present in the current directory -- [**Composer**](https://getcomposer.org/) – The `composer` package version is extracted from the `composer.json` present in the current directory +- [**npm**](https://docs.npmjs.com/cli/commands/npm) – La version du paquet `npm` est extraite du `package.json` présent dans le répertoire courant +- [**Cargo**](https://doc.rust-lang.org/cargo/) – La version du paquet `cargo` est extraite du `Cargo.toml` présent dans le répertoire courant +- [**Nimble**](https://github.com/nim-lang/nimble) - La version du paquet `nimble` est extraite du fichier `*.nimble` dans le répertoire courant avec la commande `nimble dump` +- [**Poetry**](https://python-poetry.org/) – La version du paquet `poetry` est extraite du `pyproject.toml` présent dans le répertoire courant +- [**Python**](https://www.python.org) - La version du paquet `python` est extraite du `setup.cfg` présent dans le répertoire courant +- [**Composer**](https://getcomposer.org/) – La version du paquet `composer` est extraite du `composer.json` présent dans le répertoire courant - [**Gradle**](https://gradle.org/) – The `gradle` package version is extracted from the `build.gradle` present - [**Julia**](https://docs.julialang.org/en/v1/stdlib/Pkg/) - The package version is extracted from the `Project.toml` present - [**Mix**](https://hexdocs.pm/mix/) - The `mix` package version is extracted from the `mix.exs` present @@ -2150,8 +2164,9 @@ The `package` module is shown when the current directory is the repository for a - [**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 - [**SBT**](https://scala-sbt.org) - The `sbt` package version is extracted from the `build.sbt` present in the current directory +- [**Dart**](https://pub.dev/) – La version du paquet `dart` est extrait du `pubspec.yaml` présent dans le répertoire courant -> ⚠️ The version being shown is that of the package whose source code is in your current directory, not your package manager. +> ⚠️ La version montrée est celle du paquet dont le code source est dans votre répertoire courant, pas votre gestionnaire de paquet. ### Options @@ -2185,7 +2200,7 @@ format = "via [🎁 $version](208 bold) " ## Perl -Le module `perl` affiche la version actuellement installée de [Perl](https://www.perl.org/). Par défaut le module sera activé si au moins l'une des conditions suivantes est remplie: +The `perl` module shows the currently installed version of [Perl](https://www.perl.org/). Par défaut le module sera activé si au moins l'une des conditions suivantes est remplie: - Le répertoire courant contient un fichier `Makefile.PL` ou `Build.PL` - Le répertoire courant contient un fichier `cpanfile` ou `cpanfile.snapshot` @@ -2225,7 +2240,7 @@ format = "via [🦪 $version]($style) " ## PHP -Le module `php` affiche la version actuellement installée de [PHP](https://www.php.net/). Par défaut le module sera activé si au moins l'une des conditions suivantes est remplie: +The `php` module shows the currently installed version of [PHP](https://www.php.net/). Par défaut le module sera activé si au moins l'une des conditions suivantes est remplie: - Le répertoire courant contient un fichier `composer.json` - Le répertoire courant contient un fichier `.php-version` @@ -2322,7 +2337,7 @@ format = "[$symbol$stack]($style) " ## PureScript -Le module `purescript` affiche la version actuellement installée de [PureScript](https://www.purescript.org/). Par défaut le module sera activé si au moins l'une des conditions suivantes est remplie: +The `purescript` module shows the currently installed version of [PureScript](https://www.purescript.org/) version. Par défaut le module sera activé si au moins l'une des conditions suivantes est remplie: - Le répertoire courant contient un fichier `spago.dhall` - Le répertoire actuel contient un fichier avec l'extension `.purs` @@ -2361,7 +2376,7 @@ format = "via [$symbol$version](bold white)" ## Python -Le module `python` affiche la version actuellement installée de [Python](https://www.python.org/) ainsi que la version d'[environnement virtuel Python](https://docs.python.org/tutorial/venv.html) si il y en a un d'activé. +The `python` module shows the currently installed version of [Python](https://www.python.org/) and the current [Python virtual environment](https://docs.python.org/tutorial/venv.html) if one is activated. If `pyenv_version_name` is set to `true`, it will display the pyenv version name. Otherwise, it will display the version number from `python --version`. @@ -2425,7 +2440,7 @@ pyenv_version_name = true # ~/.config/starship.toml [python] -# N'utilisez que le binaire `python3` pour obtenir la version. +# Only use the `python3` binary to get the version. python_binary = "python3" ``` @@ -2433,7 +2448,7 @@ python_binary = "python3" # ~/.config/starship.toml [python] -# Ne pas déclencher pour les fichiers avec l'extension py +# Don't trigger for files with the py extension detect_extensions = [] ``` @@ -2441,11 +2456,10 @@ detect_extensions = [] # ~/.config/starship.toml [python] -# Affiche la version de python depuis l'intérieur d'un venv local. +# Display the version of python from inside a local venv. # -# Notez que cela ne fonctionnera que lorsque le venv est à l'intérieur du projet, -# et uniquement lorsque vous vous situez dans le répertoire contenant le dossier du venv -# mais peut-être que c'est suffisant? +# Note this will only work when the venv is inside the project and it will only +# work in the directory that contains the venv dir but maybe this is ok? python_binary = ["./venv/bin/python", "python", "python3", "python2"] ``` @@ -2493,7 +2507,7 @@ format = "with [📐 $version](blue bold) " ## Red -Par défaut, le module `red` affiche la version actuellement installée de [Red](https://www.red-lang.org/). Le module est affiché si l'une de ces conditions est remplie : +By default the `red` module shows the currently installed version of [Red](https://www.red-lang.org/). Le module est affiché si l'une de ces conditions est remplie : - Le répertoire actuel contient un fichier avec l'extension `.red` ou `.reds` @@ -2531,12 +2545,12 @@ symbol = "🔴 " ## Ruby -Par défaut, le module `ruby` affiche la version actuellement installée de [Ruby](https://www.ruby-lang.org/). Le module est affiché si l'une de ces conditions est remplie : +By default the `ruby` module shows the currently installed version of [Ruby](https://www.ruby-lang.org/). Le module est affiché si l'une de ces conditions est remplie : - Le répertoire courant contient un fichier `Gemfile` - Le répertoire courant contient un fichier `.ruby-version` - Le répertoire courant contient un fichier `.rb` -- The environment variables `RUBY_VERSION` or `RBENV_VERSION` are set +- La variable d’environnement `RUBY_VERSION` ou `RBENV_VERSION` est définie Starship gets the current Ruby version by running `ruby -v`. @@ -2547,10 +2561,10 @@ Starship gets the current Ruby version by running `ruby -v`. | `format` | `"via [$symbol($version )]($style)"` | Format du module. | | `version_format` | `"v${raw}"` | Le format de la version. Les variables disponibles sont `raw`, `major`, `minor`, & `patch` | | `symbol` | `"💎 "` | Une chaîne de caractères représentant le symbole de Ruby. | -| `detect_extensions` | `["rb"]` | Quelles extensions devraient activer ce module. | -| `detect_files` | `["Gemfile", ".ruby-version"]` | Quels fichiers devraient activer ce module. | -| `detect_folders` | `[]` | Quels dossiers devraient activer ce module. | -| `detect_variables` | `["RUBY_VERSION", "RBENV_VERSION"]` | Which environment variables should trigger this module. | +| `detect_extensions` | `["rb"]` | Les extensions qui activent ce module. | +| `detect_files` | `["Gemfile", ".ruby-version"]` | Les fichiers qui activent ce module. | +| `detect_folders` | `[]` | Les dossiers qui activent ce module. | +| `detect_variables` | `["RUBY_VERSION", "RBENV_VERSION"]` | Les variables d’environnement qui activent ce module. | | `style` | `"bold green"` | Le style du module. | | `disabled` | `false` | Désactive le module `ruby`. | @@ -2575,7 +2589,7 @@ symbol = "🔺 " ## Rust -Par défaut, le module `rust` affiche la version actuellement installée de [Rust](https://www.rust-lang.org/). Le module est affiché si l'une de ces conditions est remplie : +By default the `rust` module shows the currently installed version of [Rust](https://www.rust-lang.org/). Le module est affiché si l'une de ces conditions est remplie : - Le répertoire courant contient un fichier `Cargo.toml` - Le répertoire actuel contient un fichier avec l'extension `.rs` @@ -2614,7 +2628,7 @@ format = "via [⚙️ $version](red bold)" ## Scala -Le module `scala` affiche la version actuellement installée de [Scala](https://www.scala-lang.org/). Par défaut le module sera activé si au moins l'une des conditions suivantes est remplie: +The `scala` module shows the currently installed version of [Scala](https://www.scala-lang.org/). Par défaut le module sera activé si au moins l'une des conditions suivantes est remplie: - Le répertoire courant contient un fichier `build.sbt`, `.scalaenv` ou `.sbtenv` - Le répertoire actuel contient un fichier avec l'extension `.scala` ou `.sbt` @@ -2658,7 +2672,7 @@ The `shell` module shows an indicator for currently used shell. ::: tip -Ce module est désactivé par défaut. Pour l'activer, configurez `disabled` sur `false` dans votre fichier de configuration. +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: @@ -2674,10 +2688,12 @@ Ce module est désactivé par défaut. Pour l'activer, configurez `disabled` sur | `elvish_indicator` | `esh` | Une chaîne de format utilisée pour représenter elvish. | | `tcsh_indicator` | `tsh` | Une chaîne de format utilisée pour représenter tcsh. | | `xonsh_indicator` | `xsh` | A format string used to represent xonsh. | +| `cmd_indicator` | `cmd` | A format string used to represent cmd. | +| `nu_indicator` | `nu` | A format string used to represent nu. | | `unknown_indicator` | | The default value to be displayed when the shell is unknown. | | `format` | `"[$indicator]($style) "` | Format du module. | | `style` | `"white bold"` | Le style du module. | -| `disabled` | `true` | Désactive le module `shell`. | +| `disabled` | `true` | Disables the `shell` module. | ### Variables @@ -2775,11 +2791,11 @@ The `status` module displays the exit code of the previous command. The module w ::: tip -Ce module est désactivé par défaut. Pour l'activer, configurez `disabled` sur `false` dans votre fichier de configuration. +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: -::: warning This module is not supported on elvish and nu shell. ::: +::: warning This module is not supported on nu shell. ::: ### Options @@ -2804,9 +2820,10 @@ Ce module est désactivé par défaut. Pour l'activer, configurez `disabled` sur | Variable | Exemple | Description | | -------------- | ------- | ------------------------------------------------------------------------------------------- | -| status | `127` | The exit code of the last command | -| int | `127` | The exit code of the last command | -| common_meaning | `ERROR` | Meaning of the code if not a signal | +| status | `127` | Le code de sortie de la dernière commande | +| hex_status | `0x7F` | Le code de sortie de la dernière commande en hexa | +| int | `127` | Le code de sortie de la dernière commande | +| common_meaning | `ERROR` | Signification du code si n’est pas un signal | | signal_number | `9` | Signal number corresponding to the exit code, only if signalled | | signal_name | `KILL` | Name of the signal corresponding to the exit code, only if signalled | | maybe_int | `7` | Contains the exit code number when no meaning has been found | @@ -2837,7 +2854,7 @@ The `sudo` module displays if sudo credentials are currently cached. The module ::: tip -Ce module est désactivé par défaut. Pour l'activer, configurez `disabled` sur `false` dans votre fichier de configuration. +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: @@ -2883,7 +2900,7 @@ disabled = false ## Swift -Par défaut, le module `swift` affiche la version actuellement installée de [Swift](https://swift.org/). Le module est affiché si l'une de ces conditions est remplie : +By default the `swift` module shows the currently installed version of [Swift](https://swift.org/). Le module est affiché si l'une de ces conditions est remplie : - Le répertoire courant contient un fichier `Package.swift` - Le répertoire actuel contient un fichier avec l'extension `.swift` @@ -2933,7 +2950,7 @@ By default the Terraform version is not shown, since this is slow for current ve Par défaut le module sera activé si au moins l'une des conditions suivantes est remplie: - Le répertoire courant contient un dossier `.terraform` -- Current directory contains a file with the `.tf`, `.tfplan` or `.tfstate` extensions +- Le répertoire courant contient un fichier avec l’extension `.tf`, `.tfplan` ou `.tfstate` ### Options @@ -2981,27 +2998,27 @@ format = "[🏎💨 $workspace]($style) " ## Date et Heure -Le module `time` affiche l'heure actuelle **localement**. La valeur de `format` est utilisée par le package [`chrono`](https://crates.io/crates/chrono) pour contrôler la façon dont l'heure est affichée. Consultez la [doc de chrono strftime](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) pour découvrir les options disponibles. +The `time` module shows the current **local** time. The `format` configuration value is used by the [`chrono`](https://crates.io/crates/chrono) crate to control how the time is displayed. Take a look [at the chrono strftime docs](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) to see what options are available. ::: tip -Ce module est désactivé par défaut. Pour l'activer, configurez `disabled` sur `false` dans votre fichier de configuration. +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: ### Options -| Option | Défaut | Description | -| ----------------- | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `format` | `"at [$time]($style) "` | La chaîne de format pour le module. | -| `use_12hr` | `false` | Activer le format 12h | -| `time_format` | voir plus bas | Le [format chrono](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) utilisé pour formater l'heure. | -| `style` | `"bold yellow"` | Le style utilisé par le module | -| `utc_time_offset` | `"local"` | Définir le décalage horaire UTC à utiliser. Range from -24 < x < 24. Accepte des nombres décimaux pour s'adapter aux décalages de 30/45 minutes. | -| `disabled` | `true` | Désactiver le module `time`. | -| `time_range` | `"-"` | Sets the time range during which the module will be shown. Times must be specified in 24-hours format | +| Option | Défaut | Description | +| ----------------- | ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `format` | `"at [$time]($style) "` | La chaîne de format pour le module. | +| `use_12hr` | `false` | Activer le format 12h | +| `time_format` | voir plus bas | Le [format chrono](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) utilisé pour formater l'heure. | +| `style` | `"bold yellow"` | Le style utilisé par le module | +| `utc_time_offset` | `"local"` | Définir le décalage horaire UTC à utiliser. Intervalle de -24 < x < 24. Accepte des nombres décimaux pour s'adapter aux décalages de 30/45 minutes. | +| `disabled` | `true` | Désactiver le module `time`. | +| `time_range` | `"-"` | Sets the time range during which the module will be shown. Times must be specified in 24-hours format | -If `use_12hr` is `true`, then `time_format` defaults to `"%r"`. Sinon, il est défini comme `"%T"`. Manually setting `time_format` will override the `use_12hr` setting. +If `use_12hr` is `true`, then `time_format` defaults to `"%r"`. Otherwise, it defaults to `"%T"`. Manually setting `time_format` will override the `use_12hr` setting. ### Variables @@ -3027,7 +3044,7 @@ time_range = "10:00:00-14:00:00" ## Nom d'utilisateur -Le module `username` affiche le nom d'utilisateur de l'utilisateur actif. Le module est affiché si l'une de ces conditions est remplie : +The `username` module shows active user's username. Le module est affiché si l'une de ces conditions est remplie : - L'utilisateur courant est root - L'utilisateur courant est différent de celui connecté @@ -3055,7 +3072,7 @@ SSH connection is detected by checking environment variables `SSH_CONNECTION`, ` | Variable | Exemple | Description | | -------- | ------------ | ------------------------------------------------------------------------------------------- | | `style` | `"red bold"` | Mirrors the value of option `style_root` when root is logged in and `style_user` otherwise. | -| `user` | `"matchai"` | The currently logged-in user ID. | +| `user` | `"matchai"` | L’identifiant de l’utilisateur courant. | ### Exemple @@ -3072,7 +3089,7 @@ show_always = true ## Vagrant -Le module `vagrant` affiche la version actuellement installée de [Vagrant](https://www.vagrantup.com/). Par défaut le module sera activé si au moins l'une des conditions suivantes est remplie: +The `vagrant` module shows the currently installed version of [Vagrant](https://www.vagrantup.com/). Par défaut le module sera activé si au moins l'une des conditions suivantes est remplie: - Le répertoire courant contient un fichier `Vagrantfile` @@ -3177,7 +3194,7 @@ format = "[🆅 $repo](bold blue) " ## Zig -Par défaut, le module `zig` affiche la version actuellement installée de [Zig](https://ziglang.org/). Le module est affiché si l'une de ces conditions est remplie : +By default the the `zig` module shows the currently installed version of [Zig](https://ziglang.org/). Le module est affiché si l'une de ces conditions est remplie : - Le répertoire courant contient un fichier `.zig` @@ -3213,7 +3230,7 @@ Par défaut, le module `zig` affiche la version actuellement installée de [Zig] symbol = "⚡️ " ``` -## Custom commands +## Commandes personnalisées The `custom` modules show the output of some arbitrary commands. @@ -3280,7 +3297,7 @@ Format strings can also contain shell specific prompt sequences, e.g. [Bash](htt #### Commandes shell personnalisées -`shell` accepte une liste de chaînes non vide, où: +`shell` accepts a non-empty list of strings, where: - La première chaîne est le chemin vers le shell à utiliser pour exécuter la commande. - Other following arguments are passed to the shell. diff --git a/docs/fr-FR/faq/README.md b/docs/fr-FR/faq/README.md index eaf92f6db..6cb3333a3 100644 --- a/docs/fr-FR/faq/README.md +++ b/docs/fr-FR/faq/README.md @@ -56,31 +56,31 @@ Si vous obtenez une erreur du type "_version 'GLIBC_2.18' not found (required by sh -c "$(curl -fsSL https://starship.rs/install.sh)" -- --platform unknown-linux-musl ``` -## Why do I see `Executing command "..." timed out.` warnings? +## Pourquoi je vois des avertissements `Executing command "..." timed out.`? -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 exécute différentes commandes pour obtenir les informations à afficher dans l'invite, par exemple la version d'un programme ou l'état actuel de git. Pour s’assurer que starship ne soit pas bloqué par l’exécution de ces commandes, nous mettons une limite de temps. Si une commande dépasse cette limite, starship va arrêter l’exécution de la commande et afficher l’avertissement ci-dessus, c’est un comportement attendu. Cette limite de temps est configurable en utilisant la [clé `command_timeout`](/config/#prompt) si vous souhaitez l’augmenter. Vous pouvez également suivre les étapes de débogage ci-dessous pour voir quelle commande est lente et voir si vous pouvez l’optimiser. Enfin, vous pouvez définir la variable `STARSHIP_LOG` à `error` pour masquer ces avertissements. ## Je vois des symboles que je ne comprends pas et auxquels je ne m'attendais pas, que signifient-t-ils ? 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 fait quelque chose d’inattendu, comment puis-je le déboguer ? -You can enable the debug logs by using the `STARSHIP_LOG` env var. These logs can be very verbose so it is often useful to use the `module` command if you are trying to debug a particular module, for example, if you are trying to debug the `rust` module you could run the following command to get the trace logs and output from the module. +Vous pouvez activer les journaux de débogage en utilisant la variable d’environnement `STARSHIP_LOG`. Ces journaux peuvent être très verbeux, donc il est souvent utile d'utiliser la commande `module` si vous essayez de déboguer un module particulier ; par exemple, si vous essayez de déboguer le module `rust`, vous pouvez exécuter la commande suivante pour récupérer les journaux de suivi et les sorties du module. ```sh -env STARHIP_LOG=trace starship module rust +env STARSHIP_LOG=trace starship module rust ``` -If starship is being slow you can try using the `timings` command to see if there is a particular module or command that to blame. +Si starship est lent, vous pouvez essayer d’utiliser la commande `timings` pour voir si un module ou une commande particulière est à blâmer. ```sh -env STARHIP_LOG=trace starship timings +env STARSHIP_LOG=trace starship timings ``` -This will output the trace log and a breakdown of all modules that either took more than 1ms to execute or produced some output. +Cela affichera le journal de suivi et un détail de tous les modules qui ont soit pris plus d’1ms pour s’exécuter, soit affiché quelque chose. -Finally if you find a bug you can use the `bug-report` command to create a Github issue. +Finalement, si vous trouvez un bug, vous pouvez utiliser la commande `bug-report` pour créer un ticket GitHub. ```sh starship bug-report @@ -117,6 +117,6 @@ Si Starship a été installé à l'aide d'un gestionnaire de paquets, veuillez v Si Starship a été installé en utilisant le script d'installation, la commande suivante supprimera l'exécutable : ```sh -# Trouver et supprimer l'exécutable starship -sh -c 'rm "$(which starship)"' +# Locate and delete the starship binary +sh -c 'rm "$(command -v 'starship')"' ``` diff --git a/docs/fr-FR/guide/README.md b/docs/fr-FR/guide/README.md index 5086e5228..040ed913d 100644 --- a/docs/fr-FR/guide/README.md +++ b/docs/fr-FR/guide/README.md @@ -63,7 +63,7 @@ >Espagnol   +   + Bahasa Indonesia +   + Italiano   @@ -119,7 +119,7 @@ description: Starship merupakan sebuah prompt yang minimal, super cepat, dan san #### Elvish - ::: warning Hanya elvish v0.15 atau versi yang lebih baru yang mendapat dukungan pengembangan. ::: + ::: warning Only elvish v0.17 or higher is supported. ::: Tambahkan skrip berikut pada baris akhir `~/.elvish/rc.elv`: @@ -164,3 +164,14 @@ description: Starship merupakan sebuah prompt yang minimal, super cepat, dan san execx($(starship init xonsh)) ``` + + + #### Cmd + + You need to use [Clink](https://chrisant996.github.io/clink/clink.html) (v1.2.30+) with Cmd. Add the following to a file `starship.lua` and place this file in Clink scripts directory: + + ```lua + -- starship.lua + + load(io.popen('starship init cmd'):read("*a"))() + ``` diff --git a/docs/id-ID/advanced-config/README.md b/docs/id-ID/advanced-config/README.md index fb51864a5..1d8fa8089 100644 --- a/docs/id-ID/advanced-config/README.md +++ b/docs/id-ID/advanced-config/README.md @@ -8,11 +8,35 @@ Konfigurasi pada bagian ini dapat berubah saat pembaruan Starship rilis di kemud ::: -## Kustomisasi Perintah pre-prompt dan pre-execution Pada Bash +## Custom pre-prompt and pre-execution Commands in Cmd -Bash tidak memiliki framework preexec/precmd yang tetap seperti kebanyakan shell pada umumnya. Oleh karena itu, sulit halnya untuk membuat hook yang dapat dikustomisasi sepenuhnya di dalam `bash`. Namun, Starship memberikan beberapa cara supaya kamu bisa memasukkan fungsimu sendiri ke dalam prosedur prompt-rendering: +Clink provides extremely flexible APIs to run pre-prompt and pre-exec commands in Cmd shell. It is fairly simple to use with Starship. Make the following changes to your `starship.lua` file as per your requirements: -- Untuk menjalankan fungsi yang dikustomisasi tepat sebelum prompt, buatlah sebuah fungsi baru lalu berikan nama `starship_precmd_user_func` ke fungsi tersebut. Sebagai contoh, untuk menampilkan gambar roket sebelum prompt, kamu bisa melakukannya dengan cara +- To run a custom function right before the prompt is drawn, define a new function called `starship_preprompt_user_func`. This function receives the current prompt as a string that you can utilize. For example, to draw a rocket before the prompt, you would do + +```lua +function starship_preprompt_user_func(prompt) + print("🚀") +end + +load(io.popen('starship init cmd'):read("*a"))() +``` + +- To run a custom function right before a command is executed, define a new function called `starship_precmd_user_func`. This function receives the current commandline as a string that you can utilize. For example, to print the command that's about to be executed, you would do + +```lua +function starship_precmd_user_func(line) + print("Executing: "..line) +end + +load(io.popen('starship init cmd'):read("*a"))() +``` + +## Custom pre-prompt and pre-execution Commands in Bash + +Bash does not have a formal preexec/precmd framework like most other shells. Because of this, it is difficult to provide fully customizable hooks in `bash`. Namun, Starship memberikan beberapa cara supaya kamu bisa memasukkan fungsimu sendiri ke dalam prosedur prompt-rendering: + +- To run a custom function right before the prompt is drawn, define a new function and then assign its name to `starship_precmd_user_func`. For example, to draw a rocket before the prompt, you would do ```bash function blastoff(){ @@ -21,13 +45,13 @@ function blastoff(){ starship_precmd_user_func="blastoff" ``` -- Untuk menjalankan fungsi yang dikustomisasi tepat sebelum commands berjalan, kamu bisa menggunakan [`DEBUG` trap mechanism](https://jichu4n.com/posts/debug-trap-and-prompt_command-in-bash/). Akan tetapi, kamu **harus** melakukan proses trap pada DEBUG signal *sebelum* menjalankan Starship! Starship bisa menyimpan nilai dari DEBUG trap, tapi jika trap diganti setelah starship berjalan, beberapa fungsi akan rusak. +- To run a custom function right before a command runs, you can use the [`DEBUG` trap mechanism](https://jichu4n.com/posts/debug-trap-and-prompt_command-in-bash/). However, you **must** trap the DEBUG signal *before* initializing Starship! Starship can preserve the value of the DEBUG trap, but if the trap is overwritten after starship starts up, some functionality will break. ```bash function blastoff(){ echo "🚀" } -trap blastoff DEBUG # Trap DEBUG *sebelum* menjalankan starship +trap blastoff DEBUG # Trap DEBUG *before* running starship eval $(starship init bash) ``` @@ -43,35 +67,35 @@ function Invoke-Starship-PreCommand { } ``` -## Mengubah Judul Window +## Change Window Title -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`. +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`, `zsh`, `cmd` or `powershell`. -Pertama, buatlah fungsi untuk mengubah judul window (bekerja pada bash dan zsh): +First, define a window title change function (identical in bash and zsh): ```bash function set_win_title(){ - echo -ne "\033]0; JUDUL_WINDOW_MU \007" + echo -ne "\033]0; YOUR_WINDOW_TITLE_HERE \007" } ``` -Kamu bisa menggunakan variabel untuk mengkustomisasi judulnya (`$USER`, `$HOSTNAME`, dan `$PWD` adalah opsi yang populer). +You can use variables to customize this title (`$USER`, `$HOSTNAME`, and `$PWD` are popular choices). -Di dalam `bash`, atur fungsi berikut menjadi fungsi precmd untuk starship: +In `bash`, set this function to be the precmd starship function: ```bash starship_precmd_user_func="set_win_title" ``` -Dalam `zsh`, pada array `precmd_functions`, tambahkan: +In `zsh`, add this to the `precmd_functions` array: ```bash precmd_functions+=(set_win_title) ``` -Kalau kamu suka hasilnya, tambahkan baris (`~/.bashrc` or `~/.zshrc`) ke dalam file konfigurasi shell milikmu untuk membuatnya permanen. +If you like the result, add these lines to your shell configuration file (`~/.bashrc` or `~/.zshrc`) to make it permanent. -Sebagai contoh, kalau kamu mau menampilkan lokasi direktori pada judul label terminalmu, tambahkan bagian berikut ke dalam `~/.bashrc` atau `~/.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`: ```bash function set_win_title(){ @@ -80,6 +104,16 @@ function set_win_title(){ starship_precmd_user_func="set_win_title" ``` +For Cmd, you can change the window title using the `starship_preprompt_user_func` function. + +```lua +function starship_preprompt_user_func(prompt) + console.settitle(os.getenv('USERNAME').."@"..os.getenv('COMPUTERNAME')..": "..os.getcwd()) +end + +load(io.popen('starship init cmd'):read("*a"))() +``` + You can also set a similar output with PowerShell by creating a function named `Invoke-Starship-PreCommand`. ```powershell @@ -97,7 +131,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). -`right_format` saat ini hanya tersedia pada shell: elvish, fish, zsh. +`right_format` is currently supported for the following shells: elvish, fish, zsh, xonsh, cmd. ### Contoh @@ -111,16 +145,38 @@ format = """$character""" right_format = """$all""" ``` -Menghasilkan prompt seperti berikut: +Produces a prompt like the following: ``` ▶ starship on  rprompt [!] is 📦 v0.57.0 via 🦀 v1.54.0 took 17s ``` +## Continuation Prompt + +Some shells support a continuation prompt along with the normal prompt. This prompt is rendered instead of the normal prompt when the user has entered an incomplete statement (such as a single left parenthesis or quote). + +Starship can set the continuation prompt using the `continuation_prompt` option. The default prompt is `"[∙](bright-black) "`. + +Note: `continuation_prompt` should be set to a literal string without any variables. + +Note: Continuation prompts are only available in the following shells: + + - `bash` + - `zsh` + - `PowerShell` + +### Contoh + +```toml +# ~/.config/starship.toml + +# A continuation prompt that displays two filled in arrows +continuation_prompt = "▶▶" +``` ## Menata String -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: +Style strings are a list of words, separated by whitespace. The words are not case sensitive (i.e. `bold` and `BoLd` are considered the same string). Each word can be one of the following: - `bold` - `italic` @@ -132,14 +188,14 @@ Style strings are a list of words, separated by whitespace. Kumpulan katanya tid - `` - `none` -yang mana `` merupakan sebuah penentu warna (dibahas di bawah). `fg:` dan `` 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. +where `` is a color specifier (discussed below). `fg:` and `` 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. -`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. +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. -Penentuan warna bisa dilakukan dengan salah satu cara berikut: +A color specifier can be one of the following: - - 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). - - Menggunakan bilangan antara 0-255. Spesifikasi [8-bit Kode Warna ANSI](https://i.stack.imgur.com/KTSQa.png). + - One of the standard terminal colors: `black`, `red`, `green`, `blue`, `yellow`, `purple`, `cyan`, `white`. You can optionally prefix these with `bright-` to get the bright version (e.g. `bright-white`). + - A `#` followed by a six-digit hexadecimal number. This specifies an [RGB color hex code](https://www.w3schools.com/colors/colors_hexadecimal.asp). + - A number between 0-255. This specifies an [8-bit ANSI Color Code](https://i.stack.imgur.com/KTSQa.png). -Jika warna yang dipakai pada latar depan/latar belakang banyak, maka warna yang terbaru pada string yang akan diprioritaskan. +If multiple colors are specified for foreground/background, the last one in the string will take priority. diff --git a/docs/id-ID/config/README.md b/docs/id-ID/config/README.md index 178a11962..a9ad1b292 100644 --- a/docs/id-ID/config/README.md +++ b/docs/id-ID/config/README.md @@ -24,46 +24,58 @@ disabled = true Kamu bisa mengganti lokasi file konfigurasi bawaan dengan menggunakan environment variable dari `STARSHIP_CONFIG`: ```sh -export STARSHIP_CONFIG=~/.starship/config.toml +export STARSHIP_CONFIG=~/example/non/default/path/starship.toml ``` Ekuivalen dalam PowerShell (Windows), tambahkan baris berikut pada `$PROFILE`: ```powershell -$ENV:STARSHIP_CONFIG = "$HOME\.starship\config.toml" +$ENV:STARSHIP_CONFIG = "$HOME\example\non\default\path\starship.toml" +``` + +Or for Cmd (Windows) would be adding this line to your `starship.lua`: + +```lua +os.setenv('STARSHIP_CONFIG', 'C:\\Users\\user\\example\\non\\default\\path\\starship.toml') ``` ### Logging -Secara bawaan, starship mencatat peringatan dan eror ke dalam sebuah file bernama `~/.cache/starship/session_${STARSHIP_SESSION_KEY}.log`, yang mana session key file tersebut sama dengan instance terminalmu. Namun, hal tersebut dapat diubah dengan menggunakan environment variable dari `STARSHIP_CACHE` berikut: +By default starship logs warnings and errors into a file named `~/.cache/starship/session_${STARSHIP_SESSION_KEY}.log`, where the session key is corresponding to a instance of your terminal. This, however can be changed using the `STARSHIP_CACHE` environment variable: ```sh -export STARSHIP_CONFIG=~/.starship/cache +export STARSHIP_CACHE=~/.starship/cache ``` -Pada PowerShell (Windows), tambahkan baris berikut pada `$PROFILE`: +Ekuivalen dalam PowerShell (Windows), tambahkan baris berikut pada `$PROFILE`: ```powershell $ENV:STARSHIP_CACHE = "$HOME\AppData\Local\Temp" ``` +Or for Cmd (Windows) would be adding this line to your `starship.lua`: + +```lua +os.setenv('STARSHIP_CACHE', 'C:\\Users\\user\\AppData\\Local\\Temp') +``` + ### Terminologi -**Modul**: Sebuah komponen pada prompt yang memberikan informasi berdasarkan info kontekstual sistem operasimu. Sebagai contoh, modul "nodejs" menampilkan versi Node.js yang tengah terpasang pada komputermu, jika direktorimu sedang berada pada proyek Node.js. +**Module**: A component in the prompt giving information based on contextual information from your OS. For example, the "nodejs" module shows the version of Node.js that is currently installed on your computer, if your current directory is a Node.js project. -**Variabel**: Sub-komponen yang terdiri dari informasi yang disediakan oleh modul. Sebagai contoh, variabel "version" dalam modul "nodejs" memuat versi terikini dari Node.js. +**Variable**: Smaller sub-components that contain information provided by the module. For example, the "version" variable in the "nodejs" module contains the current version of Node.js. -Secara konvensi, sebagian modul memiliki prefiks bawaan pada warna terminal (mis. `via` pada "nodejs") dan juga sebuah ruang kosong sebagai sufiks. +By convention, most modules have a prefix of default terminal color (e.g. `via` in "nodejs") and an empty space as a suffix. ### Format String -Format string merupakan format yang sebuah modul gunakan untuk menampilkan semua variabelnya. Sebagian besar modul memiliki sebuah entri yang disebut `format` yang mengkonfigurasi format tampilan pada modul. Kamu bisa menggunakan teks, variabel, dan grup teks di dalam sebuah format string. +Format strings are the format that a module prints all its variables with. Most modules have an entry called `format` that configures the display format of the module. You can use texts, variables and text groups in a format string. #### Variabel -Variabel memilki simbol `$` yang diikuti dengan nama variabelnya. The name of a variable can only contain 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 `_`. -Sebagai contoh: +For example: - `$version` adalah format string dengan sebuah nama variabel `version`. - `$git_branch$git_commit` merupakan sebuah format string dengan dua variabel bernama `git_branch` dan `git_commit`. @@ -71,13 +83,13 @@ Sebagai contoh: #### Grup Teks -Grup teks dibuat dengan dua bagian yang berbeda. +A text group is made up of two different parts. -Bagian pertama, yang mana diapit dalam sebuah `[]`, merupakan sebuah [format string](#format-strings). Kamu bisa menambahkan teks, variabel, atau bahkan grup teks bercabang di dalamnya. +The first part, which is enclosed in a `[]`, is a [format string](#format-strings). You can add texts, variables, or even nested text groups in it. -Pada bagian kedua, yang mana diapit dalam sebuah `()`, merupakan sebuah [penataan string](#style-strings). This can be used to style the first part. +In the second part, which is enclosed in a `()`, is a [style string](#style-strings). This can be used to style the first part. -Sebagai contoh: +For example: - `[on](red bold)` akan menampilkan string `on` dengan teks merah tebal. - `[⌘ $version](bold green)` akan menampilkan simbol `⌘` yang diikuti oleh variabel yang berisikan `version`, dengan teks tebal berwarna hijau. @@ -85,7 +97,7 @@ Sebagai contoh: #### Menata String -Sebagian besar modul starship memungkinkan kamu untuk mengkonfigurasi gaya tampilannya. Hal ini dilakukan dengan sebuah entri (biasanya `style`) yang konfigurasinya ditentukan oleh string. Berikut adalah beberapa contoh penataan pada string dan kegunaannya. Untuk detail sintaksis yang lebih lengkap, lihat [panduan konfigurasi lanjutan](/advanced-config/). +Most modules in starship allow you to configure their display styles. This is done with an entry (usually called `style`) which is a string specifying the configuration. Here are some examples of style strings along with what they do. For details on the full syntax, consult the [advanced config guide](/advanced-config/). - `"fg:green bg:blue"` mengeset teks berwana hijau pada latar biru - `"bg:blue fg:bright-green"` mengeset teks hijau terang pada latar biru @@ -94,13 +106,13 @@ Sebagian besar modul starship memungkinkan kamu untuk mengkonfigurasi gaya tampi - `"bold italic fg:purple"` mengeset teks ungu miring tebal - `""` secara eksplisit menonaktifkan semua penataan gaya -Perhatikan bagaimana nantinya penataanmu akan terlihat pada emulator terminalmu. Sebagai contoh, beberapa terminal emulator alih-alih membuat warnanya lebih terang, malah menebalkan teksnya, dan sebagian palet warna ada yang menggunakan nilai yang sama untuk warna normal dan terangnya. Dan juga, untuk memakai teks miring, terminalmu harus menunjang teks miring. +Note that what styling looks like will be controlled by your terminal emulator. For example, some terminal emulators will brighten the colors instead of bolding text, and some color themes use the same values for the normal and bright colors. Also, to get italic text, your terminal must support italics. #### Format String Bersyarat (Conditional) -Sebuah string dengan format bersyarat dibungkus dengan `(` dan `)` tidak akan dijalankan jika variabel di dalamnya kosong. +A conditional format string wrapped in `(` and `)` will not render if all variables inside are empty. -Sebagai contoh: +For example: - `(@$region)` tidak akan menampilkan apapun jika nilai variabel `region` adalah `None` atau berupa string kosong, jika tidak, `@` diikuti dengan nilai dari region. - `(sembarang)` akan selalu tidak menampilkan apapun karena tidak ada variabel yang dibungkus dalam kurung kurawal. @@ -112,18 +124,18 @@ 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 `\\`). -Sebagai contoh, ketika kamu ingin menampilkan simbol `$` pada sebuah baris baru, konfigurasi berikut sama halnya pada `format`: +For example, when you want to print a `$` symbol on a new line, the following configs for `format` are equivalent: ```toml -# dengan string standar +# with basic string format = "\n\\$" -# dengan string standar multibaris +# with multiline basic string format = """ \\$""" -# dengan string literal +# with literal string format = ''' \$''' @@ -131,7 +143,7 @@ format = ''' ## Prompt -Berikut adalah opsi konfigurasi dari list yang bersifat prompt-wide. +This is the list of prompt-wide configuration options. ### Opsi @@ -149,22 +161,22 @@ Berikut adalah opsi konfigurasi dari list yang bersifat prompt-wide. ```toml # ~/.config/starship.toml -# Menggunakan format yang dikustomisasi +# Use custom format format = """ [┌───────────────────>](bold green) [│](bold green)$directory$rust$package [└─>](bold green) """ -# Menunggu 10 milidetik untuk starship mencek file pada direktori terkini. +# Wait 10 milliseconds for starship to check files under the current directory. scan_timeout = 10 -# Menonaktifkan baris kosong di awal prompt +# Disable the blank line at the start of the prompt add_newline = false ``` ### Format Prompt Bawaan -Aturan `format` bawaan digunakan untuk mendefinisikan format pada prompt, apabila kosong atau tidak ada `format` yang diberikan. Aturannya seperti yang ditunjukkan: +The default `format` is used to define the format of the prompt, if empty or no `format` is provided. The default is as shown: ```toml format = "$all" @@ -248,13 +260,13 @@ format="$all$directory$character" ## AWS -Module `aws` menampilkan region dan profil AWS terkini. Diperoleh dari variabel environment `AWS_REGION`, `AWS_DEFAULT_REGION`, dan `AWS_PROFILE` pada file `~/.aws/config`. Modul ini juga menampilkan penghitung waktu mundur kedaluwarsa ketika menggunakan temporer kredensial. +The `aws` module shows the current AWS region and profile. This is based on `AWS_REGION`, `AWS_DEFAULT_REGION`, and `AWS_PROFILE` env var with `~/.aws/config` file. This module also shows an expiration timer when using temporary credentials. -Ketika menggunakan [aws-vault](https://github.com/99designs/aws-vault), profil dibaca dari variabel environment `AWS_VAULT` dan tanggal kedaluwarsanya dibaca dari variabel environment `AWS_SESSION_EXPIRATION`. +When using [aws-vault](https://github.com/99designs/aws-vault) the profile is read from the `AWS_VAULT` env var and the credentials expiration date is read from the `AWS_SESSION_EXPIRATION` env var. -Ketika menggunakan [awsu](https://github.com/kreuzwerker/awsu) profil dibaca dari variabel environment `AWSU_PROFILE`. +When using [awsu](https://github.com/kreuzwerker/awsu) the profile is read from the `AWSU_PROFILE` env var. -Ketika menggunakan [AWSume](https://awsu.me) profil dibaca dari variabel environment `AWSUME_PROFILE` dan tanggal kedaluwarsanya dibaca dari variabel environment `AWSUME_EXPIRATION`. +When using [AWSume](https://awsu.me) the profile is read from the `AWSUME_PROFILE` env var and the credentials expiration date is read from the `AWSUME_EXPIRATION` env var. ### Opsi @@ -347,7 +359,7 @@ style = "blue bold" ## Baterai -Modul `battery` menampilkan seberapa penuh baterai perangkat terisi dan status pengisiannya. Modulnya hanya dapat terlihat ketika baterai perangkat di bawah 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%. ### Opsi @@ -375,7 +387,7 @@ discharging_symbol = "💀 " ### Tampilan Baterai -Opsi konfigurasi `display` digunakan untuk menentukan kapan indikator baterai harus ditampilkan (threshold), simbol mana yang akan digunakan (symbol), dan bagaimana seharusnya itu terlihat (style). Jika tidak ada `display` yang diberikan. Aturannya seperti yang ditunjukkan: +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. The default is as shown: ```toml [[battery.display]] @@ -383,11 +395,11 @@ threshold = 10 style = "bold red" ``` -Nilai bawaan untuk opsi `charging_symbol` dan `discharging_symbol` adalah nilai dari masing-masing opsi `charging_symbol` dan `discharging_symbol` dari nilai `battery`. +The default value for the `charging_symbol` and `discharging_symbol` option is respectively the value of `battery`'s `charging_symbol` and `discharging_symbol` option. #### Opsi -Opsi dari `display` merupakan sebuah array dari tabel berikut. +The `display` option is an array of the following table. | Opsi | Bawaan | Deskripsi | | -------------------- | ---------- | -------------------------------------------------------------------------------------------------------------------- | @@ -414,24 +426,24 @@ discharging_symbol = "💦" ## Karakter -Modul `character` menampilkan sebuah karakter (biasanya anak panah) di samping teks pada terminalmu. +The `character` module shows a character (usually an arrow) beside where the text is entered in your terminal. -Karakter dapat memberitahu kamu apakah perintah terakhir berhasil atau tidak. Karakter dapat memberitahumu dengan dua cara ini: +The character will tell you whether the last command was successful or not. It can do this in two ways: - mengganti warna (`red`/`green`) - mengganti bentuk (`❯`/`✖`) -Secara bawaan karakter hanya dapat mengganti warna. Jika kamu juga ingin mengganti bentuknya, perhatikan [contoh](#with-custom-error-shape) berikut. +By default it only changes color. If you also want to change its shape take a look at [this example](#with-custom-error-shape). ::: peringatan -`error_symbol` tidak didukung pada elvish dan nu shell. +`error_symbol` is not supported on nu shell. ::: ::: peringatan -`vicmd_symbol` hanya didukung pada fish dan zsh. +`vicmd_symbol` is only supported in cmd, fish and zsh. ::: @@ -484,7 +496,7 @@ vicmd_symbol = "[V](bold green) " ## CMake -Modul `cmake` menampilkan versi terkini dari [CMake](https://cmake.org/) yang terpasang. Secara bawaan, modul akan aktif jika beberapa syarat berikut telah terpenuhi: +The `cmake` module shows the currently installed version of [CMake](https://cmake.org/). By default the module will be activated if any of the following conditions are met: - Direktori terkini yang berisikan sebuah file `CMakeLists.txt` - Direktori terkini yang berisikan sebuah file `CMakeCache.txt` @@ -544,15 +556,15 @@ The `cobol` module shows the currently installed version of COBOL. By default, t ## Durasi Perintah -Modul `cmd_duration` menampilkan seberapa lama perintah sebelumnya membutuhkan waktu untuk dilaksanakan. Modulnya hanya akan ditampilkan jika perintahnya membutuhkan waktu lebih dari dua detik, atau ada nilai dari konfigurasi `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. -::: jangan lakukan hook DEBUG trap dalam Bash +::: warning Do not hook the DEBUG trap in Bash -Jia kamu menjalankan Starship di `bash`, jangan lakukan hook DEBUG trap setelah menjalankan `eval $(starship init $0)`, atau modulnya **akan** rusak. +If you are running Starship in `bash`, do not hook the `DEBUG` trap after running `eval $(starship init $0)`, or this module **will** break. ::: -Pengguna Bash yang membutuhkan fungsi seperti preexec dapat menggunakan [kerangka kerja bash_preexec dari rcaloras](https://github.com/rcaloras/bash-preexec). Cukup dengan membuat array `preexec_functions` dan `precmd_functions` sebelum menjalankan `eval $(starship init $0)`, lalu lanjutkan seperti biasa. +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. ### Opsi @@ -566,9 +578,9 @@ Pengguna Bash yang membutuhkan fungsi seperti preexec dapat menggunakan [kerangk | `show_notifications` | `false` | Menampilkan notifikasi layar ketika perintah selesai. | | `min_time_to_notify` | `45_000` | Durasi terpendek untuk menampilkan notifikasi (dalam milidetik). | -::: saran +::: tip -Menampilkan notifikasi layar memerlukan starship dikembangkan dengan dukungan dari `rust-notify`. Periksa apakah starship kamu mendukung notifikasi dengan menjalankan `STARSHIP_LOG=debug starship module cmd_duration -d 60000` ketika `show_notifications` diatur menjadi `true`. +Showing desktop notifications requires starship to be built with `notify-rust` support. You check if your starship supports notifications by running `STARSHIP_LOG=debug starship module cmd_duration -d 60000` when `show_notifications` is set to `true`. ::: @@ -595,9 +607,9 @@ format = "underwent [$duration](bold yellow)" The `conda` module shows the current [Conda](https://docs.conda.io/en/latest/) environment, if `$CONDA_DEFAULT_ENV` is set. -::: saran +::: tip -Hal ini tidak menahan pengubah (modifier) prompt dari conda sendiri, kamu mungkin bisa menjalankan `conda config --set changeps1 False`. +This does not suppress conda's own prompt modifier, you may want to run `conda config --set changeps1 False`. ::: @@ -633,7 +645,7 @@ format = "[$symbol$environment](dimmed green) " ## Crystal -Modul `crystal` menampilkan versi terkini dari [Crystal](https://crystal-lang.org/) yang terpasang. Secara bawaan, modul akan aktif jika beberapa syarat berikut telah terpenuhi: +The `crystal` module shows the currently installed version of [Crystal](https://crystal-lang.org/). Secara bawaan, modul akan aktif jika beberapa syarat berikut telah terpenuhi: - Direktori terkini yang berisikan sebuah file `shard.yml` - Direktori terkini yang berisikan sebuah file `.cr` @@ -672,7 +684,7 @@ format = "via [✨ $version](bold blue) " ## Dart -Modul `dart` menampilkan versi terkini dari [Dart](https://dart.dev/) yang terpasang. Secara bawaan, modul akan aktif jika beberapa syarat berikut telah terpenuhi: +The `dart` module shows the currently installed version of [Dart](https://dart.dev/). Secara bawaan, modul akan aktif jika beberapa syarat berikut telah terpenuhi: - Direktori terkini yang berisikan sebuah file berekstensi `.dart` - Direktori terkini yang berisikan sebuah direktori `dart_tool` @@ -712,21 +724,21 @@ format = "via [🔰 $version](bold red) " ## Deno -Modul `deno` menampilkan versi terkini dari [Deno](https://deno.land/) yang terpasang. Secara bawaan, modul akan aktif jika beberapa syarat berikut telah terpenuhi: -- Direktori terkini yang berisikan sebuah file `mod.ts`, `mod.js`, `deps.ts` atau `deps.js` +The `deno` module shows you your currently installed version of [Deno](https://deno.land/). Secara bawaan, modul akan aktif jika beberapa syarat berikut telah terpenuhi: +- The current directory contains a `deno.json`, `deno.jsonc`, `mod.ts`, `mod.js`, `deps.ts` or `deps.js` file ### Opsi -| Opsi | Bawaan | Deskripsi | -| ------------------- | -------------------------------------------- | ----------------------------------------------------------------------------------- | -| `format` | `"via [$symbol($version )]($style)"` | Format dari modul. | -| `version_format` | `"v${raw}"` | Format dari versi. Variabel yang tersedia adalah `raw`, `major`, `minor`, & `patch` | -| `symbol` | `🦕 "` | Sebuah format string yang melambangkan simbol Deno | -| `detect_extensions` | `[]` | Ekstensi mana yang sebaiknya memicu modul ini. | -| `detect_files` | `["mod.ts", "mod.js", "deps.ts", "deps.js"]` | filenames mana yang sebaiknya memicu modul ini. | -| `detect_folders` | `[]` | Folder mana yang sebaiknya memicul modul ini. | -| `style` | `"green bold"` | Gaya penataan untuk modul. | -| `disabled` | `false` | Menonaktifkan modul `deno`. | +| Opsi | Bawaan | Deskripsi | +| ------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | +| `format` | `"via [$symbol($version )]($style)"` | Format dari modul. | +| `version_format` | `"v${raw}"` | Format dari versi. Variabel yang tersedia adalah `raw`, `major`, `minor`, & `patch` | +| `symbol` | `🦕 "` | Sebuah format string yang melambangkan simbol Deno | +| `detect_extensions` | `[]` | Ekstensi mana yang sebaiknya memicu modul ini. | +| `detect_files` | `["deno.json", "deno.jsonc", "mod.ts", "mod.js", "deps.ts", "deps.js"]` | filenames mana yang sebaiknya memicu modul ini. | +| `detect_folders` | `[]` | Folder mana yang sebaiknya memicul modul ini. | +| `style` | `"green bold"` | Gaya penataan untuk modul. | +| `disabled` | `false` | Menonaktifkan modul `deno`. | ### Variabel @@ -747,29 +759,30 @@ format = "via [🦕 $version](green bold) " ## Direktori -Modul `directory` menampilkan arah ke direkori terkinimu, disingkat ke tiga folder induk. Direkrotimu juga akan disingkat ke root dari git repo di tempatmu berada saat ini. +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. -Ketika kamu menggunakan penataan pwd option fish, alih-alih menyembunyikan jalur yang disingkat, kamu akan melihat nama yang disingkat untuk tiap-tiap direktori berdasarkan dari jumlah nomor yang kamu aktifkan untuk opsi tersebut. +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. -Sebagai contoh, untuk `~/Dev/Nix/nixpkgs/pkgs` dimana `nixpkgs` merupakan root repo-nya, dan lalu opsinya diset menjadi `1`. Kamu akan melihat `~/D/N/nixpkgs/pkgs`, sedangkan sebelumnya direktori tersebut harusnya `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`. ### Opsi -| Opsi | Bawaan | Deskripsi | -| ------------------- | -------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `truncation_length` | `3` | Jumlah dari folder induk yang harusnya disingkat oleh direktori saat ini. | -| `truncate_to_repo` | `true` | Apakah harus menyingkat root dari git repo tempatmu berada saat ini. | -| `format` | `"[$path]($style)[$read_only]($read_only_style) "` | Format dari modul. | -| `style` | `"bold cyan"` | Gaya penataan untuk modul. | -| `disabled` | `false` | Menonaktifkan modul `directory`. | -| `read_only` | `"🔒"` | Simbol yang mengindikasikan direktori saat ini bersifat read only. | -| `read_only_style` | `"red"` | Corak gaya untuk simbol read only. | -| `truncation_symbol` | `""` | Simbol untuk awalan jalur yang disingkat. misalnya: ".../" | -| `repo_root_style` | `None` | The style for the root of the git repo when `truncate_to_repo` option is set to false. | -| `home_symbol` | `"~"` | Simbol yang mengindikasikan direktori home. | +| Opsi | Bawaan | Deskripsi | +| ------------------- | -------------------------------------------------- | --------------------------------------------------------------------------------------- | +| `truncation_length` | `3` | Jumlah dari folder induk yang harusnya disingkat oleh direktori saat ini. | +| `truncate_to_repo` | `true` | Apakah harus menyingkat root dari git repo tempatmu berada saat ini. | +| `format` | `"[$path]($style)[$read_only]($read_only_style) "` | Format dari modul. | +| `style` | `"bold cyan"` | Gaya penataan untuk modul. | +| `disabled` | `false` | Menonaktifkan modul `directory`. | +| `read_only` | `"🔒"` | Simbol yang mengindikasikan direktori saat ini bersifat read only. | +| `read_only_style` | `"red"` | Corak gaya untuk simbol read only. | +| `truncation_symbol` | `""` | Simbol untuk awalan jalur yang disingkat. misalnya: ".../" | +| `repo_root_style` | `None` | The style for the root of the git repo when `truncate_to_repo` option is set to false. | +| `home_symbol` | `"~"` | Simbol yang mengindikasikan direktori home. | +| `use_os_path_sep` | `true` | Use the OS specific path seperator instead of always using `/` (e.g. `\` on Windows) |
-Modul ini memilki beberapa opsi konfigurasi lanjutan yang mengontrol bagaimana direktori ditampilkan. +This module has a few advanced configuration options that control how the directory is displayed. | Advanced Option | Bawaan | Deskripsi | | --------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -846,9 +859,9 @@ format = "via [🐋 $context](blue bold)" ## Dotnet -Modul `dotnet` menampilkan informasi terkait versi dari [.NET Core SDK](https://dotnet.microsoft.com/) pada direktori terkini. Apabila SDK telah disematkan pada direktori terkni, maka veri yang telah disematkan tersebutlah yang ditampilkan. Jika tidak, maka modul akan menampilkan versi SDK terkini. +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. -Secara bawaan, modul ini hanya akan ditampilkan ke prompt kamu ketika teradapat satu atau lebih file berikut di dalam direktorimu saat ini: +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: - `global.json` - `project.json` @@ -859,11 +872,11 @@ Secara bawaan, modul ini hanya akan ditampilkan ke prompt kamu ketika teradapat - `*.fsproj` - `*.xproj` -Kamu juga perlu memasang .NET Core SDK untuk menggunakannya dengan baik. +You'll also need the .NET Core SDK installed in order to use it correctly. -Secara internal, modul ini menggunakan mekenasimenya sendiri untuk melakukan pendeteksian versi. Biasanya, hal ini dua kali lebih cepat seperti untuk menjalankan `dotnet --version`, tetapi ada kemungkinan hal ini akan menampilkan versi yang salah jika proyek .NET milikmu memiliki tata letak direktori yang tidak biasa. Jika menurutmu akurasi lebih penting dari kecepatan, kamu dapat menonaktifkan mekanisme tersebut dengan mengatur `heuristic = false` di dalam opsi modul. +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. -Modul ini juga akan menampilkan Target Framework Moniker () ketika terdapat sebuah file csproj di dalam direktori terkini. +The module will also show the Target Framework Moniker () when there is a csproj file in the current directory. ### Opsi @@ -903,7 +916,7 @@ heuristic = false ## Elixir -Modul `elixir` menampilkan versi terkini dari [Elixir](https://elixir-lang.org/) dan [Erlang/OTP](https://erlang.org/doc/). Secara bawaan, modul akan aktif jika beberapa syarat berikut telah terpenuhi: +The `elixir` module shows the currently installed version of [Elixir](https://elixir-lang.org/) and [Erlang/OTP](https://erlang.org/doc/). Secara bawaan, modul akan aktif jika beberapa syarat berikut telah terpenuhi: - Direktori terkini yang berisikan sebuah file `mix.exs`. @@ -942,7 +955,7 @@ symbol = "🔮 " ## Elm -Modul `elixir` menampilkan versi terkini dari [Elm](https://elm-lang.org/) yang terpasang. Secara bawaan, modul akan aktif jika beberapa syarat berikut telah terpenuhi: +The `elm` module shows the currently installed version of [Elm](https://elm-lang.org/). Secara bawaan, modul akan aktif jika beberapa syarat berikut telah terpenuhi: - Direktori terkini yang berisikan sebuah file `elm.json` - Direktori terkini yang berisikan sebuah file `elm-package.json` @@ -984,15 +997,15 @@ format = "via [ $version](cyan bold) " ## Variabel Environment -Modul `env_var` menampilkan nilai terkini dari variabel environment yang dipilih. Modul hanya akan aktif jika beberapa syarat berikut telah terpenuhi: +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: - Opsi konfigurasi `variable` cocok dengan variabel environment yang ada - Opsi konfigurasi `variable` tidak didefinisikan, tapi opsi konfigurasi `default` yang didefinisikan -Multi-variabel environment dapat ditampilkan dengan menggunakan `.`. (lihat contoh) Jika opsi konfigurasi `variable` tidak diset, modul akan menampilkan nilai variabel di bawah teks nama setelah karakter `.`. +::: 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. -Contoh: konfigurasi berikut akan menampilkan nilai dari variabel USER environment +Example: following configuration will display value of USER environment variable ```toml # ~/.config/starship.toml @@ -1031,7 +1044,7 @@ variable = "SHELL" default = "unknown shell" ``` -Menampilkan multi-variabel environment: +Displaying multiple environmental variables: ```toml # ~/.config/starship.toml @@ -1291,7 +1304,7 @@ cherry_pick = "[🍒 PICKING](bold red)" The `git_metrics` module will show the number of added and deleted lines in the current git repository. -::: saran +::: tip This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. @@ -1334,22 +1347,23 @@ The `git_status` module shows symbols representing the state of the repo in your ### Opsi -| Opsi | Bawaan | Deskripsi | -| ------------ | ----------------------------------------------- | ----------------------------------- | -| `format` | `'([\[$all_status$ahead_behind\]]($style) )'` | The default format for `git_status` | -| `conflicted` | `"="` | This branch has merge conflicts. | -| `ahead` | `"⇡"` | The format of `ahead` | -| `behind` | `"⇣"` | The format of `behind` | -| `diverged` | `"⇕"` | The format of `diverged` | -| `up_to_date` | `""` | The format of `up_to_date` | -| `untracked` | `"?"` | The format of `untracked` | -| `stashed` | `"$"` | The format of `stashed` | -| `modified` | `"!"` | The format of `modified` | -| `staged` | `"+"` | The format of `staged` | -| `renamed` | `"»"` | The format of `renamed` | -| `deleted` | `"✘"` | The format of `deleted` | -| `style` | `"bold red"` | Gaya penataan untuk modul. | -| `disabled` | `false` | Disables the `git_status` module. | +| Opsi | Bawaan | Deskripsi | +| ------------------- | ----------------------------------------------- | ----------------------------------- | +| `format` | `'([\[$all_status$ahead_behind\]]($style) )'` | The default format for `git_status` | +| `conflicted` | `"="` | This branch has merge conflicts. | +| `ahead` | `"⇡"` | The format of `ahead` | +| `behind` | `"⇣"` | The format of `behind` | +| `diverged` | `"⇕"` | The format of `diverged` | +| `up_to_date` | `""` | The format of `up_to_date` | +| `untracked` | `"?"` | The format of `untracked` | +| `stashed` | `"$"` | The format of `stashed` | +| `modified` | `"!"` | The format of `modified` | +| `staged` | `"+"` | The format of `staged` | +| `renamed` | `"»"` | The format of `renamed` | +| `deleted` | `"✘"` | The format of `deleted` | +| `style` | `"bold red"` | Gaya penataan untuk modul. | +| `ignore_submodules` | `false` | Ignore changes to submodules. | +| `disabled` | `false` | Disables the `git_status` module. | ### Variabel @@ -1513,10 +1527,10 @@ The `hostname` module shows the system hostname. ### Variabel -| Variabel | Contoh | Deskripsi | -| --------- | ------ | --------------------------------- | -| symbol | | Menyalin nilai dari opsi `symbol` | -| style\* | | Menyalin nilai dari opsi `style` | +| Variabel | Contoh | Deskripsi | +| --------- | ---------- | -------------------------------- | +| hostname | `computer` | The hostname of the computer | +| style\* | | Menyalin nilai dari opsi `style` | \*: Variabel tersebut hanya dapat digunakan sebagai bagian dari penataan string @@ -1720,7 +1734,7 @@ kotlin_binary = "kotlinc" Displays the current [Kubernetes context](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#context) name and, if set, the namespace from the kubeconfig file. The namespace needs to be set in the kubeconfig file, this can be done via `kubectl config set-context starship-cluster --namespace astronaut`. If the `$KUBECONFIG` env var is set the module will use that if not it will use the `~/.kube/config`. -::: saran +::: tip This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. @@ -1848,7 +1862,7 @@ The `memory_usage` module shows current system memory and swap usage. By default the swap usage is displayed if the total system swap is non-zero. -::: saran +::: tip This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. @@ -2133,7 +2147,7 @@ symbol = "☁️ " ## Package Version -The `package` module is shown when the current directory is the repository for a package, and shows its current version. The module currently supports `npm`, `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`, `shards` and `dart` packages. - [**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 @@ -2150,6 +2164,7 @@ The `package` module is shown when the current directory is the repository for a - [**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 - [**SBT**](https://scala-sbt.org) - The `sbt` package version is extracted from the `build.sbt` present in the current directory +- [**Dart**](https://pub.dev/) - The `dart` package version is extracted from the `pubspec.yaml` 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. @@ -2267,7 +2282,7 @@ format = "via [🔹 $version](147 bold) " The `pulumi` module shows the currently selected [Pulumi Stack](https://www.pulumi.com/docs/intro/concepts/stack/) and version. -::: saran +::: tip By default the Pulumi version is not shown, since it takes an order of magnitude longer to load then most plugins (~70ms). If you still want to enable it, [follow the example shown below](#with-pulumi-version). @@ -2393,7 +2408,7 @@ Secara bawaan, modul akan aktif jika beberapa syarat berikut telah terpenuhi: | `detect_folders` | `[]` | Folder mana yang sebaiknya memicul modul ini | | `disabled` | `false` | Disables the `python` module. | -::: saran +::: tip The `python_binary` variable accepts either a string or a list of strings. Starship will try executing each binary until it gets a result. Note you can only change the binary that Starship executes to get the version of Python not the arguments that are used. @@ -2655,7 +2670,7 @@ symbol = "🌟 " The `shell` module shows an indicator for currently used shell. -::: saran +::: tip This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. @@ -2673,6 +2688,8 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y | `elvish_indicator` | `esh` | A format string used to represent elvish. | | `tcsh_indicator` | `tsh` | A format string used to represent tcsh. | | `xonsh_indicator` | `xsh` | A format string used to represent xonsh. | +| `cmd_indicator` | `cmd` | A format string used to represent cmd. | +| `nu_indicator` | `nu` | A format string used to represent nu. | | `unknown_indicator` | | The default value to be displayed when the shell is unknown. | | `format` | `"[$indicator]($style) "` | Format dari modul. | | `style` | `"white bold"` | Gaya penataan untuk modul. | @@ -2772,13 +2789,13 @@ format = '[📦 \[$env\]]($style) ' The `status` module displays the exit code of the previous command. The module will be shown only if the exit code is not `0`. -::: saran +::: tip This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: -::: warning This module is not supported on elvish and nu shell. ::: +::: warning This module is not supported on nu shell. ::: ### Opsi @@ -2804,6 +2821,7 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y | Variabel | Contoh | Deskripsi | | -------------- | ------- | ------------------------------------------------------------------------------------------- | | status | `127` | The exit code of the last command | +| hex_status | `0x7F` | The exit code of the last command in hex | | int | `127` | The exit code of the last command | | common_meaning | `ERROR` | Meaning of the code if not a signal | | signal_number | `9` | Signal number corresponding to the exit code, only if signalled | @@ -2834,7 +2852,7 @@ disabled = false The `sudo` module displays if sudo credentials are currently cached. The module will only be shown if credentials are cached. -::: saran +::: tip This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. @@ -2923,7 +2941,7 @@ format = "via [🏎 $version](red bold)" The `terraform` module shows the currently selected [Terraform workspace](https://www.terraform.io/docs/language/state/workspaces.html) and version. -::: saran +::: tip By default the Terraform version is not shown, since this is slow for current versions of Terraform when a lot of plugins are in use. If you still want to enable it, [follow the example shown below](#with-terraform-version). @@ -2982,7 +3000,7 @@ format = "[🏎💨 $workspace]($style) " The `time` module shows the current **local** time. The `format` configuration value is used by the [`chrono`](https://crates.io/crates/chrono) crate to control how the time is displayed. Take a look [at the chrono strftime docs](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) to see what options are available. -::: saran +::: tip This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. @@ -3033,7 +3051,7 @@ The `username` module shows active user's username. The module will be shown if - The user is currently connected as an SSH session - The variable `show_always` is set to true -::: saran +::: tip SSH connection is detected by checking environment variables `SSH_CONNECTION`, `SSH_CLIENT`, and `SSH_TTY`. If your SSH host does not set up these variables, one workaround is to set one of them with a dummy value. @@ -3171,7 +3189,7 @@ The `vcsh` module displays the current active [VCSH](https://github.com/RichiH/v # ~/.config/starship.toml [vcsh] -format = "via [✨ $repo](bold blue) " +format = "[🆅 $repo](bold blue) " ``` ## Zig @@ -3224,19 +3242,19 @@ These modules will be shown if any of the following conditions are met: - The `when` command returns 0 - The current Operating System (std::env::consts::OS) matchs with `os` field if defined. -::: saran +::: tip Multiple custom modules can be defined by using a `.`. ::: -::: saran +::: tip The order in which custom modules are shown can be individually set by including `${custom.foo}` in the top level `format` (as it includes a dot, you need to use `${...}`). By default, the `custom` module will simply show all custom modules in the order they were defined. ::: -::: saran +::: tip [Issue #1252](https://github.com/starship/starship/discussions/1252) contains examples of custom modules. If you have an interesting example not covered there, feel free to share it there! diff --git a/docs/id-ID/faq/README.md b/docs/id-ID/faq/README.md index e3783255a..ccae2c211 100644 --- a/docs/id-ID/faq/README.md +++ b/docs/id-ID/faq/README.md @@ -69,13 +69,13 @@ If you see symbols that you don't recognise you can use `starship explain` to ex You can enable the debug logs by using the `STARSHIP_LOG` env var. These logs can be very verbose so it is often useful to use the `module` command if you are trying to debug a particular module, for example, if you are trying to debug the `rust` module you could run the following command to get the trace logs and output from the module. ```sh -env STARHIP_LOG=trace starship module rust +env STARSHIP_LOG=trace starship module rust ``` If starship is being slow you can try using the `timings` command to see if there is a particular module or command that to blame. ```sh -env STARHIP_LOG=trace starship timings +env STARSHIP_LOG=trace starship timings ``` This will output the trace log and a breakdown of all modules that either took more than 1ms to execute or produced some output. @@ -118,5 +118,5 @@ If Starship was installed using the install script, the following command will d ```sh # Locate and delete the starship binary -sh -c 'rm "$(which starship)"' +sh -c 'rm "$(command -v 'starship')"' ``` diff --git a/docs/id-ID/guide/README.md b/docs/id-ID/guide/README.md index 57daad077..eb29c5ba3 100644 --- a/docs/id-ID/guide/README.md +++ b/docs/id-ID/guide/README.md @@ -72,6 +72,22 @@ height="20" src="https://raw.githubusercontent.com/starship/starship/master/media/flag-fr.png" alt="Français" + /> +   + Bahasa Indonesia +   + Italiano   @@ -119,7 +119,7 @@ description: Starship è il prompt minimalista, super veloce ed estremamente per #### Elvish - ::: warning È supportato solo elvish v0.15 o superiore. ::: + ::: warning Only elvish v0.17 or higher is supported. ::: Aggiungi quanto segue alla fine di `~/.elvish/rc.elv`: @@ -164,3 +164,14 @@ description: Starship è il prompt minimalista, super veloce ed estremamente per execx($(starship init xonsh)) ``` + + + #### Cmd + + You need to use [Clink](https://chrisant996.github.io/clink/clink.html) (v1.2.30+) with Cmd. Add the following to a file `starship.lua` and place this file in Clink scripts directory: + + ```lua + -- starship.lua + + load(io.popen('starship init cmd'):read("*a"))() + ``` diff --git a/docs/it-IT/advanced-config/README.md b/docs/it-IT/advanced-config/README.md index ea13d2bd2..a944c2db9 100644 --- a/docs/it-IT/advanced-config/README.md +++ b/docs/it-IT/advanced-config/README.md @@ -8,11 +8,35 @@ Le configurazioni in questa sezione sono soggette a modifiche nelle future versi ::: -## Comandi personalizzati di pre-prompt e pre-esecuzione per Bash +## Custom pre-prompt and pre-execution Commands in Cmd -Bash non ha un framework preexec/precmd formale come la maggior parte delle altre shell. Per questo motivo, è difficile fornire hook completamente personalizzabile in `bash`. Tuttavia, Starship dà la limitata possibilità di inserire le tue funzioni nella procedura prompt-rendering: +Clink provides extremely flexible APIs to run pre-prompt and pre-exec commands in Cmd shell. It is fairly simple to use with Starship. Make the following changes to your `starship.lua` file as per your requirements: -- Per eseguire una funzione personalizzata a destra del prompt prima che venga disegnato, definisci una nuova funzione e assegna il suo nome a `starship_precmd_user_func`. Per esempio, per visualizzare l'icona di un razzo prima del prompt, si può usare il codice seguente +- To run a custom function right before the prompt is drawn, define a new function called `starship_preprompt_user_func`. This function receives the current prompt as a string that you can utilize. For example, to draw a rocket before the prompt, you would do + +```lua +function starship_preprompt_user_func(prompt) + print("🚀") +end + +load(io.popen('starship init cmd'):read("*a"))() +``` + +- To run a custom function right before a command is executed, define a new function called `starship_precmd_user_func`. This function receives the current commandline as a string that you can utilize. For example, to print the command that's about to be executed, you would do + +```lua +function starship_precmd_user_func(line) + print("Executing: "..line) +end + +load(io.popen('starship init cmd'):read("*a"))() +``` + +## Custom pre-prompt and pre-execution Commands in Bash + +Bash does not have a formal preexec/precmd framework like most other shells. Because of this, it is difficult to provide fully customizable hooks in `bash`. Tuttavia, Starship dà la limitata possibilità di inserire le tue funzioni nella procedura prompt-rendering: + +- To run a custom function right before the prompt is drawn, define a new function and then assign its name to `starship_precmd_user_func`. For example, to draw a rocket before the prompt, you would do ```bash function blastoff(){ @@ -21,14 +45,14 @@ function blastoff(){ starship_precmd_user_func="blastoff" ``` -- Per eseguire una funzione personalizzata prima dell'esecuzione di un comando, è possibile utilizzare il meccanismo trappola [`DEBUG`](https://jichu4n.com/posts/debug-trap-and-prompt_command-in-bash/). Tuttavia, **devi** intrappolare il segnale DEBUG *prima di* inizializzare Starship! Starship può preservare il valore trappola di DEBUG, ma se la trappola viene sovrascritta dopo l'avvio di Starship, alcune funzionalità non funzioneranno. +- To run a custom function right before a command runs, you can use the [`DEBUG` trap mechanism](https://jichu4n.com/posts/debug-trap-and-prompt_command-in-bash/). However, you **must** trap the DEBUG signal *before* initializing Starship! Starship can preserve the value of the DEBUG trap, but if the trap is overwritten after starship starts up, some functionality will break. ```bash function blastoff(){ echo "🚀" } -trap blastoff DEBUG # Trap DEBUG *prima* di eseguire starship -eval $(starship bash) +trap blastoff DEBUG # Trap DEBUG *before* running starship +eval $(starship init bash) ``` ## Custom pre-prompt and pre-execution Commands in PowerShell @@ -43,35 +67,35 @@ function Invoke-Starship-PreCommand { } ``` -## Cambia il titolo della finestra +## Change Window Title -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`. +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`, `zsh`, `cmd` or `powershell`. -Innanzitutto, bisogna definire una funzione per il cambio del titolo della finestra (identica sia per bash che zsh): +First, define a window title change function (identical in bash and zsh): ```bash function set_win_title(){ - echo -ne "\033]0; IL_TUO_TITOLO_QUI \007" + echo -ne "\033]0; YOUR_WINDOW_TITLE_HERE \007" } ``` -Puoi usare delle variabili per personalizzare questo titolo (`$USER`, `$HOSTNAME`, e `$PWD` sono le scelte più popolari). +You can use variables to customize this title (`$USER`, `$HOSTNAME`, and `$PWD` are popular choices). -In `bash`, impostare questa funzione per essere la precmd Starship function: +In `bash`, set this function to be the precmd starship function: ```bash starship_precmd_user_func="set_win_title" ``` -In `zsh`, aggiungi questo `precmd_functions` all'array: +In `zsh`, add this to the `precmd_functions` array: ```bash precmd_functions+=(set_win_title) ``` -Se ti piace il risultato, aggiungi queste righe al tuo file shell di configurazione (`~/.bashrc` o `~/.zshrc`) per renderlo permanente. +If you like the result, add these lines to your shell configuration file (`~/.bashrc` or `~/.zshrc`) to make it permanent. -Ad esempio, se desideri visualizzare la directory corrente nel titolo della scheda del terminale, aggiungi la seguente snippet al tuo `~/.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`: ```bash function set_win_title(){ @@ -80,6 +104,16 @@ function set_win_title(){ starship_precmd_user_func="set_win_title" ``` +For Cmd, you can change the window title using the `starship_preprompt_user_func` function. + +```lua +function starship_preprompt_user_func(prompt) + console.settitle(os.getenv('USERNAME').."@"..os.getenv('COMPUTERNAME')..": "..os.getcwd()) +end + +load(io.popen('starship init cmd'):read("*a"))() +``` + You can also set a similar output with PowerShell by creating a function named `Invoke-Starship-PreCommand`. ```powershell @@ -97,7 +131,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). -`right_format` is currently supported for the following shells: elvish, fish, zsh. +`right_format` is currently supported for the following shells: elvish, fish, zsh, xonsh, cmd. ### Esempio @@ -117,10 +151,32 @@ Produces a prompt like the following: ▶ starship on  rprompt [!] is 📦 v0.57.0 via 🦀 v1.54.0 took 17s ``` +## Continuation Prompt + +Some shells support a continuation prompt along with the normal prompt. This prompt is rendered instead of the normal prompt when the user has entered an incomplete statement (such as a single left parenthesis or quote). + +Starship can set the continuation prompt using the `continuation_prompt` option. The default prompt is `"[∙](bright-black) "`. + +Note: `continuation_prompt` should be set to a literal string without any variables. + +Note: Continuation prompts are only available in the following shells: + + - `bash` + - `zsh` + - `PowerShell` + +### Esempio + +```toml +# ~/.config/starship.toml + +# A continuation prompt that displays two filled in arrows +continuation_prompt = "▶▶" +``` ## Stile delle Stringhe -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: +Style strings are a list of words, separated by whitespace. The words are not case sensitive (i.e. `bold` and `BoLd` are considered the same string). Each word can be one of the following: - `bold` - `italic` @@ -132,14 +188,14 @@ Le stringhe di stile sono un elenco di parole, separate da spazi bianchi. Le par - `` - `none` -dove `` è un colore specifico (discusso in seguito). `fg:` e `` 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. +where `` is a color specifier (discussed below). `fg:` and `` 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. -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. +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. -Uno colore specifico può essere uno di questi: +A color specifier can be one of the following: - - 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 numero compreso tra 0-255. Specifica un [codice colore ANSI a 8 bit](https://i.stack.imgur.com/KTSQa.png). + - One of the standard terminal colors: `black`, `red`, `green`, `blue`, `yellow`, `purple`, `cyan`, `white`. You can optionally prefix these with `bright-` to get the bright version (e.g. `bright-white`). + - A `#` followed by a six-digit hexadecimal number. This specifies an [RGB color hex code](https://www.w3schools.com/colors/colors_hexadecimal.asp). + - A number between 0-255. This specifies an [8-bit ANSI Color Code](https://i.stack.imgur.com/KTSQa.png). -Se sono specificati più colori per il primo piano/sfondo, l'ultimo nella stringa avrà la priorità. +If multiple colors are specified for foreground/background, the last one in the string will take priority. diff --git a/docs/it-IT/config/README.md b/docs/it-IT/config/README.md index bc54423f7..d585e1717 100644 --- a/docs/it-IT/config/README.md +++ b/docs/it-IT/config/README.md @@ -24,18 +24,24 @@ disabled = true È possibile modificare la posizione predefinita del file di configurazione con la variabile d'ambiente `STARSHIP_CONFIG`: ```sh -export STARSHIP_CONFIG=~/.starship/config.toml +export STARSHIP_CONFIG=~/example/non/default/path/starship.toml ``` Equivalentemente in PowerShell (Windows) potresti aggiungere questa riga al tuo `$PROFILE`: ```powershell -$ENV:STARSHIP_CONFIG = "$HOME\.starship\config.toml" +$ENV:STARSHIP_CONFIG = "$HOME\example\non\default\path\starship.toml" +``` + +Or for Cmd (Windows) would be adding this line to your `starship.lua`: + +```lua +os.setenv('STARSHIP_CONFIG', 'C:\\Users\\user\\example\\non\\default\\path\\starship.toml') ``` ### Logging -Per impostazione predefinita, starship salva i warning e gli errori in un file chiamato `~/.cache/starship/session_${STARSHIP_SESSION_KEY}. og`, dove la chiave di sessione è corrispondente a un'istanza del tuo terminale. Questo, tuttavia, può essere modificato utilizzando la variabile di ambiente `STARSHIP_CACHE`: +By default starship logs warnings and errors into a file named `~/.cache/starship/session_${STARSHIP_SESSION_KEY}.log`, where the session key is corresponding to a instance of your terminal. This, however can be changed using the `STARSHIP_CACHE` environment variable: ```sh export STARSHIP_CACHE=~/.starship/cache @@ -47,23 +53,29 @@ Equivalentemente in PowerShell (Windows) potresti aggiungere questa riga al tuo $ENV:STARSHIP_CACHE = "$HOME\AppData\Local\Temp" ``` +Or for Cmd (Windows) would be adding this line to your `starship.lua`: + +```lua +os.setenv('STARSHIP_CACHE', 'C:\\Users\\user\\AppData\\Local\\Temp') +``` + ### Terminologia -**Modulo**: Un componente nel prompt che dà informazioni basate su informazioni contestuali dal tuo sistema operativo. Ad esempio, il modulo "nodejs" mostra la versione di Node.js attualmente installata sul computer, se la directory corrente è un progetto Node.js. +**Module**: A component in the prompt giving information based on contextual information from your OS. For example, the "nodejs" module shows the version of Node.js that is currently installed on your computer, if your current directory is a Node.js project. -**Variable**: Sotto-componenti più piccoli che contengono informazioni fornite dal modulo. Per esempio, la variabile "version" nel modulo "nodejs" contiene la versione corrente di Node.js. +**Variable**: Smaller sub-components that contain information provided by the module. For example, the "version" variable in the "nodejs" module contains the current version of Node.js. -Per convenzione, la maggior parte dei moduli ha un prefisso di colore predefinito del terminale (ad esempio `via` in "nodejs") e uno spazio vuoto come suffisso. +By convention, most modules have a prefix of default terminal color (e.g. `via` in "nodejs") and an empty space as a suffix. ### Formato Stringhe -Le stringhe di formato sono il formato con cui un modulo stampa tutte le sue variabili. La maggior parte dei moduli ha una voce chiamata `formato` che configura il formato di visualizzazione del modulo. È possibile utilizzare testi, variabili e gruppi di testo in una stringa di formato. +Format strings are the format that a module prints all its variables with. Most modules have an entry called `format` that configures the display format of the module. You can use texts, variables and text groups in a format string. #### Variable -Una variabile contiene un simbolo `$` seguito dal nome della variabile. The name of a variable can only contain 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 `_`. -Per esempio: +For example: - `$version` è una stringa di formato con una variabile chiamata `version`. - `$git_branch$git_commit` è una stringa di formato con due variabili denominate `git_branch` e `git_commit`. @@ -71,13 +83,13 @@ Per esempio: #### Gruppo Testo -Un gruppo di testo è composto da due parti diverse. +A text group is made up of two different parts. -La prima parte, che è racchiusa tra `[]`, è una [format string](#format-strings). È possibile aggiungere testi, variabili o anche gruppi annidati di testo. +The first part, which is enclosed in a `[]`, is a [format string](#format-strings). You can add texts, variables, or even nested text groups in it. -Nella seconda parte, che è racchiusa tra `()`, è presente una [style string](#style-strings). Questa può essere usata per modificare lo stile della prima parte. +In the second part, which is enclosed in a `()`, is a [style string](#style-strings). This can be used to style the first part. -Per esempio: +For example: - `[on](rosso grassetto)` stamperà una stringa `on` con testo in grassetto di colore rosso. - `[⌘ $version](grassetto verde)` stamperà un simbolo `⌘` seguito dal contenuto della variabile `version`, con testo grassetto di colore verde. @@ -85,7 +97,7 @@ Per esempio: #### Stile delle Stringhe -La maggior parte dei moduli in starship ti permettono di configurare i loro stili di visualizzazione. Questo viene fatto con una voce (solitamente chiamata `style`) che è una stringa che specifica la configurazione. Ecco alcuni esempi di stringhe di stile per quello che fanno. Per maggiori dettagli sulla sintassi completa, consulta la [guida di configurazione avanzata](/advanced-config/). +Most modules in starship allow you to configure their display styles. This is done with an entry (usually called `style`) which is a string specifying the configuration. Here are some examples of style strings along with what they do. For details on the full syntax, consult the [advanced config guide](/advanced-config/). - `"fg:green bg:blue"` imposta il testo verde su uno sfondo blu - `"bg:blue fg:bright-green"` imposta un testo verde brillante su uno sfondo blu @@ -94,13 +106,13 @@ La maggior parte dei moduli in starship ti permettono di configurare i loro stil - `"bold italic fg:purple"` imposta il testo viola in corsivo e grassetto - `""` disabilita esplicitamente tutti gli stili -Nota che quello che assomiglia allo stile sarà controllato dal tuo emulatore terminale. Ad esempio, alcuni emulatori di terminale renderanno luminosi i colori invece del testo in grassetto, e alcuni temi colorati useranno gli stessi valori per i colori normali e luminosi. Inoltre, per ottenere il testo in corsivo, il tuo terminale deve supportare il corsivo. +Note that what styling looks like will be controlled by your terminal emulator. For example, some terminal emulators will brighten the colors instead of bolding text, and some color themes use the same values for the normal and bright colors. Also, to get italic text, your terminal must support italics. #### Formattazione condizionale delle stringhe -Una stringa di formato condizionale inserita in `(` e `)` non verrà presentata se tutte le variabili interne sono vuote. +A conditional format string wrapped in `(` and `)` will not render if all variables inside are empty. -Per esempio: +For example: - `(@$region)` will show nothing if the variable `region` is `None` or empty string, otherwise `@` followed by the value of region. - `(some text)` will always show nothing since there are no variables wrapped in the braces. @@ -425,13 +437,13 @@ By default it only changes color. If you also want to change its shape take a lo ::: warning -`error_symbol` is not supported on elvish and nu shell. +`error_symbol` is not supported on nu shell. ::: ::: warning -`vicmd_symbol` is only supported in fish and zsh. +`vicmd_symbol` is only supported in cmd, fish and zsh. ::: @@ -568,7 +580,7 @@ Bash users who need preexec-like functionality can use [rcaloras's bash_preexec ::: tip -Showing desktop notifications requires starship to be built with `rust-notify` support. You check if your starship supports notifications by running `STARSHIP_LOG=debug starship module cmd_duration -d 60000` when `show_notifications` is set to `true`. +Showing desktop notifications requires starship to be built with `notify-rust` support. You check if your starship supports notifications by running `STARSHIP_LOG=debug starship module cmd_duration -d 60000` when `show_notifications` is set to `true`. ::: @@ -713,20 +725,20 @@ format = "via [🔰 $version](bold red) " ## Deno The `deno` module shows you your currently installed version of [Deno](https://deno.land/). By default the module will be shown if any of the following conditions are met: -- The current directory contains a `mod.ts`, `mod.js`, `deps.ts` or `deps.js` file +- The current directory contains a `deno.json`, `deno.jsonc`, `mod.ts`, `mod.js`, `deps.ts` or `deps.js` file ### Opzioni -| Opzione | Default | Descrizione | -| ------------------- | -------------------------------------------- | -------------------------------------------------------------------------------------------- | -| `format` | `"via [$symbol($version )]($style)"` | The format for the module. | -| `version_format` | `"v${raw}"` | Il formato della versione. Le variabili disponibili sono `raw`, `major`, `minore`, & `patch` | -| `symbol` | `"🦕 "` | A format string representing the symbol of Deno | -| `detect_extensions` | `[]` | Quali estensioni dovrebbero attivare questo modulo. | -| `detect_files` | `["mod.ts", "mod.js", "deps.ts", "deps.js"]` | Quali nomi di file dovrebbero attivare questo modulo. | -| `detect_folders` | `[]` | Quali cartelle dovrebbero attivare questo modulo. | -| `style` | `"green bold"` | Lo stile per il modulo. | -| `disabled` | `false` | Disables the `deno` module. | +| Opzione | Default | Descrizione | +| ------------------- | ----------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `format` | `"via [$symbol($version )]($style)"` | The format for the module. | +| `version_format` | `"v${raw}"` | Il formato della versione. Le variabili disponibili sono `raw`, `major`, `minore`, & `patch` | +| `symbol` | `"🦕 "` | A format string representing the symbol of Deno | +| `detect_extensions` | `[]` | Quali estensioni dovrebbero attivare questo modulo. | +| `detect_files` | `["deno.json", "deno.jsonc", "mod.ts", "mod.js", "deps.ts", "deps.js"]` | Quali nomi di file dovrebbero attivare questo modulo. | +| `detect_folders` | `[]` | Quali cartelle dovrebbero attivare questo modulo. | +| `style` | `"green bold"` | Lo stile per il modulo. | +| `disabled` | `false` | Disables the `deno` module. | ### Variables @@ -755,18 +767,19 @@ For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, an ### Opzioni -| Opzione | Default | Descrizione | -| ------------------- | -------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `truncation_length` | `3` | The number of parent folders that the current directory should be truncated to. | -| `truncate_to_repo` | `true` | Whether or not to truncate to the root of the git repo that you're currently in. | -| `format` | `"[$path]($style)[$read_only]($read_only_style) "` | The format for the module. | -| `style` | `"bold cyan"` | Lo stile per il modulo. | -| `disabled` | `false` | Disables the `directory` module. | -| `read_only` | `"🔒"` | The symbol indicating current directory is read only. | -| `read_only_style` | `"red"` | The style for the read only symbol. | -| `truncation_symbol` | `""` | The symbol to prefix to truncated paths. eg: "…/" | -| `repo_root_style` | `None` | The style for the root of the git repo when `truncate_to_repo` option is set to false. | -| `home_symbol` | `"~"` | The symbol indicating home directory. | +| Opzione | Default | Descrizione | +| ------------------- | -------------------------------------------------- | --------------------------------------------------------------------------------------- | +| `truncation_length` | `3` | The number of parent folders that the current directory should be truncated to. | +| `truncate_to_repo` | `true` | Whether or not to truncate to the root of the git repo that you're currently in. | +| `format` | `"[$path]($style)[$read_only]($read_only_style) "` | The format for the module. | +| `style` | `"bold cyan"` | Lo stile per il modulo. | +| `disabled` | `false` | Disables the `directory` module. | +| `read_only` | `"🔒"` | The symbol indicating current directory is read only. | +| `read_only_style` | `"red"` | The style for the read only symbol. | +| `truncation_symbol` | `""` | The symbol to prefix to truncated paths. eg: "…/" | +| `repo_root_style` | `None` | The style for the root of the git repo when `truncate_to_repo` option is set to false. | +| `home_symbol` | `"~"` | The symbol indicating home directory. | +| `use_os_path_sep` | `true` | Use the OS specific path seperator instead of always using `/` (e.g. `\` on Windows) |
This module has a few advanced configuration options that control how the directory is displayed. @@ -1334,22 +1347,23 @@ The `git_status` module shows symbols representing the state of the repo in your ### Opzioni -| Opzione | Default | Descrizione | -| ------------ | ----------------------------------------------- | ----------------------------------- | -| `format` | `'([\[$all_status$ahead_behind\]]($style) )'` | The default format for `git_status` | -| `conflicted` | `"="` | This branch has merge conflicts. | -| `ahead` | `"⇡"` | The format of `ahead` | -| `behind` | `"⇣"` | The format of `behind` | -| `diverged` | `"⇕"` | The format of `diverged` | -| `up_to_date` | `""` | The format of `up_to_date` | -| `untracked` | `"?"` | The format of `untracked` | -| `stashed` | `"$"` | The format of `stashed` | -| `modified` | `"!"` | The format of `modified` | -| `staged` | `"+"` | The format of `staged` | -| `renamed` | `"»"` | The format of `renamed` | -| `deleted` | `"✘"` | The format of `deleted` | -| `style` | `"bold red"` | Lo stile per il modulo. | -| `disabled` | `false` | Disables the `git_status` module. | +| Opzione | Default | Descrizione | +| ------------------- | ----------------------------------------------- | ----------------------------------- | +| `format` | `'([\[$all_status$ahead_behind\]]($style) )'` | The default format for `git_status` | +| `conflicted` | `"="` | This branch has merge conflicts. | +| `ahead` | `"⇡"` | The format of `ahead` | +| `behind` | `"⇣"` | The format of `behind` | +| `diverged` | `"⇕"` | The format of `diverged` | +| `up_to_date` | `""` | The format of `up_to_date` | +| `untracked` | `"?"` | The format of `untracked` | +| `stashed` | `"$"` | The format of `stashed` | +| `modified` | `"!"` | The format of `modified` | +| `staged` | `"+"` | The format of `staged` | +| `renamed` | `"»"` | The format of `renamed` | +| `deleted` | `"✘"` | The format of `deleted` | +| `style` | `"bold red"` | Lo stile per il modulo. | +| `ignore_submodules` | `false` | Ignore changes to submodules. | +| `disabled` | `false` | Disables the `git_status` module. | ### Variables @@ -1513,10 +1527,10 @@ The `hostname` module shows the system hostname. ### Variables -| Variable | Esempio | Descrizione | -| --------- | ------- | ------------------------------------ | -| symbol | | Mirrors the value of option `symbol` | -| style\* | | Mirrors the value of option `style` | +| Variable | Esempio | Descrizione | +| --------- | ---------- | ----------------------------------- | +| hostname | `computer` | The hostname of the computer | +| style\* | | Mirrors the value of option `style` | \*: This variable can only be used as a part of a style string @@ -2133,7 +2147,7 @@ symbol = "☁️ " ## Package Version -The `package` module is shown when the current directory is the repository for a package, and shows its current version. The module currently supports `npm`, `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`, `shards` and `dart` packages. - [**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 @@ -2150,6 +2164,7 @@ The `package` module is shown when the current directory is the repository for a - [**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 - [**SBT**](https://scala-sbt.org) - The `sbt` package version is extracted from the `build.sbt` present in the current directory +- [**Dart**](https://pub.dev/) - The `dart` package version is extracted from the `pubspec.yaml` 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. @@ -2673,6 +2688,8 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y | `elvish_indicator` | `esh` | A format string used to represent elvish. | | `tcsh_indicator` | `tsh` | A format string used to represent tcsh. | | `xonsh_indicator` | `xsh` | A format string used to represent xonsh. | +| `cmd_indicator` | `cmd` | A format string used to represent cmd. | +| `nu_indicator` | `nu` | A format string used to represent nu. | | `unknown_indicator` | | The default value to be displayed when the shell is unknown. | | `format` | `"[$indicator]($style) "` | The format for the module. | | `style` | `"white bold"` | Lo stile per il modulo. | @@ -2778,7 +2795,7 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y ::: -::: warning This module is not supported on elvish and nu shell. ::: +::: warning This module is not supported on nu shell. ::: ### Opzioni @@ -2804,6 +2821,7 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y | Variable | Esempio | Descrizione | | -------------- | ------- | ------------------------------------------------------------------------------------------- | | status | `127` | The exit code of the last command | +| hex_status | `0x7F` | The exit code of the last command in hex | | int | `127` | The exit code of the last command | | common_meaning | `ERROR` | Meaning of the code if not a signal | | signal_number | `9` | Signal number corresponding to the exit code, only if signalled | diff --git a/docs/it-IT/faq/README.md b/docs/it-IT/faq/README.md index 00589c711..21fbfc7b3 100644 --- a/docs/it-IT/faq/README.md +++ b/docs/it-IT/faq/README.md @@ -69,13 +69,13 @@ Se vedi simboli che non riconosci puoi usare `starship explain` per la spiegazio You can enable the debug logs by using the `STARSHIP_LOG` env var. These logs can be very verbose so it is often useful to use the `module` command if you are trying to debug a particular module, for example, if you are trying to debug the `rust` module you could run the following command to get the trace logs and output from the module. ```sh -env STARHIP_LOG=trace starship module rust +env STARSHIP_LOG=trace starship module rust ``` If starship is being slow you can try using the `timings` command to see if there is a particular module or command that to blame. ```sh -env STARHIP_LOG=trace starship timings +env STARSHIP_LOG=trace starship timings ``` This will output the trace log and a breakdown of all modules that either took more than 1ms to execute or produced some output. @@ -117,6 +117,6 @@ Se Starship è stato installato utilizzando un gestore di pacchetti, fai riferim Se Starship è stato installato utilizzando lo script di installazione, il seguente comando eliminerà il file binario: ```sh -# Individua ed elimina il binario di starship -sh -c 'rm "$(which starship)"' +# Locate and delete the starship binary +sh -c 'rm "$(command -v 'starship')"' ``` diff --git a/docs/it-IT/guide/README.md b/docs/it-IT/guide/README.md index a7767d09a..6db39f9d5 100644 --- a/docs/it-IT/guide/README.md +++ b/docs/it-IT/guide/README.md @@ -72,6 +72,22 @@ height="20" src="https://raw.githubusercontent.com/starship/starship/master/media/flag-fr.png" alt="Francese" + /> +   + Bahasa Indonesia +   + Italiano   Giapponese   Portoghese del Brasile   Russo   Vietnamita   Cinese semplificato   Cinese tradizionale

@@ -252,7 +268,7 @@ #### Elvish - **Attenzione** È supportato solo elvish v0.15 o superiore. Aggiungi quanto segue alla fine di `~/.elvish/rc.elv`: + **Warning** Only elvish v0.17 or higher is supported. Aggiungi quanto segue alla fine di `~/.elvish/rc.elv`: ```sh # ~/.elvish/rc.elv @@ -283,6 +299,17 @@ ``` + #### Cmd + + You need to use [Clink](https://chrisant996.github.io/clink/clink.html) (v1.2.30+) with Cmd. Add the following to a file `starship.lua` and place this file in Clink scripts directory: + + ```lua + -- starship.lua + + load(io.popen('starship init cmd'):read("*a"))() + ``` + + #### Nushell **Warning** This will change in the future. È supportata solo la versione v0.33 o superiore. Add the following to your nu config file. Puoi controllare la posizione di questo file eseguendo `percorso di configurazione` in nu. diff --git a/docs/it-IT/presets/README.md b/docs/it-IT/presets/README.md index 70ef76e71..9d83b13ef 100644 --- a/docs/it-IT/presets/README.md +++ b/docs/it-IT/presets/README.md @@ -224,7 +224,7 @@ format = '\[[$symbol($version)]($style)\]' format = '\[[$symbol($version)]($style)\]' [sudo] -format = '\[[as $symbol]\] +format = '\[[as $symbol]\]' [swift] format = '\[[$symbol($version)]($style)\]' diff --git a/docs/ja-JP/README.md b/docs/ja-JP/README.md index a90f4ccb5..d34bfe514 100644 --- a/docs/ja-JP/README.md +++ b/docs/ja-JP/README.md @@ -18,7 +18,7 @@ features: footer: ISC Licensed | Copyright © 2019-present Starship Contributors #Used for the description meta tag, for SEO metaTitle: "Starship: Cross-Shell Prompt" -description: Starship はミニマルで、非常に高速で、カスタマイズ性の高い、あらゆるシェルのためのプロンプトです! ミニマルかつ洗練された形で、あなたに必要な情報を表示します。 Quick installation available for Bash, Fish, ZSH, Ion, Tcsh, Elvish, Nu, Xonsh, and PowerShell. +description: Starship はミニマルで、非常に高速で、カスタマイズ性の高い、あらゆるシェルのためのプロンプトです! ミニマルかつ洗練された形で、あなたに必要な情報を表示します。 Quick installation available for Bash, Fish, ZSH, Ion, Tcsh, Elvish, Nu, Xonsh, Cmd, and PowerShell. ---
@@ -119,7 +119,7 @@ description: Starship はミニマルで、非常に高速で、カスタマイ #### Elvish - ::: warning elvish v0.15以上のみサポートされています。 ::: + ::: warning Only elvish v0.17 or higher is supported. ::: `~/.elvish/rc.elv` の最後に以下を追記してください。 @@ -164,3 +164,14 @@ description: Starship はミニマルで、非常に高速で、カスタマイ execx($(starship init xonsh)) ``` + + + #### Cmd + + You need to use [Clink](https://chrisant996.github.io/clink/clink.html) (v1.2.30+) with Cmd. Add the following to a file `starship.lua` and place this file in Clink scripts directory: + + ```lua + -- starship.lua + + load(io.popen('starship init cmd'):read("*a"))() + ``` diff --git a/docs/ja-JP/advanced-config/README.md b/docs/ja-JP/advanced-config/README.md index 1da10692a..d6a5279fd 100644 --- a/docs/ja-JP/advanced-config/README.md +++ b/docs/ja-JP/advanced-config/README.md @@ -8,11 +8,35 @@ Starship は汎用性の高いシェルですが、時には特定の処理を ::: -## Bashのカスタムの事前プロンプトおよび事前実行コマンド +## Custom pre-prompt and pre-execution Commands in Cmd -Bashには、他のほとんどのシェルとは違い、正式な preexec / precmd フレームワークを持っていません。 そのため、 `bash`で完全にカスタマイズ可能なフックを提供することは困難です。 ただし、Starship はプロンプトを描画する一連の流れに、限定的に独自の関数を挿入することができます。 +Clink provides extremely flexible APIs to run pre-prompt and pre-exec commands in Cmd shell. It is fairly simple to use with Starship. Make the following changes to your `starship.lua` file as per your requirements: -- 関数をプロンプトが描画される直前に実行するためには、新しい関数を定義して `starship_precmd_user_func` に割り当ててください。 例として、ロケットをプロンプトの前に表示させたければ、下記のようにしてください。 +- To run a custom function right before the prompt is drawn, define a new function called `starship_preprompt_user_func`. This function receives the current prompt as a string that you can utilize. For example, to draw a rocket before the prompt, you would do + +```lua +function starship_preprompt_user_func(prompt) + print("🚀") +end + +load(io.popen('starship init cmd'):read("*a"))() +``` + +- To run a custom function right before a command is executed, define a new function called `starship_precmd_user_func`. This function receives the current commandline as a string that you can utilize. For example, to print the command that's about to be executed, you would do + +```lua +function starship_precmd_user_func(line) + print("Executing: "..line) +end + +load(io.popen('starship init cmd'):read("*a"))() +``` + +## Custom pre-prompt and pre-execution Commands in Bash + +Bash does not have a formal preexec/precmd framework like most other shells. Because of this, it is difficult to provide fully customizable hooks in `bash`. ただし、Starship はプロンプトを描画する一連の流れに、限定的に独自の関数を挿入することができます。 + +- To run a custom function right before the prompt is drawn, define a new function and then assign its name to `starship_precmd_user_func`. For example, to draw a rocket before the prompt, you would do ```bash function blastoff(){ @@ -21,13 +45,13 @@ function blastoff(){ starship_precmd_user_func="blastoff" ``` -- コマンドの直前に関数を実行するために、[`DEBUG` トラップの仕組み](https://jichu4n.com/posts/debug-trap-and-prompt_command-in-bash/)を使うことができます。 しかし、Starship を初期化する前に DEBUG シグナルをトラップ*しなければいけません*! Starship は DEBUGトラップの値を保護できますが、 starship の起動後にトラップが上書きされると、いくつかの機能は壊れてしまうでしょう。 +- To run a custom function right before a command runs, you can use the [`DEBUG` trap mechanism](https://jichu4n.com/posts/debug-trap-and-prompt_command-in-bash/). However, you **must** trap the DEBUG signal *before* initializing Starship! Starship can preserve the value of the DEBUG trap, but if the trap is overwritten after starship starts up, some functionality will break. ```bash function blastoff(){ echo "🚀" } -trap blastoff DEBUG # starshipを起動する前にDEBUGをトラップする +trap blastoff DEBUG # Trap DEBUG *before* running starship eval $(starship init bash) ``` @@ -43,11 +67,11 @@ function Invoke-Starship-PreCommand { } ``` -## ウィンドウのタイトルの変更 +## Change Window Title -いくつかのシェルプロンプトはあなたのためにウィンドウのタイトルを自動的に変更します(例えば、カレントディレクトリを反映するために)。 特に Fish はデフォルトで変更を行います。 Starship はこれをしませんが、この機能を `bash` や `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`, `zsh`, `cmd` or `powershell`. -まず、ウィンドウのタイトルを変更する関数を定義してください( bash も zsh も同様に) +First, define a window title change function (identical in bash and zsh): ```bash function set_win_title(){ @@ -55,23 +79,23 @@ function set_win_title(){ } ``` -タイトルをカスタマイズするために変数を利用することができます (`$USER` 、 `$HOSTNAME`、 `$PWD` が一般的です)。 +You can use variables to customize this title (`$USER`, `$HOSTNAME`, and `$PWD` are popular choices). -`bash` では関数を starship の precmd 関数としてセットしてください。 +In `bash`, set this function to be the precmd starship function: ```bash starship_precmd_user_func="set_win_title" ``` -`zsh`では関数を `precmd_functions` の配列に追加してください。 +In `zsh`, add this to the `precmd_functions` array: ```bash precmd_functions+=(set_win_title) ``` -もし結果に満足したら、永続化のためそれぞれの行をシェルの設定ファイル (`~/.bashrc` もしくは `~/.zshrc`) に追加してください。 +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`: ```bash function set_win_title(){ @@ -80,6 +104,16 @@ function set_win_title(){ starship_precmd_user_func="set_win_title" ``` +For Cmd, you can change the window title using the `starship_preprompt_user_func` function. + +```lua +function starship_preprompt_user_func(prompt) + console.settitle(os.getenv('USERNAME').."@"..os.getenv('COMPUTERNAME')..": "..os.getcwd()) +end + +load(io.popen('starship init cmd'):read("*a"))() +``` + You can also set a similar output with PowerShell by creating a function named `Invoke-Starship-PreCommand`. ```powershell @@ -91,13 +125,13 @@ function Invoke-Starship-PreCommand { Invoke-Expression (&starship init powershell) ``` -## 右プロンプトの有効化 +## Enable Right Prompt -シェルによっては、入力と同じ行にレンダリングされる右プロンプトをサポートしています。 Starship では `right_format` オプションを使って右プロンプトの内容を設定できます。 `format`で使用できるモジュールはすべて`right_format`でも使用できます。 変数`$all`には、`format`や`right_format`で明示的に使用されていないモジュールのみが格納されます。 +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`. -注意: 右プロンプトは入力の場所に続く単一の行です。 複数行のプロンプトで入力行の上を右寄せにするには、[fillモジュール](/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` は現在、次のシェルでサポートされています: elvish, fish, zsh +`right_format` is currently supported for the following shells: elvish, fish, zsh, xonsh, cmd. ### 設定例 @@ -111,16 +145,38 @@ format = """$character""" right_format = """$all""" ``` -次のようなプロンプトが生成されます: +Produces a prompt like the following: ``` ▶ starship on  rprompt [!] is 📦 v0.57.0 via 🦀 v1.54.0 took 17s ``` +## Continuation Prompt + +Some shells support a continuation prompt along with the normal prompt. This prompt is rendered instead of the normal prompt when the user has entered an incomplete statement (such as a single left parenthesis or quote). + +Starship can set the continuation prompt using the `continuation_prompt` option. The default prompt is `"[∙](bright-black) "`. + +Note: `continuation_prompt` should be set to a literal string without any variables. + +Note: Continuation prompts are only available in the following shells: + + - `bash` + - `zsh` + - `PowerShell` + +### 設定例 + +```toml +# ~/.config/starship.toml + +# A continuation prompt that displays two filled in arrows +continuation_prompt = "▶▶" +``` ## スタイルの設定 -スタイル文字列は空白で区切られた単語のリストです。 大文字小文字を区別しません(例えば、 `bold` と`BoLd` は同じだとみなされます)。 それぞれ以下のいずれか一つが該当します。 +Style strings are a list of words, separated by whitespace. The words are not case sensitive (i.e. `bold` and `BoLd` are considered the same string). Each word can be one of the following: - `bold` - `italic` @@ -132,14 +188,14 @@ right_format = """$all""" - `` - `none` -ここで、 `` は色を指定します(以下で述べます)。 現在 `fg:` と `` は同様の動作ですが、将来変更される可能性があります。 `inverted` は背景と前景の色を交換します。 文字列中の単語の順序は関係ありません。 +where `` is a color specifier (discussed below). `fg:` and `` 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. -`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` を他の単語と一緒に使用することはエラーになるかもしれません。 +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. -色は以下のいずれか1つを指定できます。 +A color specifier can be one of the following: - - 標準的なターミナルカラーの `black`、 `red`、 `green`、 `blue`、 `yellow`、 `purple`、 `cyan`、 `white`。 必要に応じて、より明るい色を得るために `bright-` を前につけることができます。(例えば、 `bright-white` ) - - `#` に続く16進数。 [RGB の16進数カラーコード](https://www.w3schools.com/colors/colors_hexadecimal.asp)を表します。 - - 0-255 までの間の数字。 [8-bit ANSI カラーコード](https://i.stack.imgur.com/KTSQa.png) を表します。 + - One of the standard terminal colors: `black`, `red`, `green`, `blue`, `yellow`, `purple`, `cyan`, `white`. You can optionally prefix these with `bright-` to get the bright version (e.g. `bright-white`). + - A `#` followed by a six-digit hexadecimal number. This specifies an [RGB color hex code](https://www.w3schools.com/colors/colors_hexadecimal.asp). + - A number between 0-255. This specifies an [8-bit ANSI Color Code](https://i.stack.imgur.com/KTSQa.png). -複数の色が文字色/背景色に指定された際には、最後の指定が優先して選ばれます。 +If multiple colors are specified for foreground/background, the last one in the string will take priority. diff --git a/docs/ja-JP/config/README.md b/docs/ja-JP/config/README.md index 94f1ccf6a..2f13517d5 100644 --- a/docs/ja-JP/config/README.md +++ b/docs/ja-JP/config/README.md @@ -24,18 +24,24 @@ disabled = true `STARSHIP_CONFIG` 環境変数を使用することによって、デフォルトの設定ファイルの場所を変更できます。 ```sh -export STARSHIP_CONFIG=~/.starship/config.toml +export STARSHIP_CONFIG=~/example/non/default/path/starship.toml ``` PowerShell (Windows) で同様に `$PROFILE` にこの行を追加します。 ```powershell -$ENV:STARSHIP_CONFIG = "$HOME\.starship\config.toml" +$ENV:STARSHIP_CONFIG = "$HOME\example\non\default\path\starship.toml" +``` + +Or for Cmd (Windows) would be adding this line to your `starship.lua`: + +```lua +os.setenv('STARSHIP_CONFIG', 'C:\\Users\\user\\example\\non\\default\\path\\starship.toml') ``` ### ロギング -デフォルトでは、Starship は警告やエラーログを `~/.cache/starship/session_${STARSHIP_SESSION_KEY}.log` という名前のファイルに出力します。このセッションキーはターミナルのインスタンスに相当します。 しかし、これは `STARSHIP_CACHE` という環境変数を使って変更できます: +By default starship logs warnings and errors into a file named `~/.cache/starship/session_${STARSHIP_SESSION_KEY}.log`, where the session key is corresponding to a instance of your terminal. This, however can be changed using the `STARSHIP_CACHE` environment variable: ```sh export STARSHIP_CACHE=~/.starship/cache @@ -47,23 +53,29 @@ PowerShell (Windows) で同様に `$PROFILE` にこの行を追加します。 $ENV:STARSHIP_CACHE = "$HOME\AppData\Local\Temp" ``` +Or for Cmd (Windows) would be adding this line to your `starship.lua`: + +```lua +os.setenv('STARSHIP_CACHE', 'C:\\Users\\user\\AppData\\Local\\Temp') +``` + ### 用語 -**モジュール**: OSのコンテキスト情報に基づいて情報を提供するプロンプト内のコンポーネントです。 例えば、現在のディレクトリが Node.js のプロジェクトの場合、現在コンピュータにインストールされている Node.js のバージョンが表示されます。 +**Module**: A component in the prompt giving information based on contextual information from your OS. For example, the "nodejs" module shows the version of Node.js that is currently installed on your computer, if your current directory is a Node.js project. -**変数**: モジュールが提供する情報を含むサブコンポーネントを小さくする。 例えば、"nodejs" モジュールの "version" 変数には、Node.js の現在のバージョンが含まれています。 +**Variable**: Smaller sub-components that contain information provided by the module. For example, the "version" variable in the "nodejs" module contains the current version of Node.js. -慣例により、ほとんどのモジュールにはデフォルトの端末色の接頭辞("nodejs" の `via` など)と接尾辞として空のスペースがあります。 +By convention, most modules have a prefix of default terminal color (e.g. `via` in "nodejs") and an empty space as a suffix. ### 文字列のフォーマット -文字列の書式は、モジュールがすべての変数を出力する書式です。 ほとんどのモジュールには、モジュールの表示形式を設定する `format` というエントリがあります。 テキスト、変数、およびテキストグループをフォーマット文字列で使用できます。 +Format strings are the format that a module prints all its variables with. Most modules have an entry called `format` that configures the display format of the module. You can use texts, variables and text groups in a format string. #### 変数 -変数には、 `$` 記号と、その変数の名前が続きます。 The name of a variable can only contain 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: - `$version` は、`version` という名前の変数を持つフォーマット文字列です。 - `$git_branch$git_commit` は `git_branch` と `git_commit` という2つの変数を持つフォーマット文字列です。 @@ -71,13 +83,13 @@ $ENV:STARSHIP_CACHE = "$HOME\AppData\Local\Temp" #### テキストグループ -テキストグループは二つの異なる部分で構成されています。 +A text group is made up of two different parts. -`[]`で囲まれている最初の部分は、 [フォーマット文字列](#format-strings) です。 テキスト、変数、または入れ子になったテキストグループを追加できます。 +The first part, which is enclosed in a `[]`, is a [format string](#format-strings). You can add texts, variables, or even nested text groups in it. -2 番目の部分では、 `()`で囲まれている [スタイル文字列](#style-strings) です。 This can be used to style the first part. +In the second part, which is enclosed in a `()`, is a [style string](#style-strings). This can be used to style the first part. -例: +For example: - `[on](red bold)` は文字列 `on` に太字のテキストを赤色で表示します。 - `[⌘ $version](bold green)` は `⌘` 記号とその後に続く変数 `version` の値を、太字の緑色で表示します。 @@ -85,7 +97,7 @@ $ENV:STARSHIP_CACHE = "$HOME\AppData\Local\Temp" #### スタイルの設定 -Starshipのほとんどのモジュールでは、表示スタイルを設定できます。 これは、設定を指定する文字列であるエントリ(`style`)で行われます。 スタイル文字列の例とその機能を次に示します。 完全な構文の詳細については、詳細は [高度な設定](/advanced-config/)を参照してください 。 +Most modules in starship allow you to configure their display styles. This is done with an entry (usually called `style`) which is a string specifying the configuration. Here are some examples of style strings along with what they do. For details on the full syntax, consult the [advanced config guide](/advanced-config/). - `"fg:green bg:blue"` は、青色の背景に緑色のテキストを設定します - `"bg:blue fg:bright-green"` は、青色の背景に明るい緑色のテキストを設定します @@ -94,13 +106,13 @@ Starshipのほとんどのモジュールでは、表示スタイルを設定で - `"bold italic fg:purple"`は、紫色の太字斜体のテキストを設定します - `""` はすべてのスタイルを明示的に無効にします -スタイリングがどのように見えるかは、端末エミュレータによって制御されることに注意してください。 たとえば、一部の端末エミュレータはテキストを太字にする代わりに色を明るくします。また、一部のカラーテーマは通常の色と明るい色と同じ値を使用します。 また、斜体のテキストを取得するには、端末で斜体をサポートする必要があります。 +Note that what styling looks like will be controlled by your terminal emulator. For example, some terminal emulators will brighten the colors instead of bolding text, and some color themes use the same values for the normal and bright colors. Also, to get italic text, your terminal must support italics. #### 条件付きフォーマット設定 -`(` と `)` 内のすべての変数が空の場合、条件付き書式文字列はレンダリングされません。 +A conditional format string wrapped in `(` and `)` will not render if all variables inside are empty. -例: +For example: - `(@$region)` は`region`が`None`または空だった場合表示されませんが、値がある場合は`@` に続いてregionの値が表示されます。 - `(some text)` は括弧の中に変数がないので、常に何も表示しません。 @@ -112,18 +124,18 @@ 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 `\\`). -例えば、新しい行に `$` 記号を表示したい場合、以下の `format` の設定が等価です。 +For example, when you want to print a `$` symbol on a new line, the following configs for `format` are equivalent: ```toml -# 基本文字列と +# with basic string format = "\n\\$" -# 複数行の基本文字列と +# with multiline basic string format = """ \\$""" -# リテラル文字列と +# with literal string format = ''' \$''' @@ -131,7 +143,7 @@ format = ''' ## プロンプト -これは、プロンプト全体のオプションのリストです。 +This is the list of prompt-wide configuration options. ### オプション @@ -149,23 +161,22 @@ format = ''' ```toml # ~/.config/starship.toml -# カスタムフォーマットを利用します +# Use custom format format = """ [┌───────────────────>](bold green) [│](bold green)$directory$rust$package [└─>](bold green) """ -# starshipが現在のディレクトリ下のファイルをチェックするまで10ミリ秒待ちます - +# Wait 10 milliseconds for starship to check files under the current directory. scan_timeout = 10 -# プロンプトの先頭の空行を無効にします +# Disable the blank line at the start of the prompt add_newline = false ``` ### デフォルトのプロンプトフォーマット -デフォルトの `format` は、空または `format` が指定されていない場合、プロンプトのフォーマットを定義するために使用されます。 デフォルトは次のとおりです。 +The default `format` is used to define the format of the prompt, if empty or no `format` is provided. The default is as shown: ```toml format = "$all" @@ -249,11 +260,11 @@ format="$all$directory$character" ## AWS -`aws` モジュールは現在のAWSプロファイルが表示されます。 これは `~/.aws/config` に記述されている `AWS_REGION`, `AWS_DEFAULT_REGION`, and `AWS_PROFILE` 環境変数に基づいています。 This module also shows an expiration timer when using temporary credentials. +The `aws` module shows the current AWS region and profile. This is based on `AWS_REGION`, `AWS_DEFAULT_REGION`, and `AWS_PROFILE` env var with `~/.aws/config` file. This module also shows an expiration timer when using temporary credentials. When using [aws-vault](https://github.com/99designs/aws-vault) the profile is read from the `AWS_VAULT` env var and the credentials expiration date is read from the `AWS_SESSION_EXPIRATION` env var. -[awsu](https://github.com/kreuzwerker/awsu) を使う場合、そのプロファイルは環境変数 `AWSU_PROFILE` から読まれます。 +When using [awsu](https://github.com/kreuzwerker/awsu) the profile is read from the `AWSU_PROFILE` env var. When using [AWSume](https://awsu.me) the profile is read from the `AWSUME_PROFILE` env var and the credentials expiration date is read from the `AWSUME_EXPIRATION` env var. @@ -348,7 +359,7 @@ style = "blue bold" ## バッテリー -`battery`モジュールは、デバイスのバッテリー残量と現在の充電状態を示します。 モジュールは、デバイスのバッテリー残量が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%. ### オプション @@ -376,7 +387,7 @@ discharging_symbol = "💀 " ### バッテリーの表示 -`display`オプションを使用して、バッテリーインジケーターを表示するタイミング(threshold)、どのシンボルが使われるか(symbol) と外観(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. The default is as shown: ```toml [[battery.display]] @@ -384,11 +395,11 @@ threshold = 10 style = "bold red" ``` -`charging_symbol`と`discharging_symbol`オプションのデフォルト値はそれぞれ`battery`の `charging_symbol`と`discharging_symbol`になります。 +The default value for the `charging_symbol` and `discharging_symbol` option is respectively the value of `battery`'s `charging_symbol` and `discharging_symbol` option. #### オプション -`display`オプションは、次の表の通りです。 +The `display` option is an array of the following table. | オプション | デフォルト | 説明 | | -------------------- | ---------- | -------------------------------------------------------------------------------------- | @@ -415,24 +426,24 @@ discharging_symbol = "💦" ## Character -`character`モジュールは、端末でテキストが入力される場所の横に文字(通常は矢印)を表示します。 +The `character` module shows a character (usually an arrow) beside where the text is entered in your terminal. -文字は、最後のコマンドが成功したかどうかを示します。 表し方は下記の2つです。 +The character will tell you whether the last command was successful or not. It can do this in two ways: - 色の変更 (`赤`/`緑`) - プロンプトの表示の変更 (`❯`/`✖`) -デフォルトでは、色だけが変更されます。 形も変えてみたい場合は[このサンプル](#with-custom-error-shape)も参考にしてください。 +By default it only changes color. If you also want to change its shape take a look at [this example](#with-custom-error-shape). ::: warning -`error_symbol`はelvishとnu shellでサポートされていません。 +`error_symbol` is not supported on nu shell. ::: ::: warning -`vicmd_symbol`はfishとzshのみでサポートされています。 +`vicmd_symbol` is only supported in cmd, fish and zsh. ::: @@ -485,7 +496,7 @@ vicmd_symbol = "[V](bold green) " ## CMake -`cmake`モジュールは、現在インストールされている[Cmake](https://cmake.org/)のバージョンを表示します。 デフォルトでは次のいずれかの条件が満たされると、モジュールがアクティブになります。 +The `cmake` module shows the currently installed version of [CMake](https://cmake.org/). By default the module will be activated if any of the following conditions are met: - カレントディレクトリに `CMakeLists.txt` ファイルが含まれている - カレントディレクトリに `CMakeCache.txt` ファイルが含まれている @@ -515,7 +526,7 @@ vicmd_symbol = "[V](bold green) " ## COBOL / GNUCOBOL -`COBOL` モジュールは、現在インストールされているCOBOLのバージョンを表示します。 By default, the module will be shown if any of the following conditions are met: +The `cobol` module shows the currently installed version of COBOL. By default, the module will be shown if any of the following conditions are met: - The current directory contains any files ending in `.cob` or `.COB` - The current directory contains any files ending in `.cbl` or `.CBL` @@ -545,15 +556,15 @@ vicmd_symbol = "[V](bold green) " ## Command Duration -`cmd_duration`モジュールは、最後のコマンドの実行にかかった時間を示します。 モジュールが表示されるのは、コマンドが2秒以上かかった場合、または`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トラップをhookしない +::: warning Do not hook the DEBUG trap in Bash -`bash`でStarshipを実行している場合、 `eval $(starship init $0)`実行した後に`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. ::: -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. ### オプション @@ -569,7 +580,7 @@ preexecのような機能を必要とするBashユーザーは、 [rcalorasのba ::: tip -デスクトップ通知を表示するには、 `rust-notify` をサポートしているstarshipをビルドする必要があります。 `show_notifications` が `true` となっている状態で `STARSHIP_LOG=debug starship module cmd_duration -d 60000` を実行することにより、starshipが通知をサポートしているかを確認することができます。 +Showing desktop notifications requires starship to be built with `notify-rust` support. You check if your starship supports notifications by running `STARSHIP_LOG=debug starship module cmd_duration -d 60000` when `show_notifications` is set to `true`. ::: @@ -598,7 +609,7 @@ The `conda` module shows the current [Conda](https://docs.conda.io/en/latest/) e ::: tip -Note: これは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`. ::: @@ -634,7 +645,7 @@ format = "[$symbol$environment](dimmed green) " ## Crystal -`crystal`モジュールは、現在インストールされている[Crystal](https://crystal-lang.org/)のバージョンを表示します。 デフォルトでは次の条件のいずれかが満たされると、モジュールが表示されます。 +The `crystal` module shows the currently installed version of [Crystal](https://crystal-lang.org/). デフォルトでは次の条件のいずれかが満たされると、モジュールが表示されます。 - カレントディレクトリに`shard.yml`ファイルが含まれている - カレントディレクトリに`.cr`の拡張子のファイルが含まれている @@ -673,7 +684,7 @@ format = "via [✨ $version](bold blue) " ## Dart -`dart`モジュールは、現在インストールされている[Dart](https://dart.dev/)のバージョンを表示します。 デフォルトでは次の条件のいずれかが満たされると、モジュールが表示されます。 +The `dart` module shows the currently installed version of [Dart](https://dart.dev/). デフォルトでは次の条件のいずれかが満たされると、モジュールが表示されます。 - カレントディレクトリに`.dart`の拡張子のファイルが含まれている - カレントディレクトリに`.dart_tool`ディレクトリが含まれている @@ -713,21 +724,21 @@ format = "via [🔰 $version](bold red) " ## Deno -`deno`モジュールは、現在インストールされている[Deno](https://deno.land/)のバージョンを表示します。 デフォルトでは次の条件のいずれかが満たされると、モジュールが表示されます。 -- カレントディレクトリに`mod.ts`、`mod.js`、`deps.ts`か`deps.js`が含まれている +The `deno` module shows you your currently installed version of [Deno](https://deno.land/). デフォルトでは次の条件のいずれかが満たされると、モジュールが表示されます。 +- The current directory contains a `deno.json`, `deno.jsonc`, `mod.ts`, `mod.js`, `deps.ts` or `deps.js` file ### オプション -| オプション | デフォルト | 説明 | -| ------------------- | -------------------------------------------- | ------------------------------------------------------ | -| `format` | `"via [$symbol($version )]($style)"` | moduleのフォーマットです。 | -| `version_format` | `"v${raw}"` | バージョンのフォーマット。 使用可能な変数は`raw`、`major`、`minor`と`patch`です。 | -| `symbol` | `"🦕 "` | Dart のシンボルを表すフォーマット文字列 | -| `detect_extensions` | `[]` | どの拡張子がこのモジュールをアクティブにするか | -| `detect_files` | `["mod.ts", "mod.js", "deps.ts", "deps.js"]` | どのファイル名がこのモジュールをアクティブにするか | -| `detect_folders` | `[]` | どのフォルダーがこのモジュールをアクティブにするか | -| `style` | `"green bold"` | モジュールのスタイルです。 | -| `disabled` | `false` | `deno`モジュールを無効化します。 | +| オプション | デフォルト | 説明 | +| ------------------- | ----------------------------------------------------------------------- | ------------------------------------------------------ | +| `format` | `"via [$symbol($version )]($style)"` | moduleのフォーマットです。 | +| `version_format` | `"v${raw}"` | バージョンのフォーマット。 使用可能な変数は`raw`、`major`、`minor`と`patch`です。 | +| `symbol` | `"🦕 "` | Dart のシンボルを表すフォーマット文字列 | +| `detect_extensions` | `[]` | どの拡張子がこのモジュールをアクティブにするか | +| `detect_files` | `["deno.json", "deno.jsonc", "mod.ts", "mod.js", "deps.ts", "deps.js"]` | どのファイル名がこのモジュールをアクティブにするか | +| `detect_folders` | `[]` | どのフォルダーがこのモジュールをアクティブにするか | +| `style` | `"green bold"` | モジュールのスタイルです。 | +| `disabled` | `false` | `deno`モジュールを無効化します。 | ### 変数 @@ -748,29 +759,30 @@ format = "via [🦕 $version](green bold) " ## Directory -`directory`モジュールには、現在のディレクトリへのパスが表示され、3つの親フォルダは切り捨てられます。 ディレクトリは、現在の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`に設定されている場合を挙げます。 以前は`nixpkgs/pkgs`でしたが、`~/D/N/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`. ### オプション -| オプション | デフォルト | 説明 | -| ------------------- | -------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `truncation_length` | `3` | 現在のディレクトリを切り捨てる親フォルダーの数です。 | -| `truncate_to_repo` | `true` | 現在いるgitリポジトリのルートに切り捨てるかどうかです。 | -| `format` | `"[$path]($style)[$read_only]($read_only_style) "` | moduleのフォーマットです。 | -| `style` | `"bold cyan"` | モジュールのスタイルです。 | -| `disabled` | `false` | `directory`モジュールを無効にします。 | -| `read_only` | `"🔒"` | このシンボルが表示されている時、現在のディレクトリは読み取り専用です。 | -| `read_only_style` | `"red"` | 読み取り専用シンボルのスタイルです。 | -| `truncation_symbol` | `""` | The symbol to prefix to truncated paths. 例: "…/" | -| `repo_root_style` | `None` | The style for the root of the git repo when `truncate_to_repo` option is set to false. | -| `home_symbol` | `"~"` | ホームディレクトリを示すシンボルです。 | +| オプション | デフォルト | 説明 | +| ------------------- | -------------------------------------------------- | --------------------------------------------------------------------------------------- | +| `truncation_length` | `3` | 現在のディレクトリを切り捨てる親フォルダーの数です。 | +| `truncate_to_repo` | `true` | 現在いるgitリポジトリのルートに切り捨てるかどうかです。 | +| `format` | `"[$path]($style)[$read_only]($read_only_style) "` | moduleのフォーマットです。 | +| `style` | `"bold cyan"` | モジュールのスタイルです。 | +| `disabled` | `false` | `directory`モジュールを無効にします。 | +| `read_only` | `"🔒"` | このシンボルが表示されている時、現在のディレクトリは読み取り専用です。 | +| `read_only_style` | `"red"` | 読み取り専用シンボルのスタイルです。 | +| `truncation_symbol` | `""` | The symbol to prefix to truncated paths. 例: "…/" | +| `repo_root_style` | `None` | The style for the root of the git repo when `truncate_to_repo` option is set to false. | +| `home_symbol` | `"~"` | ホームディレクトリを示すシンボルです。 | +| `use_os_path_sep` | `true` | Use the OS specific path seperator instead of always using `/` (e.g. `\` on Windows) |
-このモジュールは、どのようにディレクトリを表示するかについての高度なオプションをいくつか持っています。 +This module has a few advanced configuration options that control how the directory is displayed. | Advanced Option | デフォルト | 説明 | | --------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -847,9 +859,9 @@ format = "via [🐋 $context](blue bold)" ## Dotnet -`dotnet`モジュールはカレントディレクトリに関係する[.NET Core SDK](https://dotnet.microsoft.com/)のバージョンを表示します。 もし 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: - `global.json` - `project.json` @@ -862,7 +874,7 @@ format = "via [🐋 $context](blue bold)" You'll also need the .NET Core SDK installed in order to use it correctly. -内部的に、このモジュールは自身のバージョン検知のメカニズムを利用します。 `dotnet --version` を実行するより2倍速く実行できますが、.NET project一般的でないディレクトリlayoutの場合は間違ったバージョンが示されてしまうことがあります。 速度よりも精度が重要な場合は、次の方法でメカニズムを無効にできます。 モジュールオプションで`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 () when there is a csproj file in the current directory. @@ -985,7 +997,7 @@ format = "via [ $version](cyan bold) " ## 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`オプションが、既存の環境変数と一致する - `variable`オプションが定義されておらず、`default`オプションが定義されている @@ -1084,7 +1096,7 @@ format = "via [e $version](bold red) " ## Fill -`fill` モジュールは行の余分なスペースを記号で埋めます。 一行に複数の`fill`モジュールが存在する場合、それらはスペースを均等に分割します。 これは、他のモジュールの位置合わせに便利です。 +The `fill` module fills any extra space on the line with a symbol. If multiple `fill` modules are present in a line they will split the space evenly between them. This is useful for aligning other modules. ### オプション @@ -1114,7 +1126,7 @@ AA -------------------------------------------- BB ----------------------------- ## Google Cloud (`gcloud`) -`gcloud` モジュールは、 [`gcloud`](https://cloud.google.com/sdk/gcloud) CLIの現在の設定が表示されます。 これは `~/.config/gcloud/active_config` ファイルと `~/.config/gcloud/configurations/config_{CONFIG NAME}` ファイルと `CLOUDSDK_CONFIG` 環境変数に基づきます。 +The `gcloud` module shows the current configuration for [`gcloud`](https://cloud.google.com/sdk/gcloud) CLI. This is based on the `~/.config/gcloud/active_config` file and the `~/.config/gcloud/configurations/config_{CONFIG NAME}` file and the `CLOUDSDK_CONFIG` env var. ### オプション @@ -1175,7 +1187,7 @@ asia-northeast1 = "an1" ## Git Branch -`git_branch`モジュールは、現在のディレクトリにあるリポジトリのアクティブなブランチを表示します。 +The `git_branch` module shows the active branch of the repo in your current directory. ### オプション @@ -1215,7 +1227,7 @@ truncation_symbol = "" ## Git Commit -`git_commit` モジュールは、カレントディレクトリのリポジトリの現在のコミットハッシュとタグ (もしあれば) を表示します。 +The `git_commit` module shows the current commit hash and also the tag (if any) of the repo in your current directory. ### オプション @@ -1250,7 +1262,7 @@ tag_symbol = "🔖 " ## 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. ### オプション @@ -1294,7 +1306,7 @@ The `git_metrics` module will show the number of added and deleted lines in the ::: tip -このモジュールはデフォルトで無効になっています。 有効にするには、設定ファイルで`disabled`を`false`に設定します。 +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: @@ -1331,30 +1343,31 @@ format = '[+$added]($added_style)/[-$deleted]($deleted_style) ' ## Git Status -`git_status`モジュールは、現在のディレクトリのリポジトリの状態を表すシンボルを表示します。 +The `git_status` module shows symbols representing the state of the repo in your current directory. ### オプション -| オプション | デフォルト | 説明 | -| ------------ | ----------------------------------------------- | -------------------------- | -| `format` | `'([\[$all_status$ahead_behind\]]($style) )'` | `git_status` のデフォルトフォーマット | -| `conflicted` | `"="` | このブランチにはマージの競合があります。 | -| `ahead` | `"⇡"` | `ahead`のフォーマット | -| `behind` | `"⇣"` | `behind`のフォーマット | -| `diverged` | `"⇕"` | `diverged`のフォーマット | -| `up_to_date` | `""` | The format of `up_to_date` | -| `untracked` | `"?"` | The format of `untracked` | -| `stashed` | `"$"` | The format of `stashed` | -| `modified` | `"!"` | The format of `modified` | -| `staged` | `"+"` | The format of `staged` | -| `renamed` | `"»"` | The format of `renamed` | -| `deleted` | `"✘"` | The format of `deleted` | -| `style` | `"bold red"` | モジュールのスタイルです。 | -| `disabled` | `false` | `git_status`モジュールを無効にします。 | +| オプション | デフォルト | 説明 | +| ------------------- | ----------------------------------------------- | --------------------------------- | +| `format` | `'([\[$all_status$ahead_behind\]]($style) )'` | `git_status` のデフォルトフォーマット | +| `conflicted` | `"="` | このブランチにはマージの競合があります。 | +| `ahead` | `"⇡"` | `ahead`のフォーマット | +| `behind` | `"⇣"` | `behind`のフォーマット | +| `diverged` | `"⇕"` | `diverged`のフォーマット | +| `up_to_date` | `""` | The format of `up_to_date` | +| `untracked` | `"?"` | The format of `untracked` | +| `stashed` | `"$"` | The format of `stashed` | +| `modified` | `"!"` | The format of `modified` | +| `staged` | `"+"` | The format of `staged` | +| `renamed` | `"»"` | The format of `renamed` | +| `deleted` | `"✘"` | The format of `deleted` | +| `style` | `"bold red"` | モジュールのスタイルです。 | +| `ignore_submodules` | `false` | Ignore changes to submodules. | +| `disabled` | `false` | Disables the `git_status` module. | ### 変数 -` format` 内では以下の変数が利用できます。 +The following variables can be used in `format`: | 変数 | 説明 | | -------------- | ------------------------------------------------------------------------------------------------------------- | @@ -1500,7 +1513,7 @@ format = "via [⎈ $version](bold white) " ## Hostname -`hostname`モジュールには、システムのホスト名が表示されます。 +The `hostname` module shows the system hostname. ### オプション @@ -1514,10 +1527,10 @@ format = "via [⎈ $version](bold white) " ### 変数 -| 変数 | 設定例 | 説明 | -| --------- | --- | ---------------------- | -| symbol | | オプション `記号` の値をミラーする | -| style\* | | オプション `style` の値をミラーする | +| 変数 | 設定例 | 説明 | +| --------- | ---------- | ---------------------------- | +| hostname | `computer` | The hostname of the computer | +| style\* | | オプション `style` の値をミラーする | \*: この変数はスタイル文字列の一部としてのみ使用できます @@ -1574,7 +1587,7 @@ symbol = "🌟 " ## ジョブ -`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: @@ -1672,7 +1685,7 @@ symbol = "∴ " ## Kotlin -`kotlin`モジュールは、現在インストールされている[Kotlin](https://kotlinlang.org/)のバージョンを表示します。 デフォルトでは次の条件のいずれかが満たされると、モジュールが表示されます。 +The `kotlin` module shows the currently installed version of [Kotlin](https://kotlinlang.org/). デフォルトでは次の条件のいずれかが満たされると、モジュールが表示されます。 - カレントディレクトリに`.kt`もしくは`.kts`ファイルが含まれている @@ -1713,17 +1726,17 @@ symbol = "🅺 " # ~/.config/starship.toml [kotlin] -# Kotlinコンパイラバイナリを使用してバージョンを確認する +# Uses the Kotlin Compiler binary to get the installed version kotlin_binary = "kotlinc" ``` ## Kubernetes -Displays the current [Kubernetes context](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#context) name and, if set, the namespace from the kubeconfig file. namespace は kubconfigで設定する必要があります。設定は、`kubectl config set-context starship-cluster --namespace astronaut` といったコマンド行えます。 `$KUBECONFIG` 環境変数が設定されている場合、このモジュールは環境変数を優先して使用し、`~/.kube/config` は使用しません。 +Displays the current [Kubernetes context](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#context) name and, if set, the namespace from the kubeconfig file. The namespace needs to be set in the kubeconfig file, this can be done via `kubectl config set-context starship-cluster --namespace astronaut`. If the `$KUBECONFIG` env var is set the module will use that if not it will use the `~/.kube/config`. ::: tip -このモジュールはデフォルトで無効になっています。 有効にするには、設定ファイルで`disabled`を`false`に設定します。 +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: @@ -1785,7 +1798,7 @@ Long and automatically generated cluster names can be identified and shortened u ## Line Break -`line_break`モジュールは、プロンプトを2行に分割します。 +The `line_break` module separates the prompt into two lines. ### オプション @@ -1845,14 +1858,13 @@ format = "via [🌕 $version](bold blue) " ## メモリ使用量 -`memory_usageモジュールは、現在のシステムメモリとスワップ使用量を示します。

+The `memory_usage` module shows current system memory and swap usage. -

デフォルトでは、システムスワップの合計がゼロ以外の場合、スワップ使用量が表示されます。

+By default the swap usage is displayed if the total system swap is non-zero. -

::: tip

+::: tip -

このモジュールはデフォルトで無効になっています。 -有効にするには、設定ファイルでdisabled`を`false`に設定します。 +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: @@ -1893,7 +1905,7 @@ style = "bold dimmed green" ## Mercurial Branch -` hg_branch `モジュールは、現在のディレクトリにあるリポジトリのアクティブなブランチを示します。 +The `hg_branch` module shows the active branch of the repo in your current directory. ### オプション @@ -1971,7 +1983,7 @@ symbol = "🎣 " ## Nix-shell -The `nix_shell` module shows the [nix-shell](https://nixos.org/guides/nix-pills/developing-with-nix-shell.html) environment. このモジュールは、nixシェル環境内にあるときに表示されます。 +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. ### オプション @@ -2135,7 +2147,7 @@ symbol = "☁️ " ## パッケージのバージョン -`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`, `shards` and `dart` packages. - [**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 @@ -2152,6 +2164,7 @@ symbol = "☁️ " - [**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 - [**SBT**](https://scala-sbt.org) - The `sbt` package version is extracted from the `build.sbt` present in the current directory +- [**Dart**](https://pub.dev/) - The `dart` package version is extracted from the `pubspec.yaml` present in the current directory > ⚠️ 表示されるバージョンは、パッケージマネージャーではなく、ソースコードが現在のディレクトリにあるパッケージのバージョンです。 @@ -2365,7 +2378,7 @@ format = "via [$symbol$version](bold white)" The `python` module shows the currently installed version of [Python](https://www.python.org/) and the current [Python virtual environment](https://docs.python.org/tutorial/venv.html) if one is activated. -`pyenvversionname` が `true` に設定されている場合 、pyenv でのバージョン名が表示されます 。 そうでなければ、`python --version` を元にバージョン番号を表示します。 +If `pyenv_version_name` is set to `true`, it will display the pyenv version name. Otherwise, it will display the version number from `python --version`. デフォルトでは次の条件のいずれかが満たされると、モジュールが表示されます。 @@ -2532,7 +2545,7 @@ symbol = "🔴 " ## Ruby -デフォルトでは`ruby`モジュールは現在インストールされている[Ruby](https://www.ruby-lang.org/)のバージョンを表示します。 次の条件のいずれかが満たされると、モジュールが表示されます: +By default the `ruby` module shows the currently installed version of [Ruby](https://www.ruby-lang.org/). 次の条件のいずれかが満たされると、モジュールが表示されます: - カレントディレクトリに`Gemfile`ファイルが含まれている - カレントディレクトリに `.ruby-version` ファイルが含まれている @@ -2576,7 +2589,7 @@ symbol = "🔺 " ## Rust -デフォルトでは`rust`モジュールは現在インストールされている[Rust](https://www.rust-lang.org/)のバージョンを表示します。 次の条件のいずれかが満たされると、モジュールが表示されます: +By default the `rust` module shows the currently installed version of [Rust](https://www.rust-lang.org/). 次の条件のいずれかが満たされると、モジュールが表示されます: - カレントディレクトリに`Cargo.toml`ファイルが含まれている - カレントディレクトリに`.rs`の拡張子のファイルが含まれている @@ -2659,7 +2672,7 @@ The `shell` module shows an indicator for currently used shell. ::: tip -このモジュールはデフォルトで無効になっています。 有効にするには、設定ファイルで`disabled`を`false`に設定します。 +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: @@ -2675,6 +2688,8 @@ The `shell` module shows an indicator for currently used shell. | `elvish_indicator` | `esh` | A format string used to represent elvish. | | `tcsh_indicator` | `tsh` | A format string used to represent tcsh. | | `xonsh_indicator` | `xsh` | A format string used to represent xonsh. | +| `cmd_indicator` | `cmd` | A format string used to represent cmd. | +| `nu_indicator` | `nu` | A format string used to represent nu. | | `unknown_indicator` | | The default value to be displayed when the shell is unknown. | | `format` | `"[$indicator]($style) "` | moduleのフォーマットです。 | | `style` | `"white bold"` | モジュールのスタイルです。 | @@ -2776,11 +2791,11 @@ The `status` module displays the exit code of the previous command. The module w ::: tip -このモジュールはデフォルトで無効になっています。 有効にするには、設定ファイルで`disabled`を`false`に設定します。 +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: -::: warning This module is not supported on elvish and nu shell. ::: +::: warning This module is not supported on nu shell. ::: ### オプション @@ -2806,6 +2821,7 @@ The `status` module displays the exit code of the previous command. The module w | 変数 | 設定例 | 説明 | | -------------- | ------- | ------------------------------------------------------------------------------------------- | | status | `127` | The exit code of the last command | +| hex_status | `0x7F` | The exit code of the last command in hex | | int | `127` | The exit code of the last command | | common_meaning | `ERROR` | Meaning of the code if not a signal | | signal_number | `9` | Signal number corresponding to the exit code, only if signalled | @@ -2838,7 +2854,7 @@ The `sudo` module displays if sudo credentials are currently cached. The module ::: tip -このモジュールはデフォルトで無効になっています。 有効にするには、設定ファイルで`disabled`を`false`に設定します。 +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: @@ -2982,11 +2998,11 @@ format = "[🏎💨 $workspace]($style) " ## Time -`time`モジュールは、現在の**現地**時間を示します。 `format`設定は、時間の表示方法を制御するために[`chrono`](https://crates.io/crates/chrono)クレートによって使用されます。 使用可能なオプションを確認するには、[chrono strftimeのドキュメント](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html)をご覧ください。 +The `time` module shows the current **local** time. The `format` configuration value is used by the [`chrono`](https://crates.io/crates/chrono) crate to control how the time is displayed. Take a look [at the chrono strftime docs](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) to see what options are available. ::: tip -このモジュールはデフォルトで無効になっています。 有効にするには、設定ファイルで`disabled`を`false`に設定します。 +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: @@ -3002,7 +3018,7 @@ format = "[🏎💨 $workspace]($style) " | `disabled` | `true` | `time`モジュールを無効にします。 | | `time_range` | `"-"` | Sets the time range during which the module will be shown. Times must be specified in 24-hours format | -If `use_12hr` is `true`, then `time_format` defaults to `"%r"`. それ以外の場合、デフォルトは`"%T"`です。 Manually setting `time_format` will override the `use_12hr` setting. +If `use_12hr` is `true`, then `time_format` defaults to `"%r"`. Otherwise, it defaults to `"%T"`. Manually setting `time_format` will override the `use_12hr` setting. ### 変数 @@ -3028,7 +3044,7 @@ time_range = "10:00:00-14:00:00" ## ユーザー名 -`username`モジュールには、アクティブなユーザーのユーザー名が表示されます。 次の条件のいずれかが満たされると、モジュールが表示されます: +The `username` module shows active user's username. 次の条件のいずれかが満たされると、モジュールが表示されます: - カレントユーザーがroot - カレントユーザーが、ログインしているユーザーとは異なる diff --git a/docs/ja-JP/faq/README.md b/docs/ja-JP/faq/README.md index ac34530f7..747d5bb91 100644 --- a/docs/ja-JP/faq/README.md +++ b/docs/ja-JP/faq/README.md @@ -69,13 +69,13 @@ Starship executes different commands to get information to display in the prompt You can enable the debug logs by using the `STARSHIP_LOG` env var. These logs can be very verbose so it is often useful to use the `module` command if you are trying to debug a particular module, for example, if you are trying to debug the `rust` module you could run the following command to get the trace logs and output from the module. ```sh -env STARHIP_LOG=trace starship module rust +env STARSHIP_LOG=trace starship module rust ``` If starship is being slow you can try using the `timings` command to see if there is a particular module or command that to blame. ```sh -env STARHIP_LOG=trace starship timings +env STARSHIP_LOG=trace starship timings ``` This will output the trace log and a breakdown of all modules that either took more than 1ms to execute or produced some output. @@ -117,6 +117,6 @@ Starship がパッケージマネージャを使用してインストールさ Starship をインストールスクリプトを使用してインストールした場合、次のコマンドでバイナリが削除されます。 ```sh -# starshipバイナリを見つけて削除 -sh -c 'rm "$(which starship)"'' +# Locate and delete the starship binary +sh -c 'rm "$(command -v 'starship')"' ``` diff --git a/docs/ja-JP/guide/README.md b/docs/ja-JP/guide/README.md index afa9592e6..9c64f3155 100644 --- a/docs/ja-JP/guide/README.md +++ b/docs/ja-JP/guide/README.md @@ -72,6 +72,22 @@ height="20" src="https://raw.githubusercontent.com/starship/starship/master/media/flag-fr.png" alt="Français" + /> +   + Bahasa Indonesia +   + Italiano   @@ -119,7 +119,7 @@ description: Starship is the minimal, blazing fast, and extremely customizable p #### Elvish - ::: 주의 elvish v0.15 이상만 지원. ::: + ::: warning Only elvish v0.17 or higher is supported. ::: 아래의 라인을 `~/.elvish/rc.elv` 마지막에 추가: @@ -164,3 +164,14 @@ description: Starship is the minimal, blazing fast, and extremely customizable p execx($(starship init xonsh)) ``` + + + #### Cmd + + You need to use [Clink](https://chrisant996.github.io/clink/clink.html) (v1.2.30+) with Cmd. Add the following to a file `starship.lua` and place this file in Clink scripts directory: + + ```lua + -- starship.lua + + load(io.popen('starship init cmd'):read("*a"))() + ``` diff --git a/docs/ko-KR/advanced-config/README.md b/docs/ko-KR/advanced-config/README.md index 1bda2ae1a..0a2b2ddd7 100644 --- a/docs/ko-KR/advanced-config/README.md +++ b/docs/ko-KR/advanced-config/README.md @@ -8,6 +8,30 @@ The configurations in this section are subject to change in future releases of S ::: +## Custom pre-prompt and pre-execution Commands in Cmd + +Clink provides extremely flexible APIs to run pre-prompt and pre-exec commands in Cmd shell. It is fairly simple to use with Starship. Make the following changes to your `starship.lua` file as per your requirements: + +- To run a custom function right before the prompt is drawn, define a new function called `starship_preprompt_user_func`. This function receives the current prompt as a string that you can utilize. For example, to draw a rocket before the prompt, you would do + +```lua +function starship_preprompt_user_func(prompt) + print("🚀") +end + +load(io.popen('starship init cmd'):read("*a"))() +``` + +- To run a custom function right before a command is executed, define a new function called `starship_precmd_user_func`. This function receives the current commandline as a string that you can utilize. For example, to print the command that's about to be executed, you would do + +```lua +function starship_precmd_user_func(line) + print("Executing: "..line) +end + +load(io.popen('starship init cmd'):read("*a"))() +``` + ## Custom pre-prompt and pre-execution Commands in Bash Bash does not have a formal preexec/precmd framework like most other shells. Because of this, it is difficult to provide fully customizable hooks in `bash`. However, Starship does give you limited ability to insert your own functions into the prompt-rendering procedure: @@ -45,7 +69,7 @@ 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 even does it by default. Starship does not do this, but it's fairly straightforward to add this functionality to `bash`, `zsh`, `cmd` or `powershell`. First, define a window title change function (identical in bash and zsh): @@ -80,6 +104,16 @@ function set_win_title(){ starship_precmd_user_func="set_win_title" ``` +For Cmd, you can change the window title using the `starship_preprompt_user_func` function. + +```lua +function starship_preprompt_user_func(prompt) + console.settitle(os.getenv('USERNAME').."@"..os.getenv('COMPUTERNAME')..": "..os.getcwd()) +end + +load(io.popen('starship init cmd'):read("*a"))() +``` + You can also set a similar output with PowerShell by creating a function named `Invoke-Starship-PreCommand`. ```powershell @@ -97,7 +131,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). -`right_format` is currently supported for the following shells: elvish, fish, zsh. +`right_format` is currently supported for the following shells: elvish, fish, zsh, xonsh, cmd. ### Example @@ -117,6 +151,28 @@ Produces a prompt like the following: ▶ starship on  rprompt [!] is 📦 v0.57.0 via 🦀 v1.54.0 took 17s ``` +## Continuation Prompt + +Some shells support a continuation prompt along with the normal prompt. This prompt is rendered instead of the normal prompt when the user has entered an incomplete statement (such as a single left parenthesis or quote). + +Starship can set the continuation prompt using the `continuation_prompt` option. The default prompt is `"[∙](bright-black) "`. + +Note: `continuation_prompt` should be set to a literal string without any variables. + +Note: Continuation prompts are only available in the following shells: + + - `bash` + - `zsh` + - `파워셀` + +### Example + +```toml +# ~/.config/starship.toml + +# A continuation prompt that displays two filled in arrows +continuation_prompt = "▶▶" +``` ## Style Strings diff --git a/docs/ko-KR/config/README.md b/docs/ko-KR/config/README.md index 7f953ab4b..2565504e2 100644 --- a/docs/ko-KR/config/README.md +++ b/docs/ko-KR/config/README.md @@ -24,13 +24,19 @@ disabled = true You can change default configuration file location with `STARSHIP_CONFIG` environment variable: ```sh -export STARSHIP_CONFIG=~/.starship/config.toml +export STARSHIP_CONFIG=~/example/non/default/path/starship.toml ``` Equivalently in PowerShell (Windows) would be adding this line to your `$PROFILE`: ```powershell -$ENV:STARSHIP_CONFIG = "$HOME\.starship\config.toml" +$ENV:STARSHIP_CONFIG = "$HOME\example\non\default\path\starship.toml" +``` + +Or for Cmd (Windows) would be adding this line to your `starship.lua`: + +```lua +os.setenv('STARSHIP_CONFIG', 'C:\\Users\\user\\example\\non\\default\\path\\starship.toml') ``` ### Logging @@ -47,6 +53,12 @@ Equivalently in PowerShell (Windows) would be adding this line to your `$PROFILE $ENV:STARSHIP_CACHE = "$HOME\AppData\Local\Temp" ``` +Or for Cmd (Windows) would be adding this line to your `starship.lua`: + +```lua +os.setenv('STARSHIP_CACHE', 'C:\\Users\\user\\AppData\\Local\\Temp') +``` + ### Terminology **Module**: A component in the prompt giving information based on contextual information from your OS. For example, the "nodejs" module shows the version of Node.js that is currently installed on your computer, if your current directory is a Node.js project. @@ -425,13 +437,13 @@ By default it only changes color. If you also want to change its shape take a lo ::: warning -`error_symbol` is not supported on elvish and nu shell. +`error_symbol` is not supported on nu shell. ::: ::: warning -`vicmd_symbol` is only supported in fish and zsh. +`vicmd_symbol` is only supported in cmd, fish and zsh. ::: @@ -568,7 +580,7 @@ Bash users who need preexec-like functionality can use [rcaloras's bash_preexec ::: tip -Showing desktop notifications requires starship to be built with `rust-notify` support. You check if your starship supports notifications by running `STARSHIP_LOG=debug starship module cmd_duration -d 60000` when `show_notifications` is set to `true`. +Showing desktop notifications requires starship to be built with `notify-rust` support. You check if your starship supports notifications by running `STARSHIP_LOG=debug starship module cmd_duration -d 60000` when `show_notifications` is set to `true`. ::: @@ -713,20 +725,20 @@ format = "via [🔰 $version](bold red) " ## Deno The `deno` module shows you your currently installed version of [Deno](https://deno.land/). By default the module will be shown if any of the following conditions are met: -- The current directory contains a `mod.ts`, `mod.js`, `deps.ts` or `deps.js` file +- The current directory contains a `deno.json`, `deno.jsonc`, `mod.ts`, `mod.js`, `deps.ts` or `deps.js` file ### Options -| Option | Default | Description | -| ------------------- | -------------------------------------------- | ------------------------------------------------------------------------- | -| `format` | `"via [$symbol($version )]($style)"` | The format for the module. | -| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | -| `symbol` | `"🦕 "` | A format string representing the symbol of Deno | -| `detect_extensions` | `[]` | Which extensions should trigger this module. | -| `detect_files` | `["mod.ts", "mod.js", "deps.ts", "deps.js"]` | Which filenames should trigger this module. | -| `detect_folders` | `[]` | Which folders should trigger this module. | -| `style` | `"green bold"` | The style for the module. | -| `disabled` | `false` | Disables the `deno` module. | +| Option | Default | Description | +| ------------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `format` | `"via [$symbol($version )]($style)"` | The format for the module. | +| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | +| `symbol` | `"🦕 "` | A format string representing the symbol of Deno | +| `detect_extensions` | `[]` | Which extensions should trigger this module. | +| `detect_files` | `["deno.json", "deno.jsonc", "mod.ts", "mod.js", "deps.ts", "deps.js"]` | Which filenames should trigger this module. | +| `detect_folders` | `[]` | Which folders should trigger this module. | +| `style` | `"green bold"` | The style for the module. | +| `disabled` | `false` | Disables the `deno` module. | ### Variables @@ -755,18 +767,19 @@ For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, an ### Options -| Option | Default | Description | -| ------------------- | -------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `truncation_length` | `3` | The number of parent folders that the current directory should be truncated to. | -| `truncate_to_repo` | `true` | Whether or not to truncate to the root of the git repo that you're currently in. | -| `format` | `"[$path]($style)[$read_only]($read_only_style) "` | The format for the module. | -| `style` | `"bold cyan"` | The style for the module. | -| `disabled` | `false` | Disables the `directory` module. | -| `read_only` | `"🔒"` | The symbol indicating current directory is read only. | -| `read_only_style` | `"red"` | The style for the read only symbol. | -| `truncation_symbol` | `""` | The symbol to prefix to truncated paths. eg: "…/" | -| `repo_root_style` | `None` | The style for the root of the git repo when `truncate_to_repo` option is set to false. | -| `home_symbol` | `"~"` | The symbol indicating home directory. | +| Option | Default | Description | +| ------------------- | -------------------------------------------------- | --------------------------------------------------------------------------------------- | +| `truncation_length` | `3` | The number of parent folders that the current directory should be truncated to. | +| `truncate_to_repo` | `true` | Whether or not to truncate to the root of the git repo that you're currently in. | +| `format` | `"[$path]($style)[$read_only]($read_only_style) "` | The format for the module. | +| `style` | `"bold cyan"` | The style for the module. | +| `disabled` | `false` | Disables the `directory` module. | +| `read_only` | `"🔒"` | The symbol indicating current directory is read only. | +| `read_only_style` | `"red"` | The style for the read only symbol. | +| `truncation_symbol` | `""` | The symbol to prefix to truncated paths. eg: "…/" | +| `repo_root_style` | `None` | The style for the root of the git repo when `truncate_to_repo` option is set to false. | +| `home_symbol` | `"~"` | The symbol indicating home directory. | +| `use_os_path_sep` | `true` | Use the OS specific path seperator instead of always using `/` (e.g. `\` on Windows) |

This module has a few advanced configuration options that control how the directory is displayed. @@ -1334,22 +1347,23 @@ The `git_status` module shows symbols representing the state of the repo in your ### Options -| Option | Default | Description | -| ------------ | ----------------------------------------------- | ----------------------------------- | -| `format` | `'([\[$all_status$ahead_behind\]]($style) )'` | The default format for `git_status` | -| `conflicted` | `"="` | This branch has merge conflicts. | -| `ahead` | `"⇡"` | The format of `ahead` | -| `behind` | `"⇣"` | The format of `behind` | -| `diverged` | `"⇕"` | The format of `diverged` | -| `up_to_date` | `""` | The format of `up_to_date` | -| `untracked` | `"?"` | The format of `untracked` | -| `stashed` | `"$"` | The format of `stashed` | -| `modified` | `"!"` | The format of `modified` | -| `staged` | `"+"` | The format of `staged` | -| `renamed` | `"»"` | The format of `renamed` | -| `deleted` | `"✘"` | The format of `deleted` | -| `style` | `"bold red"` | The style for the module. | -| `disabled` | `false` | Disables the `git_status` module. | +| Option | Default | Description | +| ------------------- | ----------------------------------------------- | ----------------------------------- | +| `format` | `'([\[$all_status$ahead_behind\]]($style) )'` | The default format for `git_status` | +| `conflicted` | `"="` | This branch has merge conflicts. | +| `ahead` | `"⇡"` | The format of `ahead` | +| `behind` | `"⇣"` | The format of `behind` | +| `diverged` | `"⇕"` | The format of `diverged` | +| `up_to_date` | `""` | The format of `up_to_date` | +| `untracked` | `"?"` | The format of `untracked` | +| `stashed` | `"$"` | The format of `stashed` | +| `modified` | `"!"` | The format of `modified` | +| `staged` | `"+"` | The format of `staged` | +| `renamed` | `"»"` | The format of `renamed` | +| `deleted` | `"✘"` | The format of `deleted` | +| `style` | `"bold red"` | The style for the module. | +| `ignore_submodules` | `false` | Ignore changes to submodules. | +| `disabled` | `false` | Disables the `git_status` module. | ### Variables @@ -1513,10 +1527,10 @@ The `hostname` module shows the system hostname. ### Variables -| Variable | Example | Description | -| --------- | ------- | ------------------------------------ | -| symbol | | Mirrors the value of option `symbol` | -| style\* | | Mirrors the value of option `style` | +| Variable | Example | Description | +| --------- | ---------- | ----------------------------------- | +| hostname | `computer` | The hostname of the computer | +| style\* | | Mirrors the value of option `style` | \*: This variable can only be used as a part of a style string @@ -2133,7 +2147,7 @@ symbol = "☁️ " ## Package Version -The `package` module is shown when the current directory is the repository for a package, and shows its current version. The module currently supports `npm`, `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`, `shards` and `dart` packages. - [**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 @@ -2150,6 +2164,7 @@ The `package` module is shown when the current directory is the repository for a - [**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 - [**SBT**](https://scala-sbt.org) - The `sbt` package version is extracted from the `build.sbt` present in the current directory +- [**Dart**](https://pub.dev/) - The `dart` package version is extracted from the `pubspec.yaml` 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. @@ -2673,6 +2688,8 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y | `elvish_indicator` | `esh` | A format string used to represent elvish. | | `tcsh_indicator` | `tsh` | A format string used to represent tcsh. | | `xonsh_indicator` | `xsh` | A format string used to represent xonsh. | +| `cmd_indicator` | `cmd` | A format string used to represent cmd. | +| `nu_indicator` | `nu` | A format string used to represent nu. | | `unknown_indicator` | | The default value to be displayed when the shell is unknown. | | `format` | `"[$indicator]($style) "` | The format for the module. | | `style` | `"white bold"` | The style for the module. | @@ -2778,7 +2795,7 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y ::: -::: warning This module is not supported on elvish and nu shell. ::: +::: warning This module is not supported on nu shell. ::: ### Options @@ -2804,6 +2821,7 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y | Variable | Example | Description | | -------------- | ------- | ------------------------------------------------------------------------------------------- | | status | `127` | The exit code of the last command | +| hex_status | `0x7F` | The exit code of the last command in hex | | int | `127` | The exit code of the last command | | common_meaning | `ERROR` | Meaning of the code if not a signal | | signal_number | `9` | Signal number corresponding to the exit code, only if signalled | diff --git a/docs/ko-KR/faq/README.md b/docs/ko-KR/faq/README.md index 8422ee2e3..99dd6bcc8 100644 --- a/docs/ko-KR/faq/README.md +++ b/docs/ko-KR/faq/README.md @@ -69,13 +69,13 @@ If you see symbols that you don't recognise you can use `starship explain` to ex You can enable the debug logs by using the `STARSHIP_LOG` env var. These logs can be very verbose so it is often useful to use the `module` command if you are trying to debug a particular module, for example, if you are trying to debug the `rust` module you could run the following command to get the trace logs and output from the module. ```sh -env STARHIP_LOG=trace starship module rust +env STARSHIP_LOG=trace starship module rust ``` If starship is being slow you can try using the `timings` command to see if there is a particular module or command that to blame. ```sh -env STARHIP_LOG=trace starship timings +env STARSHIP_LOG=trace starship timings ``` This will output the trace log and a breakdown of all modules that either took more than 1ms to execute or produced some output. @@ -118,5 +118,5 @@ If Starship was installed using the install script, the following command will d ```sh # Locate and delete the starship binary -sh -c 'rm "$(which starship)"' +sh -c 'rm "$(command -v 'starship')"' ``` diff --git a/docs/ko-KR/guide/README.md b/docs/ko-KR/guide/README.md index 620df71e7..740c53499 100644 --- a/docs/ko-KR/guide/README.md +++ b/docs/ko-KR/guide/README.md @@ -72,6 +72,22 @@ height="20" src="https://raw.githubusercontent.com/starship/starship/master/media/flag-fr.png" alt="Français" + /> +   + Bahasa Indonesia +   + Italiano   @@ -119,7 +119,7 @@ description: Starship is the minimal, blazing fast, and extremely customizable p #### Elvish - ::: warning Only elvish v0.15 or higher is supported. ::: + ::: warning Only elvish v0.17 or higher is supported. ::: Add the following to the end of `~/.elvish/rc.elv`: @@ -164,3 +164,14 @@ description: Starship is the minimal, blazing fast, and extremely customizable p execx($(starship init xonsh)) ``` + + + #### Cmd + + You need to use [Clink](https://chrisant996.github.io/clink/clink.html) (v1.2.30+) with Cmd. Add the following to a file `starship.lua` and place this file in Clink scripts directory: + + ```lua + -- starship.lua + + load(io.popen('starship init cmd'):read("*a"))() + ``` diff --git a/docs/nl-NL/advanced-config/README.md b/docs/nl-NL/advanced-config/README.md index 1bda2ae1a..f0f682a8a 100644 --- a/docs/nl-NL/advanced-config/README.md +++ b/docs/nl-NL/advanced-config/README.md @@ -8,6 +8,30 @@ The configurations in this section are subject to change in future releases of S ::: +## Custom pre-prompt and pre-execution Commands in Cmd + +Clink provides extremely flexible APIs to run pre-prompt and pre-exec commands in Cmd shell. It is fairly simple to use with Starship. Make the following changes to your `starship.lua` file as per your requirements: + +- To run a custom function right before the prompt is drawn, define a new function called `starship_preprompt_user_func`. This function receives the current prompt as a string that you can utilize. For example, to draw a rocket before the prompt, you would do + +```lua +function starship_preprompt_user_func(prompt) + print("🚀") +end + +load(io.popen('starship init cmd'):read("*a"))() +``` + +- To run a custom function right before a command is executed, define a new function called `starship_precmd_user_func`. This function receives the current commandline as a string that you can utilize. For example, to print the command that's about to be executed, you would do + +```lua +function starship_precmd_user_func(line) + print("Executing: "..line) +end + +load(io.popen('starship init cmd'):read("*a"))() +``` + ## Custom pre-prompt and pre-execution Commands in Bash Bash does not have a formal preexec/precmd framework like most other shells. Because of this, it is difficult to provide fully customizable hooks in `bash`. However, Starship does give you limited ability to insert your own functions into the prompt-rendering procedure: @@ -45,7 +69,7 @@ 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 even does it by default. Starship does not do this, but it's fairly straightforward to add this functionality to `bash`, `zsh`, `cmd` or `powershell`. First, define a window title change function (identical in bash and zsh): @@ -80,6 +104,16 @@ function set_win_title(){ starship_precmd_user_func="set_win_title" ``` +For Cmd, you can change the window title using the `starship_preprompt_user_func` function. + +```lua +function starship_preprompt_user_func(prompt) + console.settitle(os.getenv('USERNAME').."@"..os.getenv('COMPUTERNAME')..": "..os.getcwd()) +end + +load(io.popen('starship init cmd'):read("*a"))() +``` + You can also set a similar output with PowerShell by creating a function named `Invoke-Starship-PreCommand`. ```powershell @@ -97,7 +131,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). -`right_format` is currently supported for the following shells: elvish, fish, zsh. +`right_format` is currently supported for the following shells: elvish, fish, zsh, xonsh, cmd. ### Example @@ -117,6 +151,28 @@ Produces a prompt like the following: ▶ starship on  rprompt [!] is 📦 v0.57.0 via 🦀 v1.54.0 took 17s ``` +## Continuation Prompt + +Some shells support a continuation prompt along with the normal prompt. This prompt is rendered instead of the normal prompt when the user has entered an incomplete statement (such as a single left parenthesis or quote). + +Starship can set the continuation prompt using the `continuation_prompt` option. The default prompt is `"[∙](bright-black) "`. + +Note: `continuation_prompt` should be set to a literal string without any variables. + +Note: Continuation prompts are only available in the following shells: + + - `bash` + - `zsh` + - `PowerShell` + +### Example + +```toml +# ~/.config/starship.toml + +# A continuation prompt that displays two filled in arrows +continuation_prompt = "▶▶" +``` ## Style Strings diff --git a/docs/nl-NL/config/README.md b/docs/nl-NL/config/README.md index 7f953ab4b..2565504e2 100644 --- a/docs/nl-NL/config/README.md +++ b/docs/nl-NL/config/README.md @@ -24,13 +24,19 @@ disabled = true You can change default configuration file location with `STARSHIP_CONFIG` environment variable: ```sh -export STARSHIP_CONFIG=~/.starship/config.toml +export STARSHIP_CONFIG=~/example/non/default/path/starship.toml ``` Equivalently in PowerShell (Windows) would be adding this line to your `$PROFILE`: ```powershell -$ENV:STARSHIP_CONFIG = "$HOME\.starship\config.toml" +$ENV:STARSHIP_CONFIG = "$HOME\example\non\default\path\starship.toml" +``` + +Or for Cmd (Windows) would be adding this line to your `starship.lua`: + +```lua +os.setenv('STARSHIP_CONFIG', 'C:\\Users\\user\\example\\non\\default\\path\\starship.toml') ``` ### Logging @@ -47,6 +53,12 @@ Equivalently in PowerShell (Windows) would be adding this line to your `$PROFILE $ENV:STARSHIP_CACHE = "$HOME\AppData\Local\Temp" ``` +Or for Cmd (Windows) would be adding this line to your `starship.lua`: + +```lua +os.setenv('STARSHIP_CACHE', 'C:\\Users\\user\\AppData\\Local\\Temp') +``` + ### Terminology **Module**: A component in the prompt giving information based on contextual information from your OS. For example, the "nodejs" module shows the version of Node.js that is currently installed on your computer, if your current directory is a Node.js project. @@ -425,13 +437,13 @@ By default it only changes color. If you also want to change its shape take a lo ::: warning -`error_symbol` is not supported on elvish and nu shell. +`error_symbol` is not supported on nu shell. ::: ::: warning -`vicmd_symbol` is only supported in fish and zsh. +`vicmd_symbol` is only supported in cmd, fish and zsh. ::: @@ -568,7 +580,7 @@ Bash users who need preexec-like functionality can use [rcaloras's bash_preexec ::: tip -Showing desktop notifications requires starship to be built with `rust-notify` support. You check if your starship supports notifications by running `STARSHIP_LOG=debug starship module cmd_duration -d 60000` when `show_notifications` is set to `true`. +Showing desktop notifications requires starship to be built with `notify-rust` support. You check if your starship supports notifications by running `STARSHIP_LOG=debug starship module cmd_duration -d 60000` when `show_notifications` is set to `true`. ::: @@ -713,20 +725,20 @@ format = "via [🔰 $version](bold red) " ## Deno The `deno` module shows you your currently installed version of [Deno](https://deno.land/). By default the module will be shown if any of the following conditions are met: -- The current directory contains a `mod.ts`, `mod.js`, `deps.ts` or `deps.js` file +- The current directory contains a `deno.json`, `deno.jsonc`, `mod.ts`, `mod.js`, `deps.ts` or `deps.js` file ### Options -| Option | Default | Description | -| ------------------- | -------------------------------------------- | ------------------------------------------------------------------------- | -| `format` | `"via [$symbol($version )]($style)"` | The format for the module. | -| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | -| `symbol` | `"🦕 "` | A format string representing the symbol of Deno | -| `detect_extensions` | `[]` | Which extensions should trigger this module. | -| `detect_files` | `["mod.ts", "mod.js", "deps.ts", "deps.js"]` | Which filenames should trigger this module. | -| `detect_folders` | `[]` | Which folders should trigger this module. | -| `style` | `"green bold"` | The style for the module. | -| `disabled` | `false` | Disables the `deno` module. | +| Option | Default | Description | +| ------------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `format` | `"via [$symbol($version )]($style)"` | The format for the module. | +| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | +| `symbol` | `"🦕 "` | A format string representing the symbol of Deno | +| `detect_extensions` | `[]` | Which extensions should trigger this module. | +| `detect_files` | `["deno.json", "deno.jsonc", "mod.ts", "mod.js", "deps.ts", "deps.js"]` | Which filenames should trigger this module. | +| `detect_folders` | `[]` | Which folders should trigger this module. | +| `style` | `"green bold"` | The style for the module. | +| `disabled` | `false` | Disables the `deno` module. | ### Variables @@ -755,18 +767,19 @@ For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, an ### Options -| Option | Default | Description | -| ------------------- | -------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `truncation_length` | `3` | The number of parent folders that the current directory should be truncated to. | -| `truncate_to_repo` | `true` | Whether or not to truncate to the root of the git repo that you're currently in. | -| `format` | `"[$path]($style)[$read_only]($read_only_style) "` | The format for the module. | -| `style` | `"bold cyan"` | The style for the module. | -| `disabled` | `false` | Disables the `directory` module. | -| `read_only` | `"🔒"` | The symbol indicating current directory is read only. | -| `read_only_style` | `"red"` | The style for the read only symbol. | -| `truncation_symbol` | `""` | The symbol to prefix to truncated paths. eg: "…/" | -| `repo_root_style` | `None` | The style for the root of the git repo when `truncate_to_repo` option is set to false. | -| `home_symbol` | `"~"` | The symbol indicating home directory. | +| Option | Default | Description | +| ------------------- | -------------------------------------------------- | --------------------------------------------------------------------------------------- | +| `truncation_length` | `3` | The number of parent folders that the current directory should be truncated to. | +| `truncate_to_repo` | `true` | Whether or not to truncate to the root of the git repo that you're currently in. | +| `format` | `"[$path]($style)[$read_only]($read_only_style) "` | The format for the module. | +| `style` | `"bold cyan"` | The style for the module. | +| `disabled` | `false` | Disables the `directory` module. | +| `read_only` | `"🔒"` | The symbol indicating current directory is read only. | +| `read_only_style` | `"red"` | The style for the read only symbol. | +| `truncation_symbol` | `""` | The symbol to prefix to truncated paths. eg: "…/" | +| `repo_root_style` | `None` | The style for the root of the git repo when `truncate_to_repo` option is set to false. | +| `home_symbol` | `"~"` | The symbol indicating home directory. | +| `use_os_path_sep` | `true` | Use the OS specific path seperator instead of always using `/` (e.g. `\` on Windows) |
This module has a few advanced configuration options that control how the directory is displayed. @@ -1334,22 +1347,23 @@ The `git_status` module shows symbols representing the state of the repo in your ### Options -| Option | Default | Description | -| ------------ | ----------------------------------------------- | ----------------------------------- | -| `format` | `'([\[$all_status$ahead_behind\]]($style) )'` | The default format for `git_status` | -| `conflicted` | `"="` | This branch has merge conflicts. | -| `ahead` | `"⇡"` | The format of `ahead` | -| `behind` | `"⇣"` | The format of `behind` | -| `diverged` | `"⇕"` | The format of `diverged` | -| `up_to_date` | `""` | The format of `up_to_date` | -| `untracked` | `"?"` | The format of `untracked` | -| `stashed` | `"$"` | The format of `stashed` | -| `modified` | `"!"` | The format of `modified` | -| `staged` | `"+"` | The format of `staged` | -| `renamed` | `"»"` | The format of `renamed` | -| `deleted` | `"✘"` | The format of `deleted` | -| `style` | `"bold red"` | The style for the module. | -| `disabled` | `false` | Disables the `git_status` module. | +| Option | Default | Description | +| ------------------- | ----------------------------------------------- | ----------------------------------- | +| `format` | `'([\[$all_status$ahead_behind\]]($style) )'` | The default format for `git_status` | +| `conflicted` | `"="` | This branch has merge conflicts. | +| `ahead` | `"⇡"` | The format of `ahead` | +| `behind` | `"⇣"` | The format of `behind` | +| `diverged` | `"⇕"` | The format of `diverged` | +| `up_to_date` | `""` | The format of `up_to_date` | +| `untracked` | `"?"` | The format of `untracked` | +| `stashed` | `"$"` | The format of `stashed` | +| `modified` | `"!"` | The format of `modified` | +| `staged` | `"+"` | The format of `staged` | +| `renamed` | `"»"` | The format of `renamed` | +| `deleted` | `"✘"` | The format of `deleted` | +| `style` | `"bold red"` | The style for the module. | +| `ignore_submodules` | `false` | Ignore changes to submodules. | +| `disabled` | `false` | Disables the `git_status` module. | ### Variables @@ -1513,10 +1527,10 @@ The `hostname` module shows the system hostname. ### Variables -| Variable | Example | Description | -| --------- | ------- | ------------------------------------ | -| symbol | | Mirrors the value of option `symbol` | -| style\* | | Mirrors the value of option `style` | +| Variable | Example | Description | +| --------- | ---------- | ----------------------------------- | +| hostname | `computer` | The hostname of the computer | +| style\* | | Mirrors the value of option `style` | \*: This variable can only be used as a part of a style string @@ -2133,7 +2147,7 @@ symbol = "☁️ " ## Package Version -The `package` module is shown when the current directory is the repository for a package, and shows its current version. The module currently supports `npm`, `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`, `shards` and `dart` packages. - [**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 @@ -2150,6 +2164,7 @@ The `package` module is shown when the current directory is the repository for a - [**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 - [**SBT**](https://scala-sbt.org) - The `sbt` package version is extracted from the `build.sbt` present in the current directory +- [**Dart**](https://pub.dev/) - The `dart` package version is extracted from the `pubspec.yaml` 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. @@ -2673,6 +2688,8 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y | `elvish_indicator` | `esh` | A format string used to represent elvish. | | `tcsh_indicator` | `tsh` | A format string used to represent tcsh. | | `xonsh_indicator` | `xsh` | A format string used to represent xonsh. | +| `cmd_indicator` | `cmd` | A format string used to represent cmd. | +| `nu_indicator` | `nu` | A format string used to represent nu. | | `unknown_indicator` | | The default value to be displayed when the shell is unknown. | | `format` | `"[$indicator]($style) "` | The format for the module. | | `style` | `"white bold"` | The style for the module. | @@ -2778,7 +2795,7 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y ::: -::: warning This module is not supported on elvish and nu shell. ::: +::: warning This module is not supported on nu shell. ::: ### Options @@ -2804,6 +2821,7 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y | Variable | Example | Description | | -------------- | ------- | ------------------------------------------------------------------------------------------- | | status | `127` | The exit code of the last command | +| hex_status | `0x7F` | The exit code of the last command in hex | | int | `127` | The exit code of the last command | | common_meaning | `ERROR` | Meaning of the code if not a signal | | signal_number | `9` | Signal number corresponding to the exit code, only if signalled | diff --git a/docs/nl-NL/faq/README.md b/docs/nl-NL/faq/README.md index 8422ee2e3..99dd6bcc8 100644 --- a/docs/nl-NL/faq/README.md +++ b/docs/nl-NL/faq/README.md @@ -69,13 +69,13 @@ If you see symbols that you don't recognise you can use `starship explain` to ex You can enable the debug logs by using the `STARSHIP_LOG` env var. These logs can be very verbose so it is often useful to use the `module` command if you are trying to debug a particular module, for example, if you are trying to debug the `rust` module you could run the following command to get the trace logs and output from the module. ```sh -env STARHIP_LOG=trace starship module rust +env STARSHIP_LOG=trace starship module rust ``` If starship is being slow you can try using the `timings` command to see if there is a particular module or command that to blame. ```sh -env STARHIP_LOG=trace starship timings +env STARSHIP_LOG=trace starship timings ``` This will output the trace log and a breakdown of all modules that either took more than 1ms to execute or produced some output. @@ -118,5 +118,5 @@ If Starship was installed using the install script, the following command will d ```sh # Locate and delete the starship binary -sh -c 'rm "$(which starship)"' +sh -c 'rm "$(command -v 'starship')"' ``` diff --git a/docs/nl-NL/guide/README.md b/docs/nl-NL/guide/README.md index 78326cdbb..c174a8e9f 100644 --- a/docs/nl-NL/guide/README.md +++ b/docs/nl-NL/guide/README.md @@ -70,6 +70,22 @@ height="20" src="https://raw.githubusercontent.com/starship/starship/master/media/flag-fr.png" alt="Français" + /> +   + Bahasa Indonesia +   + Italiano   @@ -119,7 +119,7 @@ description: Starship is the minimal, blazing fast, and extremely customizable p #### Elvish - ::: warning Only elvish v0.15 or higher is supported. ::: + ::: warning Only elvish v0.17 or higher is supported. ::: Dodaj na koniec pliku `~/.elvish/rc.elv`: @@ -164,3 +164,14 @@ description: Starship is the minimal, blazing fast, and extremely customizable p execx($(starship init xonsh)) ``` + + + #### Cmd + + You need to use [Clink](https://chrisant996.github.io/clink/clink.html) (v1.2.30+) with Cmd. Add the following to a file `starship.lua` and place this file in Clink scripts directory: + + ```lua + -- starship.lua + + load(io.popen('starship init cmd'):read("*a"))() + ``` diff --git a/docs/pl-PL/advanced-config/README.md b/docs/pl-PL/advanced-config/README.md index f1c1c83fa..2ceee55c3 100644 --- a/docs/pl-PL/advanced-config/README.md +++ b/docs/pl-PL/advanced-config/README.md @@ -8,6 +8,30 @@ Konfiguracja opisana w tej sekcji może ulec zmianie w przyszłych wydaniach Sta ::: +## Custom pre-prompt and pre-execution Commands in Cmd + +Clink provides extremely flexible APIs to run pre-prompt and pre-exec commands in Cmd shell. It is fairly simple to use with Starship. Make the following changes to your `starship.lua` file as per your requirements: + +- To run a custom function right before the prompt is drawn, define a new function called `starship_preprompt_user_func`. This function receives the current prompt as a string that you can utilize. For example, to draw a rocket before the prompt, you would do + +```lua +function starship_preprompt_user_func(prompt) + print("🚀") +end + +load(io.popen('starship init cmd'):read("*a"))() +``` + +- To run a custom function right before a command is executed, define a new function called `starship_precmd_user_func`. This function receives the current commandline as a string that you can utilize. For example, to print the command that's about to be executed, you would do + +```lua +function starship_precmd_user_func(line) + print("Executing: "..line) +end + +load(io.popen('starship init cmd'):read("*a"))() +``` + ## Custom pre-prompt and pre-execution Commands in Bash Bash does not have a formal preexec/precmd framework like most other shells. Because of this, it is difficult to provide fully customizable hooks in `bash`. However, Starship does give you limited ability to insert your own functions into the prompt-rendering procedure: @@ -45,7 +69,7 @@ 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 even does it by default. Starship does not do this, but it's fairly straightforward to add this functionality to `bash`, `zsh`, `cmd` or `powershell`. First, define a window title change function (identical in bash and zsh): @@ -80,6 +104,16 @@ function set_win_title(){ starship_precmd_user_func="set_win_title" ``` +For Cmd, you can change the window title using the `starship_preprompt_user_func` function. + +```lua +function starship_preprompt_user_func(prompt) + console.settitle(os.getenv('USERNAME').."@"..os.getenv('COMPUTERNAME')..": "..os.getcwd()) +end + +load(io.popen('starship init cmd'):read("*a"))() +``` + You can also set a similar output with PowerShell by creating a function named `Invoke-Starship-PreCommand`. ```powershell @@ -97,7 +131,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). -`right_format` is currently supported for the following shells: elvish, fish, zsh. +`right_format` is currently supported for the following shells: elvish, fish, zsh, xonsh, cmd. ### Example @@ -117,6 +151,28 @@ Produces a prompt like the following: ▶ starship on  rprompt [!] is 📦 v0.57.0 via 🦀 v1.54.0 took 17s ``` +## Continuation Prompt + +Some shells support a continuation prompt along with the normal prompt. This prompt is rendered instead of the normal prompt when the user has entered an incomplete statement (such as a single left parenthesis or quote). + +Starship can set the continuation prompt using the `continuation_prompt` option. The default prompt is `"[∙](bright-black) "`. + +Note: `continuation_prompt` should be set to a literal string without any variables. + +Note: Continuation prompts are only available in the following shells: + + - `bash` + - `zsh` + - `PowerShell` + +### Example + +```toml +# ~/.config/starship.toml + +# A continuation prompt that displays two filled in arrows +continuation_prompt = "▶▶" +``` ## Style Strings diff --git a/docs/pl-PL/config/README.md b/docs/pl-PL/config/README.md index 55ec531d1..a452ec6e6 100644 --- a/docs/pl-PL/config/README.md +++ b/docs/pl-PL/config/README.md @@ -24,18 +24,24 @@ disabled = true Możesz zmienić domyślną lokalizację pliku konfiguracyjnego za pomocą zmiennej środowiskowej `STARSHIP_CONFIG`: ```sh -export STARSHIP_CONFIG=~/.starship/config.toml +export STARSHIP_CONFIG=~/example/non/default/path/starship.toml ``` Odpowiednikiem dla PowerShell (Windows) jest dodanie następującej linii w twoim `$PROFILE`: ```powershell -$ENV:STARSHIP_CONFIG = "$HOME\.starship\config.toml" +$ENV:STARSHIP_CONFIG = "$HOME\example\non\default\path\starship.toml" +``` + +Or for Cmd (Windows) would be adding this line to your `starship.lua`: + +```lua +os.setenv('STARSHIP_CONFIG', 'C:\\Users\\user\\example\\non\\default\\path\\starship.toml') ``` ### Logi -Starship domyślnie loguje ostrzeżenia i błędy do pliku o nazwie`~/.cache/starship/session_${STARSHIP_SESSION_KEY}.log`, gdzie klucz sesji odpowiada twojej instancji terminala. Można to zmienić za pomocą zmiennej środowiskowej `STARSHIP_CACHE`: +By default starship logs warnings and errors into a file named `~/.cache/starship/session_${STARSHIP_SESSION_KEY}.log`, where the session key is corresponding to a instance of your terminal. This, however can be changed using the `STARSHIP_CACHE` environment variable: ```sh export STARSHIP_CACHE=~/.starship/cache @@ -47,23 +53,29 @@ Odpowiednikiem dla PowerShell (Windows) jest dodanie następującej linii w twoi $ENV:STARSHIP_CACHE = "$HOME\AppData\Local\Temp" ``` +Or for Cmd (Windows) would be adding this line to your `starship.lua`: + +```lua +os.setenv('STARSHIP_CACHE', 'C:\\Users\\user\\AppData\\Local\\Temp') +``` + ### Glosariusz -**Moduł**: Komponent wiersza poleceń, który dostarcza informacji opartych na kontekście twojego systemu operacyjnego. Przykładowo, moduł "nodejs" pokazuje wersję Node.js, która jest obecnie zainstalowana na twoim komputerze, jeżeli znajdujesz się w folderze zawierającym projekt Node.js. +**Module**: A component in the prompt giving information based on contextual information from your OS. For example, the "nodejs" module shows the version of Node.js that is currently installed on your computer, if your current directory is a Node.js project. -**Zmienna**: Mniejszy podkomponent zawierający informacje dostarczane przez moduł. Przykładowo, zmienna "version" w module "nodejs" zawiera obecną wersję Node.js. +**Variable**: Smaller sub-components that contain information provided by the module. For example, the "version" variable in the "nodejs" module contains the current version of Node.js. -W ramach konwencji większość modułów posiada przedrostek w domyślnym kolorze terminala (n.p. `via` w "nodejs") oraz pojedynczy odstęp za treścią modułu. +By convention, most modules have a prefix of default terminal color (e.g. `via` in "nodejs") and an empty space as a suffix. ### Formatowanie -Moduły wypisują swoje zmienne przy użyciu ciągów formatujących. Większość modułów posiada wpis o nazwie `format`, który konfiguruje format wyświetlania modułu. W ciągach formatujących można używać tekstu, zmiennych oraz grup tekstowych. +Format strings are the format that a module prints all its variables with. Most modules have an entry called `format` that configures the display format of the module. You can use texts, variables and text groups in a format string. #### Zmienne -Zmienna zawiera symbol `$`, po którym następuje nazwa zmiennej. The name of a variable can only contain 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 `_`. -Na przykład: +For example: - `$version` to ciąg formatujący ze zmienną o nazwie `version`. - `$git_branch$git_commit` zawiera dwie zmienne: `git_branch` i `git_commit`. @@ -71,13 +83,13 @@ Na przykład: #### Grupy tekstowe -Grupa tekstowa składa się z dwóch oddzielnych części. +A text group is made up of two different parts. -Pierwsza część, otoczona `[]`, to [ciąg formatujący](#format-strings). You can add texts, variables, or even nested text groups in it. +The first part, which is enclosed in a `[]`, is a [format string](#format-strings). You can add texts, variables, or even nested text groups in it. In the second part, which is enclosed in a `()`, is a [style string](#style-strings). This can be used to style the first part. -Na przykład: +For example: - `[on](red bold)` will print a string `on` with bold text colored red. - `[⌘ $version](bold green)` will print a symbol `⌘` followed by the content of variable `version`, with bold text colored green. @@ -100,7 +112,7 @@ Note that what styling looks like will be controlled by your terminal emulator. A conditional format string wrapped in `(` and `)` will not render if all variables inside are empty. -Na przykład: +For example: - `(@$region)` will show nothing if the variable `region` is `None` or empty string, otherwise `@` followed by the value of region. - `(some text)` will always show nothing since there are no variables wrapped in the braces. @@ -425,13 +437,13 @@ By default it only changes color. If you also want to change its shape take a lo ::: warning -`error_symbol` is not supported on elvish and nu shell. +`error_symbol` is not supported on nu shell. ::: ::: warning -`vicmd_symbol` is only supported in fish and zsh. +`vicmd_symbol` is only supported in cmd, fish and zsh. ::: @@ -568,7 +580,7 @@ Bash users who need preexec-like functionality can use [rcaloras's bash_preexec ::: tip -Showing desktop notifications requires starship to be built with `rust-notify` support. You check if your starship supports notifications by running `STARSHIP_LOG=debug starship module cmd_duration -d 60000` when `show_notifications` is set to `true`. +Showing desktop notifications requires starship to be built with `notify-rust` support. You check if your starship supports notifications by running `STARSHIP_LOG=debug starship module cmd_duration -d 60000` when `show_notifications` is set to `true`. ::: @@ -713,20 +725,20 @@ format = "via [🔰 $version](bold red) " ## Deno The `deno` module shows you your currently installed version of [Deno](https://deno.land/). By default the module will be shown if any of the following conditions are met: -- The current directory contains a `mod.ts`, `mod.js`, `deps.ts` or `deps.js` file +- The current directory contains a `deno.json`, `deno.jsonc`, `mod.ts`, `mod.js`, `deps.ts` or `deps.js` file ### Options -| Option | Default | Description | -| ------------------- | -------------------------------------------- | ------------------------------------------------------------------------- | -| `format` | `"via [$symbol($version )]($style)"` | The format for the module. | -| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | -| `symbol` | `"🦕 "` | A format string representing the symbol of Deno | -| `detect_extensions` | `[]` | Which extensions should trigger this module. | -| `detect_files` | `["mod.ts", "mod.js", "deps.ts", "deps.js"]` | Which filenames should trigger this module. | -| `detect_folders` | `[]` | Which folders should trigger this module. | -| `style` | `"green bold"` | The style for the module. | -| `disabled` | `false` | Disables the `deno` module. | +| Option | Default | Description | +| ------------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `format` | `"via [$symbol($version )]($style)"` | The format for the module. | +| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | +| `symbol` | `"🦕 "` | A format string representing the symbol of Deno | +| `detect_extensions` | `[]` | Which extensions should trigger this module. | +| `detect_files` | `["deno.json", "deno.jsonc", "mod.ts", "mod.js", "deps.ts", "deps.js"]` | Which filenames should trigger this module. | +| `detect_folders` | `[]` | Which folders should trigger this module. | +| `style` | `"green bold"` | The style for the module. | +| `disabled` | `false` | Disables the `deno` module. | ### Variables @@ -755,18 +767,19 @@ For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, an ### Options -| Option | Default | Description | -| ------------------- | -------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `truncation_length` | `3` | The number of parent folders that the current directory should be truncated to. | -| `truncate_to_repo` | `true` | Whether or not to truncate to the root of the git repo that you're currently in. | -| `format` | `"[$path]($style)[$read_only]($read_only_style) "` | The format for the module. | -| `style` | `"bold cyan"` | The style for the module. | -| `disabled` | `false` | Disables the `directory` module. | -| `read_only` | `"🔒"` | The symbol indicating current directory is read only. | -| `read_only_style` | `"red"` | The style for the read only symbol. | -| `truncation_symbol` | `""` | The symbol to prefix to truncated paths. eg: "…/" | -| `repo_root_style` | `None` | The style for the root of the git repo when `truncate_to_repo` option is set to false. | -| `home_symbol` | `"~"` | The symbol indicating home directory. | +| Option | Default | Description | +| ------------------- | -------------------------------------------------- | --------------------------------------------------------------------------------------- | +| `truncation_length` | `3` | The number of parent folders that the current directory should be truncated to. | +| `truncate_to_repo` | `true` | Whether or not to truncate to the root of the git repo that you're currently in. | +| `format` | `"[$path]($style)[$read_only]($read_only_style) "` | The format for the module. | +| `style` | `"bold cyan"` | The style for the module. | +| `disabled` | `false` | Disables the `directory` module. | +| `read_only` | `"🔒"` | The symbol indicating current directory is read only. | +| `read_only_style` | `"red"` | The style for the read only symbol. | +| `truncation_symbol` | `""` | The symbol to prefix to truncated paths. eg: "…/" | +| `repo_root_style` | `None` | The style for the root of the git repo when `truncate_to_repo` option is set to false. | +| `home_symbol` | `"~"` | The symbol indicating home directory. | +| `use_os_path_sep` | `true` | Use the OS specific path seperator instead of always using `/` (e.g. `\` on Windows) |
This module has a few advanced configuration options that control how the directory is displayed. @@ -1334,22 +1347,23 @@ The `git_status` module shows symbols representing the state of the repo in your ### Options -| Option | Default | Description | -| ------------ | ----------------------------------------------- | ----------------------------------- | -| `format` | `'([\[$all_status$ahead_behind\]]($style) )'` | The default format for `git_status` | -| `conflicted` | `"="` | This branch has merge conflicts. | -| `ahead` | `"⇡"` | The format of `ahead` | -| `behind` | `"⇣"` | The format of `behind` | -| `diverged` | `"⇕"` | The format of `diverged` | -| `up_to_date` | `""` | The format of `up_to_date` | -| `untracked` | `"?"` | The format of `untracked` | -| `stashed` | `"$"` | The format of `stashed` | -| `modified` | `"!"` | The format of `modified` | -| `staged` | `"+"` | The format of `staged` | -| `renamed` | `"»"` | The format of `renamed` | -| `deleted` | `"✘"` | The format of `deleted` | -| `style` | `"bold red"` | The style for the module. | -| `disabled` | `false` | Disables the `git_status` module. | +| Option | Default | Description | +| ------------------- | ----------------------------------------------- | ----------------------------------- | +| `format` | `'([\[$all_status$ahead_behind\]]($style) )'` | The default format for `git_status` | +| `conflicted` | `"="` | This branch has merge conflicts. | +| `ahead` | `"⇡"` | The format of `ahead` | +| `behind` | `"⇣"` | The format of `behind` | +| `diverged` | `"⇕"` | The format of `diverged` | +| `up_to_date` | `""` | The format of `up_to_date` | +| `untracked` | `"?"` | The format of `untracked` | +| `stashed` | `"$"` | The format of `stashed` | +| `modified` | `"!"` | The format of `modified` | +| `staged` | `"+"` | The format of `staged` | +| `renamed` | `"»"` | The format of `renamed` | +| `deleted` | `"✘"` | The format of `deleted` | +| `style` | `"bold red"` | The style for the module. | +| `ignore_submodules` | `false` | Ignore changes to submodules. | +| `disabled` | `false` | Disables the `git_status` module. | ### Variables @@ -1513,10 +1527,10 @@ The `hostname` module shows the system hostname. ### Variables -| Zmienne | Example | Description | -| --------- | ------- | ------------------------------------ | -| symbol | | Mirrors the value of option `symbol` | -| style\* | | Mirrors the value of option `style` | +| Zmienne | Example | Description | +| --------- | ---------- | ----------------------------------- | +| hostname | `computer` | The hostname of the computer | +| style\* | | Mirrors the value of option `style` | \*: This variable can only be used as a part of a style string @@ -2133,7 +2147,7 @@ symbol = "☁️ " ## Package Version -The `package` module is shown when the current directory is the repository for a package, and shows its current version. The module currently supports `npm`, `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`, `shards` and `dart` packages. - [**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 @@ -2150,6 +2164,7 @@ The `package` module is shown when the current directory is the repository for a - [**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 - [**SBT**](https://scala-sbt.org) - The `sbt` package version is extracted from the `build.sbt` present in the current directory +- [**Dart**](https://pub.dev/) - The `dart` package version is extracted from the `pubspec.yaml` 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. @@ -2673,6 +2688,8 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y | `elvish_indicator` | `esh` | A format string used to represent elvish. | | `tcsh_indicator` | `tsh` | A format string used to represent tcsh. | | `xonsh_indicator` | `xsh` | A format string used to represent xonsh. | +| `cmd_indicator` | `cmd` | A format string used to represent cmd. | +| `nu_indicator` | `nu` | A format string used to represent nu. | | `unknown_indicator` | | The default value to be displayed when the shell is unknown. | | `format` | `"[$indicator]($style) "` | The format for the module. | | `style` | `"white bold"` | The style for the module. | @@ -2778,7 +2795,7 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y ::: -::: warning This module is not supported on elvish and nu shell. ::: +::: warning This module is not supported on nu shell. ::: ### Options @@ -2804,6 +2821,7 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y | Zmienne | Example | Description | | -------------- | ------- | ------------------------------------------------------------------------------------------- | | status | `127` | The exit code of the last command | +| hex_status | `0x7F` | The exit code of the last command in hex | | int | `127` | The exit code of the last command | | common_meaning | `ERROR` | Meaning of the code if not a signal | | signal_number | `9` | Signal number corresponding to the exit code, only if signalled | diff --git a/docs/pl-PL/faq/README.md b/docs/pl-PL/faq/README.md index ef3c073ef..d02917b21 100644 --- a/docs/pl-PL/faq/README.md +++ b/docs/pl-PL/faq/README.md @@ -69,13 +69,13 @@ Jeśli zauważyłeś symbole których nie rozpoznajesz, możesz użyć `starship You can enable the debug logs by using the `STARSHIP_LOG` env var. These logs can be very verbose so it is often useful to use the `module` command if you are trying to debug a particular module, for example, if you are trying to debug the `rust` module you could run the following command to get the trace logs and output from the module. ```sh -env STARHIP_LOG=trace starship module rust +env STARSHIP_LOG=trace starship module rust ``` If starship is being slow you can try using the `timings` command to see if there is a particular module or command that to blame. ```sh -env STARHIP_LOG=trace starship timings +env STARSHIP_LOG=trace starship timings ``` This will output the trace log and a breakdown of all modules that either took more than 1ms to execute or produced some output. @@ -118,5 +118,5 @@ If Starship was installed using the install script, the following command will d ```sh # Locate and delete the starship binary -sh -c 'rm "$(which starship)"' +sh -c 'rm "$(command -v 'starship')"' ``` diff --git a/docs/pl-PL/guide/README.md b/docs/pl-PL/guide/README.md index 240055b91..f64b98be1 100644 --- a/docs/pl-PL/guide/README.md +++ b/docs/pl-PL/guide/README.md @@ -72,6 +72,22 @@ height="20" src="https://raw.githubusercontent.com/starship/starship/master/media/flag-fr.png" alt="Français" + /> +   + Bahasa Indonesia +   + Italiano   @@ -119,7 +119,7 @@ description: O Starship é o prompt minimalista, extremamente rápido e extremam #### Elvish - ::: Atenção Apenas a versão v0.15 ou superior do elvish é suportada. ::: + ::: warning Apenas a versão elvish v0.17 ou superior é suportada. ::: Adicione o comando a seguir ao final do arquivo `~/.elvish/rc.elv`: @@ -164,3 +164,14 @@ description: O Starship é o prompt minimalista, extremamente rápido e extremam execx($(starship init xonsh)) ``` + + + #### Cmd + + You need to use [Clink](https://chrisant996.github.io/clink/clink.html) (v1.2.30+) with Cmd. Add the following to a file `starship.lua` and place this file in Clink scripts directory: + + ```lua + -- starship.lua + + load(io.popen('starship init cmd'):read("*a"))() + ``` diff --git a/docs/pt-BR/advanced-config/README.md b/docs/pt-BR/advanced-config/README.md index 75b85e337..27567d7d1 100644 --- a/docs/pt-BR/advanced-config/README.md +++ b/docs/pt-BR/advanced-config/README.md @@ -8,11 +8,35 @@ As configurações nesta seção estão sujeitas a alterações em futuras vers ::: -## Comandos personalizados de pre-prompt e pre-execution no Bash +## Custom pre-prompt and pre-execution Commands in Cmd -O Bash 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 `bash`. No entanto, Starship te oferece uma capacidade limitada de inserir suas próprias funções na processo de prompt-rendering: +Clink provides extremely flexible APIs to run pre-prompt and pre-exec commands in Cmd shell. It is fairly simple to use with Starship. Make the following changes to your `starship.lua` file as per your requirements: -- Para rodar uma função personalizada antes do prompt iniciar, defina uma nova função e atribua seu nome para `starship_precmd_user_func`. Por exemplo, para desenhar um foguete antes do prompt iniciar você faria +- To run a custom function right before the prompt is drawn, define a new function called `starship_preprompt_user_func`. This function receives the current prompt as a string that you can utilize. For example, to draw a rocket before the prompt, you would do + +```lua +function starship_preprompt_user_func(prompt) + print("🚀") +end + +load(io.popen('starship init cmd'):read("*a"))() +``` + +- To run a custom function right before a command is executed, define a new function called `starship_precmd_user_func`. This function receives the current commandline as a string that you can utilize. For example, to print the command that's about to be executed, you would do + +```lua +function starship_precmd_user_func(line) + print("Executing: "..line) +end + +load(io.popen('starship init cmd'):read("*a"))() +``` + +## Custom pre-prompt and pre-execution Commands in Bash + +Bash does not have a formal preexec/precmd framework like most other shells. Because of this, it is difficult to provide fully customizable hooks in `bash`. No entanto, Starship te oferece uma capacidade limitada de inserir suas próprias funções na processo de prompt-rendering: + +- To run a custom function right before the prompt is drawn, define a new function and then assign its name to `starship_precmd_user_func`. For example, to draw a rocket before the prompt, you would do ```bash function blastoff(){ @@ -21,21 +45,21 @@ function blastoff(){ starship_precmd_user_func="blastoff" ``` -- Para rodar uma função personalizada antes que um comando seja executado, você pode usar [`DEBUG` como mecanismo de armadilha](https://jichu4n.com/posts/debug-trap-and-prompt_command-in-bash/). No entanto, você **deve** prender o sinal de DEBUG *antes* de inicializar o Starship! O Starship consegue preservar o valor da armadilha DEBUG, mas se a armadilha for substituída depois do starship iniciar, algumas funções iram quebrar. +- To run a custom function right before a command runs, you can use the [`DEBUG` trap mechanism](https://jichu4n.com/posts/debug-trap-and-prompt_command-in-bash/). However, you **must** trap the DEBUG signal *before* initializing Starship! Starship can preserve the value of the DEBUG trap, but if the trap is overwritten after starship starts up, some functionality will break. ```bash function blastoff(){ echo "🚀" } -trap blastoff DEBUG # Trap Inicia o debug antes de iniciar o starship +trap blastoff DEBUG # Trap DEBUG *before* running starship eval $(starship init bash) ``` -## Comandos personalizados de pre-prompt e pre-execution no PowerShell +## Custom pre-prompt and pre-execution Commands in PowerShell -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: +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: -Crie uma função chamada `Invoke-Starship-PreCommand` +Create a function named `Invoke-Starship-PreCommand` ```powershell function Invoke-Starship-PreCommand { @@ -43,11 +67,11 @@ function Invoke-Starship-PreCommand { } ``` -## Altera o título da janela +## Change Window Title -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`. +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`, `zsh`, `cmd` or `powershell`. -Primeiro, defina uma função de alteração de titulo de janela (é o mesmo para bash e zsh): +First, define a window title change function (identical in bash and zsh): ```bash function set_win_title(){ @@ -55,23 +79,23 @@ function set_win_title(){ } ``` -Você pode usar variáveis para customizar o titulo (`$USER`, `$HOSTNAME`, e `$PWD` são escolhas populares). +You can use variables to customize this title (`$USER`, `$HOSTNAME`, and `$PWD` are popular choices). -No `bash`, defina esta função como a precedente da função starship: +In `bash`, set this function to be the precmd starship function: ```bash starship_precmd_user_func="set_win_title" ``` -No `zsh`, adicione no array `precmd_functions`: +In `zsh`, add this to the `precmd_functions` array: ```bash precmd_functions+=(set_win_title) ``` -Se você gostar do resultado, adicione esta linha ao seu arquivo de configuração de shell (`~/.bashrc` or `~/.zshrc`) para torna-lo permanente. +If you like the result, add these lines to your shell configuration file (`~/.bashrc` or `~/.zshrc`) to make it permanent. -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`: +For example, if you want to display your current directory in your terminal tab title, add the following snippet to your `~/.bashrc` or `~/.zshrc`: ```bash function set_win_title(){ @@ -80,7 +104,17 @@ function set_win_title(){ starship_precmd_user_func="set_win_title" ``` -Você também pode definir uma saída semelhante com o PowerShell criando uma função chamada `Invoke-Starship-PreCommand`. +For Cmd, you can change the window title using the `starship_preprompt_user_func` function. + +```lua +function starship_preprompt_user_func(prompt) + console.settitle(os.getenv('USERNAME').."@"..os.getenv('COMPUTERNAME')..": "..os.getcwd()) +end + +load(io.popen('starship init cmd'):read("*a"))() +``` + +You can also set a similar output with PowerShell by creating a function named `Invoke-Starship-PreCommand`. ```powershell # edit $PROFILE @@ -91,36 +125,58 @@ function Invoke-Starship-PreCommand { Invoke-Expression (&starship init powershell) ``` -## Ativando o Prompt Direito +## Enable Right Prompt -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`. +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`. -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). +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` é atualmente suportado para os seguintes shells: elvish, fish, zsh. +`right_format` is currently supported for the following shells: elvish, fish, zsh, xonsh, cmd. ### Exemplo ```toml # ~/.config/starship.toml -# Um prompt esquerdo minimo +# A minimal left prompt format = """$character""" -# Move o resto do prompt para direita +# move the rest of the prompt to the right right_format = """$all""" ``` -Gera um prompt parecido com o seguinte: +Produces a prompt like the following: ``` ▶ starship on  rprompt [!] is 📦 v0.57.0 via 🦀 v1.54.0 took 17s ``` +## Continuation Prompt + +Some shells support a continuation prompt along with the normal prompt. This prompt is rendered instead of the normal prompt when the user has entered an incomplete statement (such as a single left parenthesis or quote). + +Starship can set the continuation prompt using the `continuation_prompt` option. The default prompt is `"[∙](bright-black) "`. + +Note: `continuation_prompt` should be set to a literal string without any variables. + +Note: Continuation prompts are only available in the following shells: + + - `bash` + - `zsh` + - `PowerShell` + +### Exemplo + +```toml +# ~/.config/starship.toml + +# A continuation prompt that displays two filled in arrows +continuation_prompt = "▶▶" +``` ## Estilo dos textos -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: +Style strings are a list of words, separated by whitespace. The words are not case sensitive (i.e. `bold` and `BoLd` are considered the same string). Each word can be one of the following: - `bold` - `italic` @@ -132,14 +188,14 @@ Estilo de strings são uma lista de palavras, separadas por espaço. As palavras - `` - `none` -onde `` é uma especialista de cores (discutido abaixo). `fg:` e `` 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. +where `` is a color specifier (discussed below). `fg:` and `` 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. -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. +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. -Um especialista em cores pode ser um dos seguintes: +A color specifier can be one of the following: - - 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 número entre 0-255. Este especifica um [Código de Cor ANSI 8 bits](https://i.stack.imgur.com/KTSQa.png). + - One of the standard terminal colors: `black`, `red`, `green`, `blue`, `yellow`, `purple`, `cyan`, `white`. You can optionally prefix these with `bright-` to get the bright version (e.g. `bright-white`). + - A `#` followed by a six-digit hexadecimal number. This specifies an [RGB color hex code](https://www.w3schools.com/colors/colors_hexadecimal.asp). + - A number between 0-255. This specifies an [8-bit ANSI Color Code](https://i.stack.imgur.com/KTSQa.png). -Se múltiplas cores forem especificadas para foreground/background, a ultima da string que terá prioridade. +If multiple colors are specified for foreground/background, the last one in the string will take priority. diff --git a/docs/pt-BR/config/README.md b/docs/pt-BR/config/README.md index 77d43379f..92e5c86cc 100644 --- a/docs/pt-BR/config/README.md +++ b/docs/pt-BR/config/README.md @@ -24,18 +24,24 @@ disabled = true Você pode alterar o caminho padrão do arquivo de configuração com a variável de ambiente `STARSHIP_CONFIG`: ```sh -export STARSHIP_CONFIG=~/.starship/config.toml +export STARSHIP_CONFIG=~/example/non/default/path/starship.toml ``` No PowerShell (Windows) você pode adicionar a seguinte linha no seu `$PROFILE`: ```powershell -$ENV:STARSHIP_CONFIG = "$HOME\.starship\config.toml" +$ENV:STARSHIP_CONFIG = "$HOME\example\non\default\path\starship.toml" +``` + +Or for Cmd (Windows) would be adding this line to your `starship.lua`: + +```lua +os.setenv('STARSHIP_CONFIG', 'C:\\Users\\user\\example\\non\\default\\path\\starship.toml') ``` ### Logging -Por padrão o starship grava logs de erros e warnings dentro de um arquivo chamado `~/.cache/starship/session_${STARSHIP_SESSION_KEY}.log`, onde a session key corresponde a instancia do seu terminal. Isto, no entanto pode ser alterado usando a variável de ambiente `STARSHIP_CACHE`: +By default starship logs warnings and errors into a file named `~/.cache/starship/session_${STARSHIP_SESSION_KEY}.log`, where the session key is corresponding to a instance of your terminal. This, however can be changed using the `STARSHIP_CACHE` environment variable: ```sh export STARSHIP_CACHE=~/.starship/cache @@ -47,23 +53,29 @@ No PowerShell (Windows) você pode adicionar a seguinte linha no seu `$PROFILE`: $ENV:STARSHIP_CACHE = "$HOME\AppData\Local\Temp" ``` +Or for Cmd (Windows) would be adding this line to your `starship.lua`: + +```lua +os.setenv('STARSHIP_CACHE', 'C:\\Users\\user\\AppData\\Local\\Temp') +``` + ### Terminologia -**Módulo**: Um componente no prompt que fornece informações baseado no contexto do seu SO. Por exemplo, o "nodejs"módulo exibe a versão do Node.js que está instalada no computador, se o diretório atual for um projeto Node.js. +**Module**: A component in the prompt giving information based on contextual information from your OS. For example, the "nodejs" module shows the version of Node.js that is currently installed on your computer, if your current directory is a Node.js project. -**Variável**: Um pequeno subcomponente que contem informações fornecidas pelo módulo. Por exemplo, a variável "version" no módulo "nodejs"contem a versão atual do Node.js. +**Variable**: Smaller sub-components that contain information provided by the module. For example, the "version" variable in the "nodejs" module contains the current version of Node.js. -Por convenção, a maioria dos módulos tem um prefixo de cor (e.x. `via` no "nodejs") e um espaço vazio para sufixo. +By convention, most modules have a prefix of default terminal color (e.g. `via` in "nodejs") and an empty space as a suffix. ### Formatação de Strings -Formatar uma string é a forma de como o módulo ira imprimir suas variáveis. A maioria dos módulos tem uma entrada chamada `format` que configura o formato que o módulo é exibido. Você pode usar textos, variáveis e grupo de textos em uma formatação de string. +Format strings are the format that a module prints all its variables with. Most modules have an entry called `format` that configures the display format of the module. You can use texts, variables and text groups in a format string. #### Variável -Uma variável contem um simbolo `$` seguido pelo nome da variável. The name of a variable can only contain 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 `_`. -Por exemplo: +For example: - `$version` é uma formatação de string com uma variável chamada `version`. - `$git_branch$git_commit` é uma formatação de string com duas variáveis chamadas `git_branch` e `git_commit`. @@ -71,13 +83,13 @@ Por exemplo: #### Grupo de Texto -Um grupo de texto é composto por duas partes diferentes. +A text group is made up of two different parts. -A primeira parte, é contida em um `[]`, é uma [formatação de string](#format-strings). Você pode adicionar textos, variáveis ou até mesmos grupo de textos aninhados. +The first part, which is enclosed in a `[]`, is a [format string](#format-strings). You can add texts, variables, or even nested text groups in it. -Na segunda parte, é composta por um `()`, é uma [estilização de string](#style-strings). This can be used to style the first part. +In the second part, which is enclosed in a `()`, is a [style string](#style-strings). This can be used to style the first part. -Por exemplo: +For example: - `[on](red bold)` vai imprimir uma string `on` com texto em negrito e com a cor vermelha. - `[⌘ $version](bold green)` vai imprimir o simbolo `⌘` seguido pela variável `version`, com o texto em negrito e na cor verde. @@ -85,7 +97,7 @@ Por exemplo: #### Estilo dos textos -A maioria dos módulos do starship permite que você configure o estilo de exibição dos textos. Isso é feito através de um parâmetro (geralmente chamado `style`) que é uma string especificando a configuração. Aqui estão alguns exemplos de strings de estilo e o que elas fazem. Para detalhes sobre a sintaxe completa, consulte o [guia de configurações avançadas](/advanced-config/). +Most modules in starship allow you to configure their display styles. This is done with an entry (usually called `style`) which is a string specifying the configuration. Here are some examples of style strings along with what they do. For details on the full syntax, consult the [advanced config guide](/advanced-config/). - `"fg:green bg:blue"` deixa o texto verde com o fundo azul - `"bg:blue fg:bright-green"` deixa o texto verde brilhante com o fundo azul @@ -94,36 +106,36 @@ A maioria dos módulos do starship permite que você configure o estilo de exibi - `"bold italic fg:purple"` deixa o texto em negrito e itálico com a cor roxa - `""` desabilita explicitamente todos os estilos -Note que a aparência do estilo será controlado pelo seu terminal. Por exemplo, alguns terminais deixarão as cores mais brilhantes ao invés de deixar o texto em negrito, ou alguns temas podem usar as mesmas cores para cores brilhantes e normais. Além disso, para textos em itálico, o terminal precisa ter suporte. +Note that what styling looks like will be controlled by your terminal emulator. For example, some terminal emulators will brighten the colors instead of bolding text, and some color themes use the same values for the normal and bright colors. Also, to get italic text, your terminal must support italics. #### Formatação de String Condicional -Uma formatação condicional de string é envolto por `(` e `)` não vai ser exibido caso a variável dentro esteja vazia. +A conditional format string wrapped in `(` and `)` will not render if all variables inside are empty. -Por exemplo: +For example: - `(@$region)` não vai exibir nada caso a variável `region` seja `None` ou vazia, caso contrario vai exibir `@` seguido pelo valor da variável region. - `(texto qualquer)` não vai exibir nada sempre, pois não existe variável entre os parenteses. - Quando usar `$all` é um atalho para `\[$a$b\]`, `($all)` vai exibir nada somente quando `$a` e `$b` são `None`. Isto funciona da mesma forma que `(\[$a$b\] )`. -#### Special characters +#### Caracteres Especiais 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 `\\`). -Por exemplo, quando você quer imprimir um simbolo `$` em uma nova linha, as configurações de `format` a seguir são equivalentes: +For example, when you want to print a `$` symbol on a new line, the following configs for `format` are equivalent: ```toml -# com string básica +# with basic string format = "\n\\$" -# com múltiplas linhas de string básica +# with multiline basic string format = """ \\$""" -# com string literal +# with literal string format = ''' \$''' @@ -131,14 +143,14 @@ format = ''' ## Prompt de Comando -Está é a lista de opções de configuração de prompt. +This is the list of prompt-wide configuration options. ### Opções | Opções | Padrão | Descrição | | ----------------- | ------------------------------ | ---------------------------------------------------------------------- | | `format` | [link](#default-prompt-format) | Configura o formato do prompt. | -| `right_format` | `""` | See [Enable Right Prompt](/advanced-config/#enable-right-prompt) | +| `right_format` | `""` | Veja [Ativa o prompt direito](/advanced-config/#enable-right-prompt) | | `scan_timeout` | `30` | Tempo limite para escanear arquivos (em milissegundos). | | `command_timeout` | `500` | Tempo limite de execução de comandos pelo starship (em milissegundos). | | `add_newline` | `true` | Insere linha vazia entre os prompts do shell. | @@ -149,22 +161,22 @@ Está é a lista de opções de configuração de prompt. ```toml # ~/.config/starship.toml -# Usa um format customizado +# Use custom format format = """ [┌───────────────────>](bold green) [│](bold green)$directory$rust$package [└─>](bold green) """ -#Espera 10 milissegundos para que o starship check os arquivos do diretório atual. +# Wait 10 milliseconds for starship to check files under the current directory. scan_timeout = 10 -# Desabilita uma nova linha no inicio do prompt +# Disable the blank line at the start of the prompt add_newline = false ``` ### Format de Prompt Padrão -O `formato` padrão é usado para definir o formato do prompt, se um valor vazio ou não `formatado` for informado. Os valores padrão são os seguintes: +The default `format` is used to define the format of the prompt, if empty or no `format` is provided. The default is as shown: ```toml format = "$all" @@ -248,13 +260,13 @@ format="$all$directory$character" ## AWS -O módulo `aws` exibi a região e perfil atual do AWS. Isto é baseado nas variáveis de env `AWS_REGION`, `AWS_DEFAULT_REGION`, and `AWS_PROFILE` contidas no arquivo `~/.aws/config`. Este modulo exibi também tempo de expiração de credenciais temporarias. +The `aws` module shows the current AWS region and profile. This is based on `AWS_REGION`, `AWS_DEFAULT_REGION`, and `AWS_PROFILE` env var with `~/.aws/config` file. This module also shows an expiration timer when using temporary credentials. -Quando usar [aws-vault](https://github.com/99designs/aws-vault) o perfil é lido da variável `AWS_VAULT` e o tempo de expiração de credenciais é lida da variável de env `AWS_SESSION_EXPIRATION`. +When using [aws-vault](https://github.com/99designs/aws-vault) the profile is read from the `AWS_VAULT` env var and the credentials expiration date is read from the `AWS_SESSION_EXPIRATION` env var. -Quando usar [awsu](https://github.com/kreuzwerker/awsu) o perfil é lido da varável de env `AWSU_PROFILE`. +When using [awsu](https://github.com/kreuzwerker/awsu) the profile is read from the `AWSU_PROFILE` env var. -Quando usar [AWSume](https://awsu.me) o perfil é lido da variável `AWSUME_PROFILE` e o tempo de expiração de credenciais é lida da variável de env `AWSUME_EXPIRATION`. +When using [AWSume](https://awsu.me) the profile is read from the `AWSUME_PROFILE` env var and the credentials expiration date is read from the `AWSUME_EXPIRATION` env var. ### Opções @@ -326,12 +338,12 @@ The `azure` module shows the current Azure Subscription. This is based on showin ### Opções -| Variável | Padrão | Descrição | -| ---------- | ---------------------------------------- | ------------------------------------------ | -| `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. | +| Variável | Padrão | Descrição | +| ---------- | ---------------------------------------- | ---------------------------------------------- | +| `format` | `"on [$symbol($subscription)]($style) "` | O formato que o módulo Azure será renderizado. | +| `symbol` | `"ﴃ "` | O símbolo usado no formato. | +| `style` | `"blue bold"` | O estilo usado no formato. | +| `disabled` | `true` | Desabilita o módulo `azure`. | ### Exemplo @@ -347,7 +359,7 @@ style = "blue bold" ## Bateria -O módulo `battery` exibe o quanto a bateria do dispositivo está carregada e o estado atual de carregamento. O módulo é visível somente quando a bateria está abaixo de 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%. ### Opções @@ -375,7 +387,7 @@ discharging_symbol = "💀 " ### Indicador de bateria -A configuração `display` é usada para definir quando o indicador de bateria deve ser exibido (threshold), qual deve ser o simbolo(symbol) e como você gostaria de exibir (style). Se nenhum `display` for fornecido. Os valores padrão são os seguintes: +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. The default is as shown: ```toml [[battery.display]] @@ -383,11 +395,11 @@ threshold = 10 style = "bold red" ``` -O valor padrão das opções `charging_symbol` e `discharging_symbol`é respectivamente o valor das opções `battery`'s `charging_symbol` e `discharging_symbol`. +The default value for the `charging_symbol` and `discharging_symbol` option is respectively the value of `battery`'s `charging_symbol` and `discharging_symbol` option. #### Opções -A opção `display` é um array da seguinte tabela. +The `display` option is an array of the following table. | Opções | Padrão | Descrição | | -------------------- | ---------- | -------------------------------------------------------------------------------------------------- | @@ -414,24 +426,24 @@ discharging_symbol = "💦" ## Caractere -O módulo `character` exibe um caracter (normalmente uma seta) ao lado de onde o texto começa a ser inserido no terminal. +The `character` module shows a character (usually an arrow) beside where the text is entered in your terminal. -O caractere vai te dizer se o ultimo comando foi bem sucedido ou não. Você pode fazer isto de duas maneiras: +The character will tell you whether the last command was successful or not. It can do this in two ways: - alterando a cor (`red`/`green`) - alterando a forma (`❯`/`✖`) -Por padrão ele apenas muda de cor. Se você deseja alterar o formato de uma olhada [neste exemplo](#with-custom-error-shape). +By default it only changes color. If you also want to change its shape take a look at [this example](#with-custom-error-shape). ::: warning -`error_symbol` não é suportado no elvish e nu shell. +`error_symbol` is not supported on nu shell. ::: ::: warning -`vicmd_symbol` é suportado apenas no fish e zsh. +`vicmd_symbol` is only supported in cmd, fish and zsh. ::: @@ -484,7 +496,7 @@ vicmd_symbol = "[V](bold green) " ## CMake -O módulo `cmake` exibe a versão instalada do [CMake](https://cmake.org/). Por padrão o módulo será ativo se qualquer das condições a seguir for atendida: +The `cmake` module shows the currently installed version of [CMake](https://cmake.org/). By default the module will be activated if any of the following conditions are met: - O diretorio atual cotem um arquivo `CMakeLists.txt` - O diretorio atual tem um arquivo `CMakeCache.txt` @@ -516,27 +528,27 @@ O módulo `cmake` exibe a versão instalada do [CMake](https://cmake.org/). Por The `cobol` module shows the currently installed version of COBOL. By default, the module will be shown if any of the following conditions are met: -- The current directory contains any files ending in `.cob` or `.COB` -- The current directory contains any files ending in `.cbl` or `.CBL` +- O diretório atual tem qualquer arquivo com extensão `.cob` or `.COB` +- O diretório atual tenham qualquer arquivo com extensão `.cbl` or `.CBL` ### Opções | Opções | Padrão | Descrição | | ------------------- | ------------------------------------ | ------------------------------------------------------------------------------------ | -| `symbol` | `"⚙️ "` | The symbol used before displaying the version of COBOL. | +| `symbol` | `"⚙️ "` | O simbolo usado antes de exibir a versão do COBOL. | | `format` | `"via [$symbol($version )]($style)"` | O formato do módulo. | | `version_format` | `"v${raw}"` | O formato da versão. As variáveis disponíveis são `raw`, `major`, `minor`, & `patch` | | `style` | `"bold blue"` | O estilo do módulo. | | `detect_extensions` | `["cbl", "cob", "CBL", "COB"]` | Quais extensões devem ativar este módulo. | | `detect_files` | `[]` | Quais nomes de arquivos devem ativar este módulo. | | `detect_folders` | `[]` | Quais pastas devem ativar este módulo. | -| `disabled` | `false` | Disables the `cobol` module. | +| `disabled` | `false` | Desabilita o módulo `cobol`. | ### Variáveis | Variável | Exemplo | Descrição | | --------- | ---------- | ---------------------------------- | -| version | `v3.1.2.0` | The version of `cobol` | +| version | `v3.1.2.0` | A versão do `cobol` | | symbol | | Espelha o valor da opção `símbolo` | | style\* | | Espelha o valor da opção `style` | @@ -544,15 +556,15 @@ The `cobol` module shows the currently installed version of COBOL. By default, t ## Tempo de execução do comando -O módulo `cmd_duration` exibi o tempo que o ultimo comando levou para executar. O módulo vai exibir somente se o comando levar mais de dois segundos, ou o valor de configuração `min_time` existir. +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 Não utilize o DEBUG-trap no Bash +::: warning Do not hook the DEBUG trap in Bash -Se você esta rodando o Starship no `bash`, você não deve ativar a armadilha `DEBUG` após rodar `eval $(starship init $0)`, ou este módulo **vai** quebrar. +If you are running Starship in `bash`, do not hook the `DEBUG` trap after running `eval $(starship init $0)`, or this module **will** break. ::: -Usuários do bash que precisam de funções pre-executadas podem usar [rcaloras's bash_preexec framework](https://github.com/rcaloras/bash-preexec). Simplesmente defina os arrays `preexec_functions` e `precmd_functions` antes de rodar `eval $(starship init $0)`, e depois pode proceder normalmente. +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. ### Opções @@ -568,7 +580,7 @@ Usuários do bash que precisam de funções pre-executadas podem usar [rcaloras' ::: tip -Para exibir notificações requer que o starship seja construído com suporte para `rust-notify`. Você consegue verificar se seu starship suporta notificações rodando `STARSHIP_LOG=debug starship module cmd_duration -d 60000` quando `show_notifications` é definido como `true`. +Showing desktop notifications requires starship to be built with `notify-rust` support. You check if your starship supports notifications by running `STARSHIP_LOG=debug starship module cmd_duration -d 60000` when `show_notifications` is set to `true`. ::: @@ -597,7 +609,7 @@ The `conda` module shows the current [Conda](https://docs.conda.io/en/latest/) e ::: tip -Isso não suprime o modificador de prompt do conda, você pode executar `conda config --set changeps1 False`. +This does not suppress conda's own prompt modifier, you may want to run `conda config --set changeps1 False`. ::: @@ -633,7 +645,7 @@ format = "[$symbol$environment](dimmed green) " ## Crystal -O módulo `crystal` exibe a versão instalada atual do [Crystal](https://crystal-lang.org/). Por padrão o módulo vai exibir se uma das condições a seguir for atendida: +The `crystal` module shows the currently installed version of [Crystal](https://crystal-lang.org/). Por padrão o módulo vai exibir se uma das condições a seguir for atendida: - O diretório atual contem um arquivo `shard.yml` - O diretório atual contem um arquivo `.cr` @@ -672,7 +684,7 @@ format = "via [✨ $version](bold blue) " ## Dart -O módulo `dart` exibe a versão atual instalada do [Dart](https://dart.dev/). Por padrão o módulo vai exibir se uma das condições a seguir for atendida: +The `dart` module shows the currently installed version of [Dart](https://dart.dev/). Por padrão o módulo vai exibir se uma das condições a seguir for atendida: - O diretório atual contem algum arquivo com extensão `.dart` - O diretório atual contem um diretório `.dart_tool` @@ -712,21 +724,21 @@ format = "via [🔰 $version](bold red) " ## Deno -O módulo `deno` exibe a versão instalada atual do [Deno](https://deno.land/). Por padrão o módulo vai exibir se uma das condições a seguir for atendida: -- O diretório contem um arquivo `mod.ts`, `mod.js`, `deps.ts` ou `deps.js` +The `deno` module shows you your currently installed version of [Deno](https://deno.land/). Por padrão o módulo vai exibir se uma das condições a seguir for atendida: +- O diretório atual tenha um arquivo `deno.json`, `deno.jsonc`, `mod.ts`, `mod.js`, `deps.ts` or `deps.js` ### Opções -| Opções | Padrão | Descrição | -| ------------------- | -------------------------------------------- | ------------------------------------------------------------------------------------ | -| `format` | `"via [$symbol($version )]($style)"` | O formato do módulo. | -| `version_format` | `"v${raw}"` | O formato da versão. As variáveis disponíveis são `raw`, `major`, `minor`, & `patch` | -| `symbol` | `"🦕 "` | Um formato de string que representa o simbolo do Deno | -| `detect_extensions` | `[]` | Quais extensões devem ativar este módulo. | -| `detect_files` | `["mod.ts", "mod.js", "deps.ts", "deps.js"]` | Quais nomes de arquivos devem ativar este módulo. | -| `detect_folders` | `[]` | Quais pastas devem ativar este módulo. | -| `style` | `"green bold"` | O estilo do módulo. | -| `disabled` | `false` | Desabilita o módulo `deno`. | +| Opções | Padrão | Descrição | +| ------------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------ | +| `format` | `"via [$symbol($version )]($style)"` | O formato do módulo. | +| `version_format` | `"v${raw}"` | O formato da versão. As variáveis disponíveis são `raw`, `major`, `minor`, & `patch` | +| `symbol` | `"🦕 "` | Um formato de string que representa o simbolo do Deno | +| `detect_extensions` | `[]` | Quais extensões devem ativar este módulo. | +| `detect_files` | `["deno.json", "deno.jsonc", "mod.ts", "mod.js", "deps.ts", "deps.js"]` | Quais nomes de arquivos devem ativar este módulo. | +| `detect_folders` | `[]` | Quais pastas devem ativar este módulo. | +| `style` | `"green bold"` | O estilo do módulo. | +| `disabled` | `false` | Desabilita o módulo `deno`. | ### Variáveis @@ -747,35 +759,36 @@ format = "via [🦕 $version](green bold) " ## Diretório -O módulo `directory` exibe o caminho do diretório atual, truncando as três pastas pai. Seu diretório será truncando na raiz do repositório git que você estiver atualmente. +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. -Quando usar a opção de estilo fish pwd, ao invés de esconder o caminho que é truncado, você vai ver um nome encurtado de cada diretório baseado no número que você habilitar para a opção. +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. -Por exemplo, dado `~/Dev/Nix/nixpkgs/pkgs` onde `nixpkgs` é o repositório raiz e a opção esta definida para `1`. Você verá `~/D/N/nixpkgs/pkgs`, enquanto antes seria `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`. ### Opções -| Opções | Padrão | Descrição | -| ------------------- | -------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `truncation_length` | `3` | O número de pastas pais do diretório atual que serão truncadas. | -| `truncate_to_repo` | `true` | Seu diretório será truncado ou não para a raiz do repositório git atual. | -| `format` | `"[$path]($style)[$read_only]($read_only_style) "` | O formato do módulo. | -| `style` | `"bold cyan"` | O estilo do módulo. | -| `disabled` | `false` | Desabilita o módulo `directory`. | -| `read_only` | `"🔒"` | O simbolo que indica que o diretório atual é somente leitura. | -| `read_only_style` | `"red"` | O estilo para o simbolo de somente leitura. | -| `truncation_symbol` | `""` | O simbolo para prefixo de caminhos truncados. ex: "…/" | -| `repo_root_style` | `None` | The style for the root of the git repo when `truncate_to_repo` option is set to false. | -| `home_symbol` | `"~"` | O simbolo para indicar o diretório home. | +| Opções | Padrão | Descrição | +| ------------------- | -------------------------------------------------- | ------------------------------------------------------------------------------------------- | +| `truncation_length` | `3` | O número de pastas pais do diretório atual que serão truncadas. | +| `truncate_to_repo` | `true` | Seu diretório será truncado ou não para a raiz do repositório git atual. | +| `format` | `"[$path]($style)[$read_only]($read_only_style) "` | O formato do módulo. | +| `style` | `"bold cyan"` | O estilo do módulo. | +| `disabled` | `false` | Desabilita o módulo `directory`. | +| `read_only` | `"🔒"` | O simbolo que indica que o diretório atual é somente leitura. | +| `read_only_style` | `"red"` | O estilo para o simbolo de somente leitura. | +| `truncation_symbol` | `""` | O simbolo para prefixo de caminhos truncados. ex: "…/" | +| `repo_root_style` | `None` | O estilo para o repositório git root quando `truncate_to_repo` estiver definido como false. | +| `home_symbol` | `"~"` | O simbolo para indicar o diretório home. | +| `use_os_path_sep` | `true` | Use o separador especifico do SO em vez de sempre usar `/` (ex: `\` no Windows) |
-Este módulo tem algumas configurações avançadas que controlam como o diretório é exibido. +This module has a few advanced configuration options that control how the directory is displayed. -| Advanced Option | Padrão | Descrição | -| --------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `substitutions` | | A table of substitutions to be made to the path. | -| `fish_style_pwd_dir_length` | `0` | The number of characters to use when applying fish shell pwd path logic. | -| `use_logical_path` | `true` | 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. | +| Opções Avançadas | Padrão | Descrição | +| --------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `substituições` | | Uma tabela de substituições para fazer no path. | +| `fish_style_pwd_dir_length` | `0` | O número de caracteres para usar quando aplicado no path logico do fish shell pwd. | +| `use_logical_path` | `true` | Se `true` exibe um caminho lógico originado do shell via `PWD` ou`--logical-path`. Se `false` em vez disso, exibe o caminho do filesystem com os symlinks resolvidos. | `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. @@ -846,9 +859,9 @@ format = "via [🐋 $context](blue bold)" ## Dotnet -O módulo `dotnet` exibe a versão relevante do [.NET Core SDK](https://dotnet.microsoft.com/) para a pasta atual. Se o SDK foi fixado na pasta atual, a versão será exibida. Caso contrario será exibida a ultima versão instalada do 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. -Por padrão o módulo vai apenas exibir no seu prompt quando um ou mais dos seguintes arquivos estiverem presente no diretório: +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: - `global.json` - `project.json` @@ -859,11 +872,11 @@ Por padrão o módulo vai apenas exibir no seu prompt quando um ou mais dos segu - `*.fsproj` - `*.xproj` -Você também precisa do .NET Core SDK instalado para usá-lo corretamente. +You'll also need the .NET Core SDK installed in order to use it correctly. -Internamente, este módulo usa seu próprio mecanismo de detecção de versão. Normalmente é duas vezes mais rápido que executar `dotnet --version`, mas pode exibir uma versão errado se o projeto .NET tiver o layout de diretório incomum. Se a precisão é mais importante que velocidade, você pode desabilitar o mecanismo definindo `heuristic = false` nas opções do modulo. +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. -O módulo também vai exibir o Target Framework Moniker () quando o diretório atual tiver o arquivo csproj. +The module will also show the Target Framework Moniker () when there is a csproj file in the current directory. ### Opções @@ -903,7 +916,7 @@ heuristic = false ## Elixir -O módulo `elixir` exibe a versão instalada do [Elixir](https://elixir-lang.org/) e [Erlang/OTP](https://erlang.org/doc/). Por padrão o módulo vai exibir se uma das condições a seguir for atendida: +The `elixir` module shows the currently installed version of [Elixir](https://elixir-lang.org/) and [Erlang/OTP](https://erlang.org/doc/). Por padrão o módulo vai exibir se uma das condições a seguir for atendida: - O diretório atual contem um arquivo `mix.exs`. @@ -942,7 +955,7 @@ symbol = "🔮 " ## Elm -O módulo `elm` exibe a versão instalada do [Elm](https://elm-lang.org/). Por padrão o módulo vai exibir se uma das condições a seguir for atendida: +The `elm` module shows the currently installed version of [Elm](https://elm-lang.org/). Por padrão o módulo vai exibir se uma das condições a seguir for atendida: - O diretório atual contem um arquivo `elm.json` - O diretório atual contem o arquivo `elm-package.json` @@ -976,21 +989,23 @@ O módulo `elm` exibe a versão instalada do [Elm](https://elm-lang.org/). Por p ### Exemplo ```toml +# ~/.config/starship.toml + [elm] format = "via [ $version](cyan bold) " ``` ## Variáveis de Ambiente -O módulo `env_var` exibe o valor atual de uma variável de ambiente selecionada. O módulo vai exibir somente se algumas das condições a seguir for atendida: +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: - A opção de configuração da `variable` corresponde a uma variável existente - A configuração `variable` não está definida, mas a `default` está -::: tip Varias variáveis podem ser exibidas usando um `.`. (Veja o exemplo) se a configuração `variable` não é definida, o módulo irá exibir o valor da variável após o caractere `.`. +::: 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. -Exemplo: a configuração a seguir irá mostrar o valor da variável de ambiente USER +Example: following configuration will display value of USER environment variable ```toml # ~/.config/starship.toml @@ -1029,7 +1044,7 @@ variable = "SHELL" default = "unknown shell" ``` -Exibindo múltiplas variáveis de ambiente: +Displaying multiple environmental variables: ```toml # ~/.config/starship.toml @@ -1042,7 +1057,7 @@ default = "unknown user" ## Erlang -O módulo de `erlang` exibe a versão atual instalada do [Erlang/OTP](https://erlang.org/doc/). Por padrão o módulo vai exibir se uma das condições a seguir for atendida: +The `erlang` module shows the currently installed version of [Erlang/OTP](https://erlang.org/doc/). Por padrão o módulo vai exibir se uma das condições a seguir for atendida: - O diretório atual contem um arquivo `rebar.config`. - O diretório atual contem um arquivo `erlang.mk`. @@ -1085,11 +1100,11 @@ The `fill` module fills any extra space on the line with a symbol. If multiple ` ### Opções -| Opções | Padrão | Descrição | -| ---------- | -------------- | --------------------------------- | -| `symbol` | `"."` | The symbol used to fill the line. | -| `style` | `"bold black"` | O estilo do módulo. | -| `disabled` | `false` | Disables the `fill` module | +| Opções | Padrão | Descrição | +| ---------- | -------------- | --------------------------------------- | +| `symbol` | `"."` | O simbolo usado para preencher a linha. | +| `style` | `"bold black"` | O estilo do módulo. | +| `disabled` | `false` | Desabilita o módulo `fill` | ### Exemplo @@ -1111,7 +1126,7 @@ AA -------------------------------------------- BB ----------------------------- ## Google Cloud (`gcloud`) -O módulo `gcloud` exibe a configuração atual para o [`gcloud`](https://cloud.google.com/sdk/gcloud) CLI. Isto é baseadp mp arquivo `~/.config/gcloud/active_config` e no arquivo`~/.config/gcloud/configurations/config_{CONFIG NAME}` e a env var `CLOUDSDK_CONFIG`. +The `gcloud` module shows the current configuration for [`gcloud`](https://cloud.google.com/sdk/gcloud) CLI. This is based on the `~/.config/gcloud/active_config` file and the `~/.config/gcloud/configurations/config_{CONFIG NAME}` file and the `CLOUDSDK_CONFIG` env var. ### Opções @@ -1172,7 +1187,7 @@ asia-northeast1 = "an1" ## Git Branch -O módulo `git_branch` exibe o branch ativo do repositório no diretório atual. +The `git_branch` module shows the active branch of the repo in your current directory. ### Opções @@ -1212,7 +1227,7 @@ truncation_symbol = "" ## Git commit -O módulo `git_commit` exibe o hash do comiit atual e também a tag (se existir) do repositório no diretório atual. +The `git_commit` module shows the current commit hash and also the tag (if any) of the repo in your current directory. ### Opções @@ -1247,7 +1262,7 @@ tag_symbol = "🔖 " ## Git State -O módulo `git_state` vai exibir nos diretorios que fazem parte de um repositorio git e onde existe uma operação em progresso, como: _REBASING_, _BISECTING_, etc. Se houver informação de progresso (e.x: REBASING 3/10). esta informação será exibida também. +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. ### Opções @@ -1287,11 +1302,11 @@ cherry_pick = "[🍒 PICKING](bold red)" ## Git Metrics -O módulo `git_metrics` vai exibir o número de adições e exclusões de linhas no repositório git atual. +The `git_metrics` module will show the number of added and deleted lines in the current git repository. ::: tip -Este módulo é desativado por padrão. Para ativa-lo, defina `disabled` para `false` no seu arquivo de configuração. +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: @@ -1328,30 +1343,31 @@ format = '[+$added]($added_style)/[-$deleted]($deleted_style) ' ## Git Status -O módulo `git_status` exibe o simbolo que representa o estado do repositório no diretório atual. +The `git_status` module shows symbols representing the state of the repo in your current directory. ### Opções -| Opções | Padrão | Descrição | -| ------------ | ----------------------------------------------- | ---------------------------------- | -| `format` | `'([\[$all_status$ahead_behind\]]($style) )'` | O formato padrão para `git_status` | -| `conflicted` | `"="` | Este braço tem conflitos. | -| `ahead` | `"⇡"` | O formato do `ahead` | -| `behind` | `"⇣"` | O formato do `behind` | -| `diverged` | `"⇕"` | O formato do `diverged` | -| `up_to_date` | `""` | O formato do `up_to_date` | -| `untracked` | `"?"` | O formato do `untracked` | -| `stashed` | `"$"` | O formato do `stashed` | -| `modified` | `"!"` | O formato do `modified` | -| `staged` | `"+"` | O formato do `staged` | -| `renamed` | `"»"` | O formato do `renamed` | -| `deleted` | `"✘"` | O formato do `deleted` | -| `style` | `"bold red"` | O estilo do módulo. | -| `disabled` | `false` | Desabilita o módulo `git_status`. | +| Opções | Padrão | Descrição | +| ------------------- | ----------------------------------------------- | ----------------------------------- | +| `format` | `'([\[$all_status$ahead_behind\]]($style) )'` | O formato padrão para `git_status` | +| `conflicted` | `"="` | Este braço tem conflitos. | +| `ahead` | `"⇡"` | O formato do `ahead` | +| `behind` | `"⇣"` | O formato do `behind` | +| `diverged` | `"⇕"` | O formato do `diverged` | +| `up_to_date` | `""` | O formato do `up_to_date` | +| `untracked` | `"?"` | O formato do `untracked` | +| `stashed` | `"$"` | O formato do `stashed` | +| `modified` | `"!"` | O formato do `modified` | +| `staged` | `"+"` | O formato do `staged` | +| `renamed` | `"»"` | O formato do `renamed` | +| `deleted` | `"✘"` | O formato do `deleted` | +| `style` | `"bold red"` | O estilo do módulo. | +| `ignore_submodules` | `false` | Ignora as alterações de submódulos. | +| `disabled` | `false` | Desabilita o módulo `git_status`. | ### Variáveis -As variáveis a seguir podem ser usadas no `format`: +The following variables can be used in `format`: | Variável | Descrição | | -------------- | ---------------------------------------------------------------------------------------------------------- | @@ -1368,14 +1384,14 @@ As variáveis a seguir podem ser usadas no `format`: \*: Essa variável só pode ser usada como parte de uma string de estilo -As variáveis a seguir podem ser usadas em `diverged`: +The following variables can be used in `diverged`: | Variável | Descrição | | -------------- | --------------------------------------------------- | | `ahead_count` | Número de commits a frente do braço de rastreamento | | `behind_count` | Número de commits atrás do braço de rastreamento | -As variaveis a seguir podem ser usadas em `conflicted`, `ahead`, `behind`, `untracked`, `stashed`, `modified`, `staged`, `renamed` e `deleted`: +The following variables can be used in `conflicted`, `ahead`, `behind`, `untracked`, `stashed`, `modified`, `staged`, `renamed` and `deleted`: | Variável | Descrição | | -------- | -------------------------- | @@ -1400,7 +1416,7 @@ renamed = "👅" deleted = "🗑" ``` -Exibe o count a frente/atrás do braço que esta sendo rastreado +Show ahead/behind count of the branch being tracked ```toml # ~/.config/starship.toml @@ -1458,7 +1474,7 @@ format = "via [🏎💨 $version](bold cyan) " ## Helm -O módulo `helm` exibe a versão atual instalada do [Helm](https://helm.sh/). Por padrão o módulo vai exibir se uma das condições a seguir for atendida: +The `helm` module shows the currently installed version of [Helm](https://helm.sh/). Por padrão o módulo vai exibir se uma das condições a seguir for atendida: - O diretório atual contem um arquivo `helmfile.yaml` - O diretório atual contem um arquivo `Chart.yaml` @@ -1497,7 +1513,7 @@ format = "via [⎈ $version](bold white) " ## Hostname -O módulo `hostname` exibe o nome do hostname. +The `hostname` module shows the system hostname. ### Opções @@ -1511,10 +1527,10 @@ O módulo `hostname` exibe o nome do hostname. ### Variáveis -| Variável | Exemplo | Descrição | -| --------- | ------- | ---------------------------------- | -| symbol | | Espelha o valor da opção `símbolo` | -| style\* | | Espelha o valor da opção `style` | +| Variável | Exemplo | Descrição | +| --------- | ---------- | -------------------------------- | +| hostname | `computer` | O hostname do computador | +| style\* | | Espelha o valor da opção `style` | \*: Essa variável só pode ser usada como parte de uma string de estilo @@ -1532,7 +1548,7 @@ disabled = false ## Java -O módulo `java` exibe o versão atual instalada do [Java](https://www.oracle.com/java/). Por padrão o módulo vai exibir se uma das condições a seguir for atendida: +The `java` module shows the currently installed version of [Java](https://www.oracle.com/java/). Por padrão o módulo vai exibir se uma das condições a seguir for atendida: - O diretório atual contenha algum dos arquivos `pom.xml`, `build.gradle.kts`, `build.sbt`, `.java-version`, `.deps.edn`, `project.clj`, or `build.boot` - O diretório atual contenha arquivos com as extensões `.java`, `.class`, `.gradle`, `.jar`, `.clj`, or `.cljc` @@ -1571,9 +1587,9 @@ symbol = "🌟 " ## Jobs -O módulo `jobs` exibe o número atual de jobs rodando. O módulo vai ser exibido apenas se existir jobs em segundo plano sendo executados. O módulo vai exibir o número de jobs rodando se ao menos tiver 2 jobs ou mais que o valor da configuração `number_threshold`, se existir. O módulo vai exibir um simbolo se tiver ao menos 1 job ou mais, se o valor da configuração `symbol_threshold` existir. Você pode setar os dois valores para 0 para *sempre* exibir o simbolo e número de jobs, mesmo que seja 0 os jobs em execução. +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. -A funcionalidade padrão é: +The default functionality is: - 0 jobs -> Nada é exibido. - 1 job -> `symbol` é exibido. @@ -1581,13 +1597,13 @@ A funcionalidade padrão é: ::: warning -Este módulo não é suportado em tcsh e nu. +This module is not supported on tcsh and nu. ::: ::: warning -A opção `threshold` está obsoleta, mas se você quiser usa-la, o módulo vai exibir o numero de jobs rodando se for maior que 1 ou maior que o valor configurado na `threshold`, se ele existir. Se o valor `threshold` for definido como 0, então o módulo vai exibir quando tiver 0 jobs rodando. +The `threshold` option is deprecated, but if you want to use it, the module will show the number of jobs running if there is more than 1 job, or more than the `threshold` config value, if it exists. If `threshold` is set to 0, then the module will also show when there are 0 jobs running. ::: @@ -1602,9 +1618,9 @@ A opção `threshold` está obsoleta, mas se você quiser usa-la, o módulo vai | `symbol` | `"✦"` | A string usada para representar a variável `symbol`. | | `style` | `"bold blue"` | O estilo do módulo. | | `disabled` | `false` | Desabilita o módulo `jobs`. | - \*: Esta opção está obsoleta, por favor use o + \*: This option is deprecated, please use the -`number_threshold` e `symbol_threshold` em vez disso. +`number_threshold` and `symbol_threshold` options instead. ### Variáveis @@ -1629,7 +1645,7 @@ symbol_threshold = 0 ## Julia -O módulo `julia` exibe a versão atual instalada do [Julia](https://julialang.org/). Por padrão o módulo vai exibir se uma das condições a seguir for atendida: +The `julia` module shows the currently installed version of [Julia](https://julialang.org/). Por padrão o módulo vai exibir se uma das condições a seguir for atendida: - O diretório atual contem um arquivo `Project.toml` - O diretório atual contem um arquivo `Manifest.toml` @@ -1669,7 +1685,7 @@ symbol = "∴ " ## Kotlin -O módulo `kotlin` exibie a versão atual instalada do [Kotlin](https://kotlinlang.org/). Por padrão o módulo vai exibir se uma das condições a seguir for atendida: +The `kotlin` module shows the currently installed version of [Kotlin](https://kotlinlang.org/). Por padrão o módulo vai exibir se uma das condições a seguir for atendida: - O diretório atual contem um arquivo `.kt` ou um arquivo `.kts` @@ -1720,19 +1736,19 @@ Displays the current [Kubernetes context](https://kubernetes.io/docs/concepts/co ::: tip -Este módulo é desativado por padrão. Para ativa-lo, defina `disabled` para `false` no seu arquivo de configuração. +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: ### Opções -| Opções | Padrão | Descrição | -| ----------------- | ---------------------------------------------------- | --------------------------------------------------------------------- | -| `symbol` | `"☸ "` | A format string representing the symbol displayed before the Cluster. | -| `format` | `'[$symbol$context( \($namespace\))]($style) in '` | O formato do módulo. | -| `style` | `"cyan bold"` | O estilo do módulo. | -| `context_aliases` | | Tabela de aliases de contexto para exibir. | -| `disabled` | `true` | Desabilita o módulo `kubernetes`. | +| Opções | Padrão | Descrição | +| ----------------- | ---------------------------------------------------- | ------------------------------------------------------------- | +| `symbol` | `"☸ "` | Uma string que representa o simbolo exibido antes do Cluster. | +| `format` | `'[$symbol$context( \($namespace\))]($style) in '` | O formato do módulo. | +| `style` | `"cyan bold"` | O estilo do módulo. | +| `context_aliases` | | Tabela de aliases de contexto para exibir. | +| `disabled` | `true` | Desabilita o módulo `kubernetes`. | ### Variáveis @@ -1759,7 +1775,7 @@ disabled = false "gke_.*_(?P[\\w-]+)" = "gke-$cluster" ``` -#### Regex Matching +#### Correspondência Regex Additional to simple aliasing, `context_aliases` also supports extended matching and renaming using regular expressions. @@ -1782,7 +1798,7 @@ Long and automatically generated cluster names can be identified and shortened u ## Quebra de linha -O módulo `line_break` separa o prompt em duas linhas. +The `line_break` module separates the prompt into two lines. ### Opções @@ -1803,9 +1819,9 @@ disabled = true The `lua` module shows the currently installed version of [Lua](http://www.lua.org/). Por padrão o módulo vai exibir se uma das condições a seguir for atendida: -- The current directory contains a `.lua-version` file -- The current directory contains a `lua` directory -- The current directory contains a file with the `.lua` extension +- O diretório atual contém um arquivo `.lua-version` +- O diretório atual contém um diretório `lua` +- O diretório atual tem um arquivo com a extensão `.lua` ### Opções @@ -1813,19 +1829,19 @@ The `lua` module shows the currently installed version of [Lua](http://www.lua.o | ------------------- | ------------------------------------ | ------------------------------------------------------------------------------------ | | `format` | `"via [$symbol($version )]($style)"` | O formato do módulo. | | `version_format` | `"v${raw}"` | O formato da versão. As variáveis disponíveis são `raw`, `major`, `minor`, & `patch` | -| `symbol` | `"🌙 "` | A format string representing the symbol of Lua. | +| `symbol` | `"🌙 "` | Uma string que representa o simbolo do Lua. | | `detect_extensions` | `["lua"]` | Quais extensões devem ativar este módulo. | | `detect_files` | `[".lua-version"]` | Quais nomes de arquivos devem ativar este módulo. | | `detect_folders` | `["lua"]` | Quais pastas devem ativar este módulo. | | `style` | `"bold blue"` | O estilo do módulo. | -| `lua_binary` | `"lua"` | Configures the lua binary that Starship executes when getting the version. | -| `disabled` | `false` | Disables the `lua` module. | +| `lua_binary` | `"lua"` | Configura o binário lua que o Starship executa para pegar a versão. | +| `disabled` | `false` | Desabilita o módulo `lua`. | ### Variáveis | Variável | Exemplo | Descrição | | --------- | -------- | ---------------------------------- | -| version | `v5.4.0` | The version of `lua` | +| version | `v5.4.0` | A versão do `lua` | | symbol | | Espelha o valor da opção `símbolo` | | style\* | | Espelha o valor da opção `style` | @@ -1848,30 +1864,42 @@ By default the swap usage is displayed if the total system swap is non-zero. ::: tip -Este módulo é desativado por padrão. Para ativa-lo, defina `disabled` para `false` no seu arquivo de configuração. +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: ### Opções -| Opções | Padrão | Descrição | -| ----------- | ----------------------------------------------- | -------------------------------------------------------- | -| `threshold` | `75` | Hide the memory usage unless it exceeds this percentage. | -| `format` | `"via $symbol [${ram}( \| ${swap})]($style) "` | O formato do módulo. | -| `symbol` | `"🐏"` | The symbol used before displaying the memory usage. | -| `style` | `"bold dimmed white"` | O estilo do módulo. | -| `disabled` | `true` | Disables the `memory_usage` module. | +| Opções | Padrão | Descrição | +| ---------------- | ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `threshold` | `75` | Esconde o uso de memoria a menos que exceda esta porcentagem. | +| `format` | `"via $symbol [${ram}( \| ${swap})]($style) "` | O formato do módulo. | +| `symbol` | `"🐏"` | O simbolo usado antes de exibir o uso de memoria. | +| `style` | `"bold dimmed white"` | O estilo do módulo. | +| `disabled` | `true` | Desabilita o módulo `memory_usage + + + -### Variáveis +

Variáveis

-| Variável | Exemplo | Descrição | -| ---------------- | ------------- | ------------------------------------------------------------------ | -| ram | `31GiB/65GiB` | The usage/total RAM of the current system memory. | -| ram_pct | `48%` | The percentage of the current system memory. | -| swap\*\* | `1GiB/4GiB` | The swap memory size of the current system swap memory file. | -| swap_pct\*\* | `77%` | The swap memory percentage of the current system swap memory file. | -| symbol | `🐏` | Espelha o valor da opção `símbolo` | -| style\* | | Espelha o valor da opção `style` | + + + + + + + + + + + +
VariávelExemploDescrição
ram31GiB/65GiB` | O uso/total de memoria RAM atual do sistema. | +| ram_pct | `48%` | A porcentagem de uso atual da memoria do sistema. | +| swap\*\* | `1GiB/4GiB` | O tamanho atual do swap do sistema. | +| swap_pct\*\* | `77%` | A porcentagem atual de uso do swap. | +| symbol | `🐏` | Espelha o valor da opção `símbolo` | +| style\* | | Espelha o valor da opção `style` | \*: This variable can only be used as a part of a style string \*\*: The SWAP file information is only displayed if detected on the current system @@ -1893,20 +1921,20 @@ The `hg_branch` module shows the active branch of the repo in your current direc ### Opções -| Opções | Padrão | Descrição | -| ------------------- | -------------------------------- | -------------------------------------------------------------------------------------------- | -| `symbol` | `" "` | The symbol used before the hg bookmark or branch name of the repo in your current directory. | -| `style` | `"bold purple"` | O estilo do módulo. | -| `format` | `"on [$symbol$branch]($style) "` | O formato do módulo. | -| `truncation_length` | `2^63 - 1` | Truncates the hg branch name to `N` graphemes | -| `truncation_symbol` | `"…"` | O simbolo usado para indicar que o nome braço foi truncado. | -| `disabled` | `true` | Disables the `hg_branch` module. | +| Opções | Padrão | Descrição | +| ------------------- | -------------------------------- | --------------------------------------------------------------------------------------- | +| `symbol` | `" "` | O simbolo usado ante do marcador hg ou nome do braço do repositório no diretório atual. | +| `style` | `"bold purple"` | O estilo do módulo. | +| `format` | `"on [$symbol$branch]($style) "` | O formato do módulo. | +| `truncation_length` | `2^63 - 1` | Trunca o nome do braço hg para `N` caracteres | +| `truncation_symbol` | `"…"` | O simbolo usado para indicar que o nome braço foi truncado. | +| `disabled` | `true` | Desabilita o módulo `hg_branch`. | ### Variáveis | Variável | Exemplo | Descrição | | --------- | -------- | ---------------------------------- | -| branch | `master` | The active mercurial branch | +| branch | `master` | O braço mercurial ativo | | symbol | | Espelha o valor da opção `símbolo` | | style\* | | Espelha o valor da opção `style` | @@ -1928,9 +1956,9 @@ truncation_symbol = "" The `nim` module shows the currently installed version of [Nim](https://nim-lang.org/). Por padrão o módulo vai exibir se uma das condições a seguir for atendida: - O diretório atual contem um arquivo `nim.cfg` -- The current directory contains a file with the `.nim` extension -- The current directory contains a file with the `.nims` extension -- The current directory contains a file with the `.nimble` extension +- O diretório atual tenha um arquivo com a extensão `.nim` +- O diretório atual tenha um arquivo com a extensão `.nims` +- O diretório atual tenha um arquivo com a extensão `.nimble` ### Opções @@ -1938,18 +1966,18 @@ The `nim` module shows the currently installed version of [Nim](https://nim-lang | ------------------- | ------------------------------------ | ------------------------------------------------------------------------------------ | | `format` | `"via [$symbol($version )]($style)"` | O formato do módulo | | `version_format` | `"v${raw}"` | O formato da versão. As variáveis disponíveis são `raw`, `major`, `minor`, & `patch` | -| `symbol` | `"👑 "` | The symbol used before displaying the version of Nim. | +| `symbol` | `"👑 "` | O simbolo usado antes de exibir a versão do Nim. | | `detect_extensions` | `["nim", "nims", "nimble"]` | Quais extensões devem ativar este módulo. | | `detect_files` | `["nim.cfg"]` | Quais nomes de arquivos devem ativar este módulo. | | `detect_folders` | `[]` | Quais pastas devem ativar este módulo. | | `style` | `"bold yellow"` | O estilo do módulo. | -| `disabled` | `false` | Disables the `nim` module. | +| `disabled` | `false` | Desabilita o módulo `nim`. | ### Variáveis | Variável | Exemplo | Descrição | | --------- | -------- | ---------------------------------- | -| version | `v1.2.0` | The version of `nimc` | +| version | `v1.2.0` | A versão do `nimc` | | symbol | | Espelha o valor da opção `símbolo` | | style\* | | Espelha o valor da opção `style` | @@ -1971,21 +1999,21 @@ The `nix_shell` module shows the [nix-shell](https://nixos.org/guides/nix-pills/ ### Opções -| Opções | Padrão | Descrição | -| ------------ | ---------------------------------------------- | ----------------------------------------------------- | -| `format` | `'via [$symbol$state( \($name\))]($style) '` | O formato do módulo. | -| `symbol` | `"❄️ "` | A format string representing the symbol of nix-shell. | -| `style` | `"bold blue"` | O estilo do módulo. | -| `impure_msg` | `"impure"` | A format string shown when the shell is impure. | -| `pure_msg` | `"pure"` | A format string shown when the shell is pure. | -| `disabled` | `false` | Disables the `nix_shell` module. | +| Opções | Padrão | Descrição | +| ------------ | ---------------------------------------------- | ------------------------------------------------- | +| `format` | `'via [$symbol$state( \($name\))]($style) '` | O formato do módulo. | +| `symbol` | `"❄️ "` | Uma string que representa o simbolo do nix-shell. | +| `style` | `"bold blue"` | O estilo do módulo. | +| `impure_msg` | `"impure"` | Uma string que exibe quando o shell é impuro. | +| `pure_msg` | `"pure"` | Uma string que exibe quando o shell é puro. | +| `disabled` | `false` | Desabilita o módulo `nix_shell`. | ### Variáveis | Variável | Exemplo | Descrição | | --------- | ------- | ---------------------------------- | -| state | `pure` | The state of the nix-shell | -| name | `lorri` | The name of the nix-shell | +| state | `pure` | O estado do nix-shell | +| name | `lorri` | O nome do nix-shell | | symbol | | Espelha o valor da opção `símbolo` | | style\* | | Espelha o valor da opção `style` | @@ -2008,31 +2036,31 @@ format = 'via [☃️ $state( \($name\))](bold blue) ' The `nodejs` module shows the currently installed version of [Node.js](https://nodejs.org/). Por padrão o módulo vai exibir se uma das condições a seguir for atendida: - O diretório atual contem o arquivo `package.json` -- The current directory contains a `.node-version` file -- The current directory contains a `.nvmrc` file -- 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 `.ts` extension +- O diretório atual tenha um arquivo `.node-version` +- O diretório atual tenha um arquivo`.nvmrc` +- O diretório atual tenha um diretório `node_modules` +- O diretório atual tenha um arquivo com a extensão `.js`, `.mjs` or `.cjs` +- O diretório atual tenha um arquivo com a extensão `.ts` ### Opções -| Opções | Padrão | Descrição | -| ------------------- | ------------------------------------ | ----------------------------------------------------------------------------------------------------- | -| `format` | `"via [$symbol($version )]($style)"` | O formato do módulo. | -| `version_format` | `"v${raw}"` | O formato da versão. As variáveis disponíveis são `raw`, `major`, `minor`, & `patch` | -| `symbol` | `" "` | A format string representing the symbol of Node.js. | -| `detect_extensions` | `["js", "mjs", "cjs", "ts"]` | Quais extensões devem ativar este módulo. | -| `detect_files` | `["package.json", ".node-version"]` | Quais nomes de arquivos devem ativar este módulo. | -| `detect_folders` | `["node_modules"]` | Quais pastas devem ativar este módulo. | -| `style` | `"bold green"` | O estilo do módulo. | -| `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. | +| Opções | Padrão | Descrição | +| ------------------- | ------------------------------------ | -------------------------------------------------------------------------------------------------------- | +| `format` | `"via [$symbol($version )]($style)"` | O formato do módulo. | +| `version_format` | `"v${raw}"` | O formato da versão. As variáveis disponíveis são `raw`, `major`, `minor`, & `patch` | +| `symbol` | `" "` | Uma string que representa o simbolo do Node.js. | +| `detect_extensions` | `["js", "mjs", "cjs", "ts"]` | Quais extensões devem ativar este módulo. | +| `detect_files` | `["package.json", ".node-version"]` | Quais nomes de arquivos devem ativar este módulo. | +| `detect_folders` | `["node_modules"]` | Quais pastas devem ativar este módulo. | +| `style` | `"bold green"` | O estilo do módulo. | +| `disabled` | `false` | Desabilita o módulo `nodejs`. | +| `not_capable_style` | `bold red` | O estilo para o módulo quando a propriedade engine no package.json não coincide com a versão do Node.js. | ### Variáveis | Variável | Exemplo | Descrição | | --------- | ---------- | ---------------------------------- | -| version | `v13.12.0` | The version of `node` | +| version | `v13.12.0` | A versão do `node` | | symbol | | Espelha o valor da opção `símbolo` | | style\* | | Espelha o valor da opção `style` | @@ -2051,37 +2079,37 @@ format = "via [🤖 $version](bold green) " The `ocaml` module shows the currently installed version of [OCaml](https://ocaml.org/). Por padrão o módulo vai exibir se uma das condições a seguir for atendida: -- The current directory contains a file with `.opam` extension or `_opam` directory -- The current directory contains a `esy.lock` directory -- The current directory contains a `dune` or `dune-project` file -- The current directory contains a `jbuild` or `jbuild-ignore` file -- The current directory contains a `.merlin` file -- The current directory contains a file with `.ml`, `.mli`, `.re` or `.rei` extension +- O diretório atual contenha um arquivo com a extensão`.opam` ou um diretório `_opam` +- O diretório atual tenha um diretório `esy.lock` +- O diretório atual tenha um arquivo `dune` or `dune-project` +- O diretório atual tenha um arquivo `jbuild` or `jbuild-ignore` +- O diretório tenha um arquivo `.merlin` +- O diretório atual tenha um arquivo com a extensão `.ml`, `.mli`, `.re` ou `.rei` ### Opções | Opções | Padrão | Descrição | | ------------------------- | -------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ | -| `format` | `"via [$symbol($version )(\($switch_indicator$switch_name\) )]($style)"` | The format string for the module. | +| `format` | `"via [$symbol($version )(\($switch_indicator$switch_name\) )]($style)"` | A string de formato do módulo. | | `version_format` | `"v${raw}"` | O formato da versão. As variáveis disponíveis são `raw`, `major`, `minor`, & `patch` | -| `symbol` | `"🐫 "` | The symbol used before displaying the version of OCaml. | -| `global_switch_indicator` | `""` | The format string used to represent global OPAM switch. | -| `local_switch_indicator` | `"*"` | The format string used to represent local OPAM switch. | +| `symbol` | `"🐫 "` | O simbolo usado antes de exibir a versão do OCaml. | +| `global_switch_indicator` | `""` | A string usada para representar a mudança global OPAM. | +| `local_switch_indicator` | `"*"` | A string usada para representar as mudanças locais do OPAM. | | `detect_extensions` | `["opam", "ml", "mli", "re", "rei"]` | Quais extensões devem ativar este módulo. | | `detect_files` | `["dune", "dune-project", "jbuild", "jbuild-ignore", ".merlin"]` | Quais nomes de arquivos devem ativar este módulo. | | `detect_folders` | `["_opam", "esy.lock"]` | Quais pastas devem ativar este módulo. | | `style` | `"bold yellow"` | O estilo do módulo. | -| `disabled` | `false` | Disables the `ocaml` module. | +| `disabled` | `false` | Desabilita o módulo `ocaml`. | ### Variáveis -| Variável | Exemplo | Descrição | -| ---------------- | ------------ | ----------------------------------------------------------------- | -| version | `v4.10.0` | The version of `ocaml` | -| switch_name | `my-project` | The active OPAM switch | -| switch_indicator | | Mirrors the value of `indicator` for currently active OPAM switch | -| symbol | | Espelha o valor da opção `símbolo` | -| style\* | | Espelha o valor da opção `style` | +| Variável | Exemplo | Descrição | +| ---------------- | ------------ | ---------------------------------------------------------------- | +| version | `v4.10.0` | A versão do `ocaml` | +| switch_name | `my-project` | O switch OPAM ativo | +| switch_indicator | | Espelha o valor do `indicator` para o switch ativo atual do OPAM | +| symbol | | Espelha o valor da opção `símbolo` | +| style\* | | Espelha o valor da opção `style` | \*: Essa variável só pode ser usada como parte de uma string de estilo @@ -2100,19 +2128,19 @@ The `openstack` module shows the current OpenStack cloud and project. The module ### Opções -| Opções | Padrão | Descrição | -| ---------- | --------------------------------------------------- | -------------------------------------------------------------- | -| `format` | `"on [$symbol$cloud(\\($project\\))]($style) "` | O formato do módulo. | -| `symbol` | `"☁️ "` | The symbol used before displaying the current OpenStack cloud. | -| `style` | `"bold yellow"` | O estilo do módulo. | -| `disabled` | `false` | Disables the `openstack` module. | +| Opções | Padrão | Descrição | +| ---------- | --------------------------------------------------- | ---------------------------------------------------- | +| `format` | `"on [$symbol$cloud(\\($project\\))]($style) "` | O formato do módulo. | +| `symbol` | `"☁️ "` | O simbolo usado para exibir o OpenStack cloud atual. | +| `style` | `"bold yellow"` | O estilo do módulo. | +| `disabled` | `false` | Desabilita o módulo `openstack`. | ### Variáveis | Variável | Exemplo | Descrição | | --------- | ------- | ---------------------------------- | -| cloud | `corp` | The current OpenStack cloud | -| project | `dev` | The current OpenStack project | +| cloud | `corp` | O OpenStack cloud atual | +| project | `dev` | O projeto OpenStack atual | | symbol | | Espelha o valor da opção `símbolo` | | style\* | | Espelha o valor da opção `style` | @@ -2129,44 +2157,45 @@ style = "bold yellow" symbol = "☁️ " ``` -## Package Version +## Versionamento de Pacotes -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. +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`, `shards` and `dart` packages. -- [**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 -- [**Nimble**](https://github.com/nim-lang/nimble) - The `nimble` package version is extracted from the `*.nimble` file present in the current directory with the `nimble dump` command -- [**Poetry**](https://python-poetry.org/) – The `poetry` package version is extracted from the `pyproject.toml` present in the current directory -- [**Python**](https://www.python.org) - The `python` package version is extracted from the `setup.cfg` present in the current directory -- [**Composer**](https://getcomposer.org/) – The `composer` package version is extracted from the `composer.json` present in the current directory -- [**Gradle**](https://gradle.org/) – The `gradle` package version is extracted from the `build.gradle` present -- [**Julia**](https://docs.julialang.org/en/v1/stdlib/Pkg/) - The package version is extracted from the `Project.toml` present -- [**Mix**](https://hexdocs.pm/mix/) - The `mix` package version is extracted from the `mix.exs` present -- [**Helm**](https://helm.sh/docs/helm/helm_package/) - The `helm` chart version is extracted from the `Chart.yaml` present -- [**Maven**](https://maven.apache.org/) - The `maven` package version is extracted from the `pom.xml` 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 -- [**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 +- [**npm**](https://docs.npmjs.com/cli/commands/npm) – O versionamento de pacotes `npm` é extraído do `package.json` presente no diretório atual +- [**Cargo**](https://doc.rust-lang.org/cargo/) – O versionamento de pacotes `cargo`é extraído do arquivo `Cargo.toml` presente no diretório atual +- [**Nimble**](https://github.com/nim-lang/nimble) - O versionamento de pacotes `nimble` é extraído do arquivo `*.nimble` presente no diretório atual com o comando`nimble dump` +- [**Poetry**](https://python-poetry.org/) – O versionamento de pacotes `poetry` é extraído do arquivo `pyproject.toml` presente no diretório atual +- [**Python**](https://www.python.org) - O versionamento de pacotes `python` é extraído do arquivo `setup.cfg` presente no diretório atual +- [**Composer**](https://getcomposer.org/) – O versionamento de pacotes `composer` é extraído do arquivo`composer.json` presente no diretório atual +- [**Gradle**](https://gradle.org/) – O versionamento de pacotes `gradle` é extraído do arquivo `build.gradle` presente no diretório atual +- [**Julia**](https://docs.julialang.org/en/v1/stdlib/Pkg/) - O versionamento de pacotes é extraído do arquivo `Project.toml` presente no diretório atual +- [**Mix**](https://hexdocs.pm/mix/) - O versionamento de pacotes `mix`é extraído do arquivo `mix.exs` presente no diretório atual +- [**Helm**](https://helm.sh/docs/helm/helm_package/) - O versionamento do gráfico `helm` é extraído do arquivo `Chart.yaml` presente no diretório atual +- [**Maven**](https://maven.apache.org/) - O versionamento de pacotes `maven` é extraído do arquivo`pom.xml` presente no diretório atual +- [**Meson**](https://mesonbuild.com/) - O versionamento de pacotes `meson` é extraído do arquivo`meson.build` presente no diretório atual +- [**Shards**](https://crystal-lang.org/reference/the_shards_command/index.html) - O versionamento de pacotes `shards` é extraído do arquivo `shard.yml` presente no diretório atual +- [**V**](https://vlang.io) - O versionamento de pacotes `vlang` é extraido do arquivo`v.mod` presente no diretório atual +- [**SBT**](https://scala-sbt.org) - O versionamento de pacotes `sbt` pé extraído do arquivo `build.sbt` presente no diretório atual +- [**Dart**](https://pub.dev/) - O versionamento de pacotes `dart` pé extraído do arquivo `pubspec.yaml` presente no diretório atual -> ⚠️ The version being shown is that of the package whose source code is in your current directory, not your package manager. +> ⚠️ A versão exibida é a que esta presente no código fonte do diretório atual e não do gerenciador de pacotes. ### Opções | Opções | Padrão | Descrição | | ----------------- | --------------------------------- | ------------------------------------------------------------------------------------ | | `format` | `"is [$symbol$version]($style) "` | O formato do módulo. | -| `symbol` | `"📦 "` | The symbol used before displaying the version the package. | +| `symbol` | `"📦 "` | O simbolo usado antes de exibir a versão do pacote. | | `version_format` | `"v${raw}"` | O formato da versão. As variáveis disponíveis são `raw`, `major`, `minor`, & `patch` | | `style` | `"bold 208"` | O estilo do módulo. | -| `display_private` | `false` | Enable displaying version for packages marked as private. | -| `disabled` | `false` | Disables the `package` module. | +| `display_private` | `false` | Habilita a exibição da versão para os pacotes marcados como privado. | +| `disabled` | `false` | Desabilita o módulo `package`. | ### Variáveis | Variável | Exemplo | Descrição | | --------- | -------- | ---------------------------------- | -| version | `v1.0.0` | The version of your package | +| version | `v1.0.0` | A versão do seu pacote | | symbol | | Espelha o valor da opção `símbolo` | | style\* | | Espelha o valor da opção `style` | @@ -2185,30 +2214,30 @@ format = "via [🎁 $version](208 bold) " The `perl` module shows the currently installed version of [Perl](https://www.perl.org/). Por padrão o módulo vai exibir se uma das condições a seguir for atendida: -- The current directory contains a `Makefile.PL` or `Build.PL` file -- The current directory contains a `cpanfile` or `cpanfile.snapshot` file -- The current directory contains a `META.json` file or `META.yml` file -- The current directory contains a `.perl-version` file -- The current directory contains a `.pl`, `.pm` or `.pod` +- O diretório atual tanha um aquivo `Makefile.PL` ou `Build.PL` +- O diretório atual tenha um arquivo `cpanfile` ou `cpanfile.snapshot` +- O diretório atual tenha um arquivo `META.json` ou `META.yml` +- O diretório atual tenha um arquivo `.perl-version` +- O diretório atual tenha um `.pl`, `.pm` ou `.pod` ### Opções | Opções | Padrão | Descrição | | ------------------- | -------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ | -| `format` | `"via [$symbol($version )]($style)"` | The format string for the module. | +| `format` | `"via [$symbol($version )]($style)"` | A string de formato do módulo. | | `version_format` | `"v${raw}"` | O formato da versão. As variáveis disponíveis são `raw`, `major`, `minor`, & `patch` | -| `symbol` | `"🐪 "` | The symbol used before displaying the version of Perl | +| `symbol` | `"🐪 "` | O simbolo usado ante de exibir a versão do Perl | | `detect_extensions` | `["pl", "pm", "pod"]` | Quais extensões devem ativar este módulo. | | `detect_files` | `["Makefile.PL", "Build.PL", "cpanfile", "cpanfile.snapshot", "META.json", "META.yml", ".perl-version"]` | Quais nomes de arquivos devem ativar este módulo. | | `detect_folders` | `[]` | Quais pastas devem ativar este módulo. | | `style` | `"bold 149"` | O estilo do módulo. | -| `disabled` | `false` | Disables the `perl` module. | +| `disabled` | `false` | Desabilita o módulo `perl`. | ### Variáveis | Variável | Exemplo | Descrição | | --------- | --------- | ---------------------------------- | -| version | `v5.26.1` | The version of `perl` | +| version | `v5.26.1` | A versão do `perl` | | symbol | | Espelha o valor da opção `símbolo` | | style\* | | Espelha o valor da opção `style` | @@ -2226,8 +2255,8 @@ format = "via [🦪 $version]($style) " The `php` module shows the currently installed version of [PHP](https://www.php.net/). Por padrão o módulo vai exibir se uma das condições a seguir for atendida: - O diretório atual contem um arquivo `composer.json` -- The current directory contains a `.php-version` file -- The current directory contains a `.php` extension +- O diretório atual tenha um arquivo `.php-version` +- O diretório atual tenha um arquivo com extensão `.php` ### Opções @@ -2235,18 +2264,18 @@ The `php` module shows the currently installed version of [PHP](https://www.php. | ------------------- | ------------------------------------ | ------------------------------------------------------------------------------------ | | `format` | `"via [$symbol($version )]($style)"` | O formato do módulo. | | `version_format` | `"v${raw}"` | O formato da versão. As variáveis disponíveis são `raw`, `major`, `minor`, & `patch` | -| `symbol` | `"🐘 "` | The symbol used before displaying the version of PHP. | +| `symbol` | `"🐘 "` | O simbolo usado antes de exibir a versão do PHP. | | `detect_extensions` | `["php"]` | Quais extensões devem ativar este módulo. | | `detect_files` | `["composer.json", ".php-version"]` | Quais nomes de arquivos devem ativar este módulo. | | `detect_folders` | `[]` | Quais pastas devem ativar este módulo. | | `style` | `"147 bold"` | O estilo do módulo. | -| `disabled` | `false` | Disables the `php` module. | +| `disabled` | `false` | Desabilita o módulo `php`. | ### Variáveis | Variável | Exemplo | Descrição | | --------- | -------- | ---------------------------------- | -| version | `v7.3.8` | The version of `php` | +| version | `v7.3.8` | A versão do `php` | | symbol | | Espelha o valor da opção `símbolo` | | style\* | | Espelha o valor da opção `style` | @@ -2273,25 +2302,25 @@ By default the Pulumi version is not shown, since it takes an order of magnitude Por padrão o módulo vai exibir se uma das condições a seguir for atendida: -- The current directory contains either `Pulumi.yaml` or `Pulumi.yml` -- A parent directory contains either `Pulumi.yaml` or `Pulumi.yml` +- O diretório atual tenha um arquivo `Pulumi.yaml` ou `Pulumi.yml` +- Um diretório pai que tenha um arquivo `Pulumi.yaml` ou `Pulumi.yml` ### Opções | Opções | Padrão | Descrição | | ---------------- | -------------------------------- | ------------------------------------------------------------------------------------ | -| `format` | `"via [$symbol$stack]($style) "` | The format string for the module. | +| `format` | `"via [$symbol$stack]($style) "` | A string de formato do módulo. | | `version_format` | `"v${raw}"` | O formato da versão. As variáveis disponíveis são `raw`, `major`, `minor`, & `patch` | -| `symbol` | `" "` | A format string shown before the Pulumi stack. | +| `symbol` | `" "` | Uma string que é exibida antes do Pulumi stack. | | `style` | `"bold 5"` | O estilo do módulo. | -| `disabled` | `false` | Disables the `pulumi` module. | +| `disabled` | `false` | Desabilita o módulo `pulumi`. | ### Variáveis | Variável | Exemplo | Descrição | | --------- | ---------- | ---------------------------------- | -| version | `v0.12.24` | The version of `pulumi` | -| stack | `dev` | The current Pulumi stack | +| version | `v0.12.24` | A versão do `pulumi` | +| stack | `dev` | A stack Pulumi atual | | symbol | | Espelha o valor da opção `símbolo` | | style\* | | Espelha o valor da opção `style` | @@ -2299,7 +2328,7 @@ Por padrão o módulo vai exibir se uma das condições a seguir for atendida: ### Exemplo -#### With Pulumi Version +#### Com a versão do Pulumi ```toml # ~/.config/starship.toml @@ -2308,7 +2337,7 @@ Por padrão o módulo vai exibir se uma das condições a seguir for atendida: format = "[🛥 ($version )$stack]($style) " ``` -#### Without Pulumi version +#### Sem a versão do Pulumi ```toml # ~/.config/starship.toml @@ -2323,7 +2352,7 @@ format = "[$symbol$stack]($style) " The `purescript` module shows the currently installed version of [PureScript](https://www.purescript.org/) version. Por padrão o módulo vai exibir se uma das condições a seguir for atendida: - O diretório atual contem um arquivo `spago.dhall` -- The current directory contains a file with the `.purs` extension +- O diretório atual tenha um arquivo com a extensão `.purs` ### Opções @@ -2331,18 +2360,18 @@ The `purescript` module shows the currently installed version of [PureScript](ht | ------------------- | ------------------------------------ | ------------------------------------------------------------------------------------ | | `format` | `"via [$symbol($version )]($style)"` | O formato do módulo. | | `version_format` | `"v${raw}"` | O formato da versão. As variáveis disponíveis são `raw`, `major`, `minor`, & `patch` | -| `symbol` | `"<=> "` | The symbol used before displaying the version of PureScript. | +| `symbol` | `"<=> "` | O simbolo usado antes de exibir a versão do PureScript. | | `detect_extensions` | `["purs"]` | Quais extensões devem ativar este módulo. | | `detect_files` | `["spago.dhall"]` | Quais nomes de arquivos devem ativar este módulo. | | `detect_folders` | `[]` | Quais pastas devem ativar este módulo. | | `style` | `"bold white"` | O estilo do módulo. | -| `disabled` | `false` | Disables the `purescript` module. | +| `disabled` | `false` | Desabilita o módulo `purescript`. | ### Variáveis | Variável | Exemplo | Descrição | | --------- | -------- | ---------------------------------- | -| version | `0.13.5` | The version of `purescript` | +| version | `0.13.5` | A versão do `purescript` | | symbol | | Espelha o valor da opção `símbolo` | | style\* | | Espelha o valor da opção `style` | @@ -2365,31 +2394,31 @@ If `pyenv_version_name` is set to `true`, it will display the pyenv version name Por padrão o módulo vai exibir se uma das condições a seguir for atendida: -- The current directory contains a `.python-version` file -- The current directory contains a `Pipfile` file -- The current directory contains a `__init__.py` file +- O diretório atual tenha um arquivo `.python-version` +- O diretório atual tenha um arquivo `Pipfile` +- O diretório atual tenha um arquivo `__init__.py` - O diretório atual contem um arquivo `pyproject.toml` - O diretório atual contem um arquivo `requirements.txt` - O diretório atual contem um arquivo `setup.py` - O diretório atual contem um arquivo `tox.ini` -- The current directory contains a file with the `.py` extension. -- A virtual environment is currently activated +- O diretório atual tenha um arquivo com a extensão `.py`. +- Um ambiente virtual está atualmente ativo ### Opções -| Opções | Padrão | Descrição | -| -------------------- | ------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------- | -| `format` | `'via [${symbol}${pyenv_prefix}(${version} )(\($virtualenv\) )]($style)'` | O formato do módulo. | -| `version_format` | `"v${raw}"` | O formato da versão. As variáveis disponíveis são `raw`, `major`, `minor`, & `patch` | -| `symbol` | `"🐍 "` | A format string representing the symbol of Python | -| `style` | `"yellow bold"` | O estilo do módulo. | -| `pyenv_version_name` | `false` | Use pyenv to get Python version | -| `pyenv_prefix` | `pyenv` | Prefix before pyenv version display, only used if pyenv is used | -| `python_binary` | `["python", "python3", "python2"]` | Configures the python binaries that Starship should executes when getting the version. | -| `detect_extensions` | `["py"]` | Quais extensões devem acionar este módulo | -| `detect_files` | `[".python-version", "Pipfile", "__init__.py", "pyproject.toml", "requirements.txt", "setup.py", "tox.ini"]` | [] | -| `detect_folders` | `[]` | Quais pastas devem ativar este módulo | -| `disabled` | `false` | Disables the `python` module. | +| Opções | Padrão | Descrição | +| -------------------- | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `format` | `'via [${symbol}${pyenv_prefix}(${version} )(\($virtualenv\) )]($style)'` | O formato do módulo. | +| `version_format` | `"v${raw}"` | O formato da versão. As variáveis disponíveis são `raw`, `major`, `minor`, & `patch` | +| `symbol` | `"🐍 "` | Uma string que representa o simbolo do Python | +| `style` | `"yellow bold"` | O estilo do módulo. | +| `pyenv_version_name` | `false` | Usa pyenv para pegar a versão do Python | +| `pyenv_prefix` | `pyenv` | Prefixo antes da versão do pyenv, apenas usado se pyenv for usado | +| `python_binary` | `["python", "python3", "python2"]` | Configura o binário python que o Starship vai executar para obter a versão. | +| `detect_extensions` | `["py"]` | Quais extensões devem acionar este módulo | +| `detect_files` | `[".python-version", "Pipfile", "__init__.py", "pyproject.toml", "requirements.txt", "setup.py", "tox.ini"]` | [] | +| `detect_folders` | `[]` | Quais pastas devem ativar este módulo | +| `disabled` | `false` | Desabilita o módulo `python`. | ::: tip @@ -2401,13 +2430,13 @@ The default values and order for `python_binary` was chosen to first identify th ### Variáveis -| Variável | Exemplo | Descrição | -| ------------ | --------------- | ------------------------------------------ | -| version | `"v3.8.1"` | A versão do `python` | -| symbol | `"🐍 "` | Espelha o valor da opção `símbolo` | -| style | `"yellow bold"` | Espelha o valor da opção `style` | -| pyenv_prefix | `"pyenv "` | Mirrors the value of option `pyenv_prefix` | -| virtualenv | `"venv"` | The current `virtualenv` name | +| Variável | Exemplo | Descrição | +| ------------ | --------------- | --------------------------------------- | +| version | `"v3.8.1"` | A versão do `python` | +| symbol | `"🐍 "` | Espelha o valor da opção `símbolo` | +| style | `"yellow bold"` | Espelha o valor da opção `style` | +| pyenv_prefix | `"pyenv "` | Espelha o valor da opção `pyenv_prefix` | +| virtualenv | `"venv"` | O nome atual do `virtualenv` | ### Exemplo @@ -2423,7 +2452,7 @@ pyenv_version_name = true # ~/.config/starship.toml [python] -# Apenas use o binário `python3` para pegar a versão. +# Only use the `python3` binary to get the version. python_binary = "python3" ``` @@ -2431,7 +2460,7 @@ python_binary = "python3" # ~/.config/starship.toml [python] -#Não acione arquivos com a extensão py +# Don't trigger for files with the py extension detect_extensions = [] ``` @@ -2439,10 +2468,10 @@ detect_extensions = [] # ~/.config/starship.toml [python] -# Exibe a versão do python dentro de um local venv. +# Display the version of python from inside a local venv. # -# Observe que isso só funcionará quando o venv estiver dentro do projeto e somente -# funcionar no diretório que contém o venv dir mas talvez isso esteja ok? +# Note this will only work when the venv is inside the project and it will only +# work in the directory that contains the venv dir but maybe this is ok? python_binary = ["./venv/bin/python", "python", "python3", "python2"] ``` @@ -2450,13 +2479,13 @@ python_binary = ["./venv/bin/python", "python", "python3", "python2"] The `rlang` module shows the currently installed version of [R](https://www.r-project.org/). The module will be shown if any of the following conditions are met: -- The current directory contains a file with the `.R` extension. -- The current directory contains a file with the `.Rd` extension. -- The current directory contains a file with the `.Rmd` extension. -- The current directory contains a file with the `.Rproj` extension. -- The current directory contains a file with the `.Rsx` extension. -- The current directory contains a `.Rprofile` file -- The current directory contains a `.Rproj.user` folder +- O diretório atual tenha um arquivo com a extensão `.R`. +- O diretório atual tenha um arquivo com a extensão `.Rd`. +- O diretório atual tenha um arquivo com a extensão `.Rmd`. +- O diretório atual tenha um arquivo com a extensão `.Rproj`. +- O diretório atual tenha um arquivo com a extensão `.Rsx`. +- O diretório atual tenha um arquivo `.Rprofile` +- O diretório atual tenha uma pasta `.Rpoj.user` ### Opções @@ -2464,18 +2493,18 @@ The `rlang` module shows the currently installed version of [R](https://www.r-pr | ------------------- | ------------------------------------ | ------------------------------------------------------------------------------------ | | `format` | `"via [$symbol($version )]($style)"` | O formato do módulo. | | `version_format` | `"v${raw}"` | O formato da versão. As variáveis disponíveis são `raw`, `major`, `minor`, & `patch` | -| `symbol` | `"📐"` | A format string representing the symbol of R. | +| `symbol` | `"📐"` | Uma string que representa o simbolo do R. | | `style` | `"blue bold"` | O estilo do módulo. | | `detect_extensions` | `["R", "Rd", "Rmd", "Rproj", "Rsx"]` | Quais extensões devem acionar este módulo | | `detect_files` | `[".Rprofile"]` | [] | | `detect_folders` | `[".Rproj.user"]` | Quais pastas devem ativar este módulo | -| `disabled` | `false` | Disables the `r` module. | +| `disabled` | `false` | Desabilita o módulo `r`. | ### Variáveis | Variável | Exemplo | Descrição | | -------- | ------------- | ---------------------------------- | -| version | `v4.0.5` | The version of `R` | +| version | `v4.0.5` | A versão do `R` | | symbol | | Espelha o valor da opção `símbolo` | | style | `"blue bold"` | Espelha o valor da opção `style` | @@ -2490,9 +2519,9 @@ format = "with [📐 $version](blue bold) " ## Red -By default the `red` module shows the currently installed version of [Red](https://www.red-lang.org/). The module will be shown if any of the following conditions are met: +By default the `red` module shows the currently installed version of [Red](https://www.red-lang.org/). O módulo vai exibir se algumas das condições a seguir for atendida: -- The current directory contains a file with `.red` or `.reds` extension +- O diretório atual contenha um arquivo com a extensão `.red` or `.reds` ### Opções @@ -2500,18 +2529,18 @@ By default the `red` module shows the currently installed version of [Red](https | ------------------- | ------------------------------------ | ------------------------------------------------------------------------------------ | | `format` | `"via [$symbol($version )]($style)"` | O formato do módulo. | | `version_format` | `"v${raw}"` | O formato da versão. As variáveis disponíveis são `raw`, `major`, `minor`, & `patch` | -| `symbol` | `"🔺 "` | A format string representing the symbol of Red. | +| `symbol` | `"🔺 "` | Uma string que representa o simbolo do Red. | | `detect_extensions` | `["red"]` | Quais extensões devem ativar este módulo. | | `detect_files` | `[]` | Quais nomes de arquivos devem ativar este módulo. | | `detect_folders` | `[]` | Quais pastas devem ativar este módulo. | | `style` | `"red bold"` | O estilo do módulo. | -| `disabled` | `false` | Disables the `red` module. | +| `disabled` | `false` | Desabilita o módulo `red`. | ### Variáveis | Variável | Exemplo | Descrição | | --------- | -------- | ---------------------------------- | -| version | `v2.5.1` | The version of `red` | +| version | `v2.5.1` | A versão do `red` | | symbol | | Espelha o valor da opção `símbolo` | | style\* | | Espelha o valor da opção `style` | @@ -2528,12 +2557,12 @@ symbol = "🔴 " ## Ruby -By default the `ruby` module shows the currently installed version of [Ruby](https://www.ruby-lang.org/). The module will be shown if any of the following conditions are met: +By default the `ruby` module shows the currently installed version of [Ruby](https://www.ruby-lang.org/). O módulo vai exibir se algumas das condições a seguir for atendida: -- The current directory contains a `Gemfile` file -- The current directory contains a `.ruby-version` file -- The current directory contains a `.rb` file -- The environment variables `RUBY_VERSION` or `RBENV_VERSION` are set +- O diretório atual tenha um arquivo `Gemfile` +- O diretório atual contém um arquivo `.ruby-version` +- O diretório atual contem um arquivo `.rb` +- As variáveis de ambiente `RUBY_VERSION` ou `RBENV_VERSION` estão definidas Starship gets the current Ruby version by running `ruby -v`. @@ -2543,19 +2572,19 @@ Starship gets the current Ruby version by running `ruby -v`. | ------------------- | ------------------------------------ | ------------------------------------------------------------------------------------ | | `format` | `"via [$symbol($version )]($style)"` | O formato do módulo. | | `version_format` | `"v${raw}"` | O formato da versão. As variáveis disponíveis são `raw`, `major`, `minor`, & `patch` | -| `symbol` | `"💎 "` | A format string representing the symbol of Ruby. | +| `symbol` | `"💎 "` | Uma string que representa o simbolo do Ruby. | | `detect_extensions` | `["rb"]` | Quais extensões devem ativar este módulo. | | `detect_files` | `["Gemfile", ".ruby-version"]` | Quais nomes de arquivos devem ativar este módulo. | | `detect_folders` | `[]` | Quais pastas devem ativar este módulo. | -| `detect_variables` | `["RUBY_VERSION", "RBENV_VERSION"]` | Which environment variables should trigger this module. | +| `detect_variables` | `["RUBY_VERSION", "RBENV_VERSION"]` | Quais variáveis de ambiente devem ativar este módulo. | | `style` | `"bold red"` | O estilo do módulo. | -| `disabled` | `false` | Disables the `ruby` module. | +| `disabled` | `false` | Desabilita o módulo `ruby`. | ### Variáveis | Variável | Exemplo | Descrição | | --------- | -------- | ---------------------------------- | -| version | `v2.5.1` | The version of `ruby` | +| version | `v2.5.1` | A versão do `ruby` | | symbol | | Espelha o valor da opção `símbolo` | | style\* | | Espelha o valor da opção `style` | @@ -2572,10 +2601,10 @@ symbol = "🔺 " ## Rust -By default the `rust` module shows the currently installed version of [Rust](https://www.rust-lang.org/). The module will be shown if any of the following conditions are met: +By default the `rust` module shows the currently installed version of [Rust](https://www.rust-lang.org/). O módulo vai exibir se algumas das condições a seguir for atendida: -- The current directory contains a `Cargo.toml` file -- The current directory contains a file with the `.rs` extension +- O diretório atual contem um arquivo `Cargo.toml` +- O diretório atual tenha um arquivo com a extensão `.rs` ### Opções @@ -2583,18 +2612,18 @@ By default the `rust` module shows the currently installed version of [Rust](htt | ------------------- | ------------------------------------ | ------------------------------------------------------------------------------------ | | `format` | `"via [$symbol($version )]($style)"` | O formato do módulo. | | `version_format` | `"v${raw}"` | O formato da versão. As variáveis disponíveis são `raw`, `major`, `minor`, & `patch` | -| `symbol` | `"🦀 "` | A format string representing the symbol of Rust | +| `symbol` | `"🦀 "` | Uma string que representa o simbolo do Rust | | `detect_extensions` | `["rs"]` | Quais extensões devem ativar este módulo. | | `detect_files` | `["Cargo.toml"]` | Quais nomes de arquivos devem ativar este módulo. | | `detect_folders` | `[]` | Quais pastas devem ativar este módulo. | | `style` | `"bold red"` | O estilo do módulo. | -| `disabled` | `false` | Disables the `rust` module. | +| `disabled` | `false` | Desabilita o módulo `rust`. | ### Variáveis | Variável | Exemplo | Descrição | | --------- | ----------------- | ---------------------------------- | -| version | `v1.43.0-nightly` | The version of `rustc` | +| version | `v1.43.0-nightly` | A versão do `rustc` | | symbol | | Espelha o valor da opção `símbolo` | | style\* | | Espelha o valor da opção `style` | @@ -2613,9 +2642,9 @@ format = "via [⚙️ $version](red bold)" The `scala` module shows the currently installed version of [Scala](https://www.scala-lang.org/). Por padrão o módulo vai exibir se uma das condições a seguir for atendida: -- The current directory contains a `build.sbt`, `.scalaenv` or `.sbtenv` file -- The current directory contains a file with the `.scala` or `.sbt` extension -- The current directory contains a directory named `.metals` +- O diretório atual contem um arquivo `build.sbt`, `.scalaenv` ou `.sbtenv` +- O diretório atual tenha um arquivo com a extensão `.scala` ou `.sbt` +- O diretório atual tenha um diretório chamado `.metals` ### Opções @@ -2623,18 +2652,18 @@ The `scala` module shows the currently installed version of [Scala](https://www. | ------------------- | ---------------------------------------- | ------------------------------------------------------------------------------------ | | `format` | `"via [${symbol}(${version} )]($style)"` | O formato do módulo. | | `version_format` | `"v${raw}"` | O formato da versão. As variáveis disponíveis são `raw`, `major`, `minor`, & `patch` | -| `detect_extensions` | `["sbt", "scala"]` | Quais extensões devem ativar este módulo. | +| `detect_extensions` | `["sbt", "escala"]` | Quais extensões devem ativar este módulo. | | `detect_files` | `[".scalaenv", ".sbtenv", "build.sbt"]` | Quais nomes de arquivos devem ativar este módulo. | | `detect_folders` | `[".metals"]` | Quais pastas devem ativar este módulo. | -| `symbol` | `"🆂 "` | A format string representing the symbol of Scala. | +| `symbol` | `"🆂 "` | Uma string que representa o simbolo do Scala. | | `style` | `"red dimmed"` | O estilo do módulo. | -| `disabled` | `false` | Disables the `scala` module. | +| `disabled` | `false` | Desabilita o módulo `scala`. | ### Variáveis | Variável | Exemplo | Descrição | | --------- | -------- | ---------------------------------- | -| version | `2.13.5` | The version of `scala` | +| version | `2.13.5` | A versão do `scala` | | symbol | | Espelha o valor da opção `símbolo` | | style\* | | Espelha o valor da opção `style` | @@ -2651,11 +2680,11 @@ symbol = "🌟 " ## Shell -O módulo de `shell` exibe um indicador para o shell que esta sendo usado. +The `shell` module shows an indicator for currently used shell. ::: tip -Este módulo é desativado por padrão. Para ativa-lo, defina `disabled` para `false` no seu arquivo de configuração. +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: @@ -2665,12 +2694,14 @@ Este módulo é desativado por padrão. Para ativa-lo, defina `disabled` para `f | ---------------------- | ------------------------- | ------------------------------------------------------------ | | `bash_indicator` | `bsh` | Uma string para representar o bash. | | `fish_indicator` | `fsh` | Uma string usada para representar o fish. | -| `zsh_indicator` | `zsh` | A format string used to represent zsh. | -| `powershell_indicator` | `psh` | A format string used to represent powershell. | -| `ion_indicator` | `ion` | A format string used to represent ion. | -| `elvish_indicator` | `esh` | A format string used to represent elvish. | -| `tcsh_indicator` | `tsh` | A format string used to represent tcsh. | -| `xonsh_indicator` | `xsh` | A format string used to represent xonsh. | +| `zsh_indicator` | `zsh` | Uma string usada para representar o zsh. | +| `powershell_indicator` | `psh` | Uma string usada para representar o powershell. | +| `ion_indicator` | `ion` | Uma string usada para representar o ion. | +| `elvish_indicator` | `esh` | Uma string usada para representar o elvish. | +| `tcsh_indicator` | `tsh` | Uma string usada para representar o tcsh. | +| `xonsh_indicator` | `xsh` | Uma string usada para representar o xonsh. | +| `cmd_indicator` | `cmd` | A format string used to represent cmd. | +| `nu_indicator` | `nu` | A format string used to represent nu. | | `unknown_indicator` | | The default value to be displayed when the shell is unknown. | | `format` | `"[$indicator]($style) "` | O formato do módulo. | | `style` | `"white bold"` | O estilo do módulo. | @@ -2678,10 +2709,10 @@ Este módulo é desativado por padrão. Para ativa-lo, defina `disabled` para `f ### Variáveis -| Variável | Padrão | Descrição | -| --------- | ------ | ---------------------------------------------------------- | -| indicator | | Mirrors the value of `indicator` for currently used shell. | -| style\* | | Espelha o valor da opção `style`. | +| Variável | Padrão | Descrição | +| --------- | ------ | ------------------------------------------------------------- | +| indicator | | Espelha o valor do `indicator` para o shell usado atualmente. | +| style\* | | Espelha o valor da opção `style`. | \*: Essa variável só pode ser usada como parte de uma string de estilo @@ -2704,20 +2735,20 @@ The `shlvl` module shows the current [`SHLVL`](https://tldp.org/LDP/abs/html/int ### Opções -| Opções | Padrão | Descrição | -| ----------- | ---------------------------- | ------------------------------------------------------------- | -| `threshold` | `2` | Display threshold. | -| `format` | `"[$symbol$shlvl]($style) "` | O formato do módulo. | -| `symbol` | `"↕️ "` | The symbol used to represent the `SHLVL`. | -| `repeat` | `false` | Causes `symbol` to be repeated by the current `SHLVL` amount. | -| `style` | `"bold yellow"` | O estilo do módulo. | -| `disabled` | `true` | Disables the `shlvl` module. | +| Opções | Padrão | Descrição | +| ----------- | ---------------------------- | ----------------------------------------------------------------- | +| `threshold` | `2` | Limite de exibição. | +| `format` | `"[$symbol$shlvl]($style) "` | O formato do módulo. | +| `symbol` | `"↕️ "` | O simbolo usado para representar o `SHLVL`. | +| `repeat` | `false` | Caso o `symbol` deva se repetir de acordo com o total do `SHLVL`. | +| `style` | `"bold yellow"` | O estilo do módulo. | +| `disabled` | `true` | Desabilita o módulo `shlvl`. | ### Variáveis | Variável | Exemplo | Descrição | | --------- | ------- | ---------------------------------- | -| shlvl | `3` | The current value of `SHLVL` | +| shlvl | `3` | O valor atual do `SHLVL` | | symbol | | Espelha o valor da opção `símbolo` | | style\* | | Espelha o valor da opção `style` | @@ -2740,18 +2771,18 @@ The `singularity` module shows the current [Singularity](https://sylabs.io/singu ### Opções -| Opções | Padrão | Descrição | -| ---------- | -------------------------------- | ------------------------------------------------ | -| `format` | `'[$symbol\[$env\]]($style) '` | O formato do módulo. | -| `symbol` | `""` | A format string displayed before the image name. | -| `style` | `"bold dimmed blue"` | O estilo do módulo. | -| `disabled` | `false` | Disables the `singularity` module. | +| Opções | Padrão | Descrição | +| ---------- | -------------------------------- | ------------------------------------------- | +| `format` | `'[$symbol\[$env\]]($style) '` | O formato do módulo. | +| `symbol` | `""` | Uma string exibida antes do nome da imagem. | +| `style` | `"bold dimmed blue"` | O estilo do módulo. | +| `disabled` | `false` | Desabilita o módulo `singularity`. | ### Variáveis | Variável | Exemplo | Descrição | | --------- | ------------ | ---------------------------------- | -| env | `centos.img` | The current Singularity image | +| env | `centos.img` | A imagem atual do Singularity | | symbol | | Espelha o valor da opção `símbolo` | | style\* | | Espelha o valor da opção `style` | @@ -2772,44 +2803,45 @@ The `status` module displays the exit code of the previous command. The module w ::: tip -Este módulo é desativado por padrão. Para ativa-lo, defina `disabled` para `false` no seu arquivo de configuração. +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: -::: warning This module is not supported on elvish and nu shell. ::: +::: warning This module is not supported on nu shell. ::: ### Opções -| Opções | Padrão | Descrição | -| ----------------------- | ------------------------------------------------------------------------------------ | ------------------------------------------------------- | -| `format` | `"[$symbol$status]($style) "` | The format of the module | -| `symbol` | `"✖"` | The symbol displayed on program error | -| `success_symbol` | `"✔️"` | The symbol displayed on program success | -| `not_executable_symbol` | `"🚫"` | The symbol displayed when file isn't executable | -| `not_found_symbol` | `"🔍"` | The symbol displayed when the command can't be found | -| `sigint_symbol` | `"🧱"` | The symbol displayed on SIGINT (Ctrl + c) | -| `signal_symbol` | `"⚡"` | The symbol displayed on any signal | -| `style` | `"bold red"` | O estilo do módulo. | -| `recognize_signal_code` | `true` | Enable signal mapping from exit code | -| `map_symbol` | `false` | Enable symbols mapping from exit code | -| `pipestatus` | `false` | Enable pipestatus reporting | -| `pipestatus_separator` | `|` | The symbol that separate in pipe program exit codes | -| `pipestatus_format` | `\\[$pipestatus\\] => [$symbol$common_meaning$signal_name$maybe_int]($style)` | The format of the module when the command is a pipeline | -| `disabled` | `true` | Disables the `status` module. | +| Opções | Padrão | Descrição | +| ----------------------- | ------------------------------------------------------------------------------------ | ------------------------------------------------------------ | +| `format` | `"[$symbol$status]($style) "` | O formato do módulo | +| `symbol` | `"✖"` | O simbolo exibido no erro de programa | +| `success_symbol` | `"✔️"` | O simbolo exibido no sucesso de programa | +| `not_executable_symbol` | `"🚫"` | O simbolo exibido quando o arquivo não é executável | +| `not_found_symbol` | `"🔍"` | O simbolo exibido quando o comando não é encontrado | +| `sigint_symbol` | `"🧱"` | O simbolo exibido no SIGINT (Ctrl + c) | +| `signal_symbol` | `"⚡"` | O simbolo exibido em qualquer sinal | +| `style` | `"bold red"` | O estilo do módulo. | +| `recognize_signal_code` | `true` | Habilita o mapeamento de sinais para códigos de saída | +| `map_symbol` | `false` | Habilita o mapeamento de símbolos para códigos de saída | +| `pipestatus` | `false` | Habilita o relatório de pipestatus | +| `pipestatus_separator` | `|` | O simbolo que separa o pepe dos programas e códigos de saída | +| `pipestatus_format` | `\\[$pipestatus\\] => [$symbol$common_meaning$signal_name$maybe_int]($style)` | O formato do módulo quando o comando é um pipeline | +| `disabled` | `true` | Desabilita o módulo `status`. | ### Variáveis -| Variável | Exemplo | Descrição | -| -------------- | ------- | ------------------------------------------------------------------------------------------- | -| status | `127` | The exit code of the last command | -| int | `127` | The exit code of the last command | -| common_meaning | `ERROR` | Meaning of the code if not a signal | -| signal_number | `9` | Signal number corresponding to the exit code, only if signalled | -| signal_name | `KILL` | Name of the signal corresponding to the exit code, only if signalled | -| maybe_int | `7` | Contains the exit code number when no meaning has been found | -| pipestatus | | Rendering of in pipeline programs's exit codes, this is only available in pipestatus_format | -| symbol | | Espelha o valor da opção `símbolo` | -| style\* | | Espelha o valor da opção `style` | +| Variável | Exemplo | Descrição | +| -------------- | ------- | -------------------------------------------------------------------------------------------------------- | +| status | `127` | O codígo de saída do último comando | +| hex_status | `0x7F` | O codígo de saída do último comando em hex | +| int | `127` | O codígo de saída do último comando | +| common_meaning | `ERROR` | Significa que o código não é um sinal | +| signal_number | `9` | Número do sinal correspondente ao código de saída, apenas se sinalizado | +| signal_name | `KILL` | Nome do sinal correspondente ao código de saída, apenas se for sinalizado | +| maybe_int | `7` | Contém o código de saída quando nenhum significado for encontrado | +| pipestatus | | Exibição do pipeline de programas com os códigos de saída, este é apenas disponível no pipestatus_format | +| symbol | | Espelha o valor da opção `símbolo` | +| style\* | | Espelha o valor da opção `style` | \*: Essa variável só pode ser usada como parte de uma string de estilo @@ -2834,19 +2866,19 @@ The `sudo` module displays if sudo credentials are currently cached. The module ::: tip -Este módulo é desativado por padrão. Para ativa-lo, defina `disabled` para `false` no seu arquivo de configuração. +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: ### Opções -| Opções | Padrão | Descrição | -| --------------- | ----------------------- | ------------------------------------------------------- | -| `format` | `[as $symbol]($style)"` | The format of the module | -| `symbol` | `"🧙 "` | The symbol displayed when credentials are cached | -| `style` | `"bold blue"` | O estilo do módulo. | -| `allow_windows` | `false` | Since windows has no default sudo, default is disabled. | -| `disabled` | `true` | Disables the `sudo` module. | +| Opções | Padrão | Descrição | +| --------------- | ----------------------- | -------------------------------------------------------------------------- | +| `format` | `[as $symbol]($style)"` | O formato do módulo | +| `symbol` | `"🧙 "` | O simbolo exibido quando as credenciais estão em cache | +| `style` | `"bold blue"` | O estilo do módulo. | +| `allow_windows` | `false` | Desde que o Windows não tem um padrão sudo, o valor padrão é desabilitado. | +| `disabled` | `true` | Desabilita o módulo `sudo`. | ### Variáveis @@ -2880,10 +2912,10 @@ disabled = false ## 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/). O módulo vai exibir se algumas das condições a seguir for atendida: -- The current directory contains a `Package.swift` file -- The current directory contains a file with the `.swift` extension +- O diretório atual tenha um arquivo `Package.swift` +- O diretório atual tenha um arquivo com a extensão `.swift` ### Opções @@ -2891,18 +2923,18 @@ By default the `swift` module shows the currently installed version of [Swift](h | ------------------- | ------------------------------------ | ------------------------------------------------------------------------------------ | | `format` | `"via [$symbol($version )]($style)"` | O formato do módulo. | | `version_format` | `"v${raw}"` | O formato da versão. As variáveis disponíveis são `raw`, `major`, `minor`, & `patch` | -| `symbol` | `"🐦 "` | A format string representing the symbol of Swift | +| `symbol` | `"🐦 "` | Uma string que representa o simbolo do Swift | | `detect_extensions` | `["swift"]` | Quais extensões devem ativar este módulo. | | `detect_files` | `["Package.swift"]` | Quais nomes de arquivos devem ativar este módulo. | | `detect_folders` | `[]` | Quais pastas devem ativar este módulo. | | `style` | `"bold 202"` | O estilo do módulo. | -| `disabled` | `false` | Disables the `swift` module. | +| `disabled` | `false` | Desabilita o módulo `swift`. | ### Variáveis | Variável | Exemplo | Descrição | | --------- | -------- | ---------------------------------- | -| version | `v5.2.4` | The version of `swift` | +| version | `v5.2.4` | A versão do `swift` | | symbol | | Espelha o valor da opção `símbolo` | | style\* | | Espelha o valor da opção `style` | @@ -2929,28 +2961,28 @@ By default the Terraform version is not shown, since this is slow for current ve Por padrão o módulo vai exibir se uma das condições a seguir for atendida: -- The current directory contains a `.terraform` folder -- Current directory contains a file with the `.tf`, `.tfplan` or `.tfstate` extensions +- O diretório atual tenha uma pasta `.terraform` +- O diretório atual tenha arquivos com as extensões `.tf`, `.tfplan` or `.tfstate` ### Opções | Opções | Padrão | Descrição | | ------------------- | ------------------------------------ | ------------------------------------------------------------------------------------ | -| `format` | `"via [$symbol$workspace]($style) "` | The format string for the module. | +| `format` | `"via [$symbol$workspace]($style) "` | A string de formato do módulo. | | `version_format` | `"v${raw}"` | O formato da versão. As variáveis disponíveis são `raw`, `major`, `minor`, & `patch` | -| `symbol` | `"💠"` | A format string shown before the terraform workspace. | +| `symbol` | `"💠"` | Uma string que é exibida antes do workspace terraform. | | `detect_extensions` | `["tf", "tfplan", "tfstate"]` | Quais extensões devem ativar este módulo. | | `detect_files` | `[]` | Quais nomes de arquivos devem ativar este módulo. | | `detect_folders` | `[".terraform"]` | Quais pastas devem ativar este módulo. | | `style` | `"bold 105"` | O estilo do módulo. | -| `disabled` | `false` | Disables the `terraform` module. | +| `disabled` | `false` | Desabilita o módulo `terraform`. | ### Variáveis | Variável | Exemplo | Descrição | | --------- | ---------- | ---------------------------------- | -| version | `v0.12.24` | The version of `terraform` | -| workspace | `default` | The current Terraform workspace | +| version | `v0.12.24` | A versão do `terraform` | +| workspace | `default` | O workspace atual do Terraform | | symbol | | Espelha o valor da opção `símbolo` | | style\* | | Espelha o valor da opção `style` | @@ -2958,7 +2990,7 @@ Por padrão o módulo vai exibir se uma das condições a seguir for atendida: ### Exemplo -#### With Terraform Version +#### Com a versão do Terraform ```toml # ~/.config/starship.toml @@ -2967,7 +2999,7 @@ Por padrão o módulo vai exibir se uma das condições a seguir for atendida: format = "[🏎💨 $version$workspace]($style) " ``` -#### Without Terraform version +#### Sem a versão do Terraform ```toml # ~/.config/starship.toml @@ -2982,21 +3014,21 @@ The `time` module shows the current **local** time. The `format` configuration v ::: tip -Este módulo é desativado por padrão. Para ativa-lo, defina `disabled` para `false` no seu arquivo de configuração. +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: ### Opções -| Opções | Padrão | Descrição | -| ----------------- | ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | -| `format` | `"at [$time]($style) "` | The format string for the module. | -| `use_12hr` | `false` | Enables 12 hour formatting | -| `time_format` | see below | The [chrono format string](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) used to format the time. | -| `style` | `"bold yellow"` | The style for the module time | -| `utc_time_offset` | `"local"` | Sets the UTC offset to use. Range from -24 < x < 24. Allows floats to accommodate 30/45 minute timezone offsets. | -| `disabled` | `true` | Disables the `time` module. | -| `time_range` | `"-"` | Sets the time range during which the module will be shown. Times must be specified in 24-hours format | +| Opções | Padrão | Descrição | +| ----------------- | ----------------------- | --------------------------------------------------------------------------------------------------------------------------- | +| `format` | `"at [$time]($style) "` | A string de formato do módulo. | +| `use_12hr` | `false` | Habilita a formatação de 12 horas | +| `time_format` | veja abaixo | A string [chrono format string](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) usada para formatar a hora. | +| `style` | `"bold yellow"` | O estilo do módulo time | +| `utc_time_offset` | `"local"` | Define o UTC a ser usado. Intervalo de -24 < x < 24. Aceita floats para acomodar timezones 30/45. | +| `disabled` | `true` | Desabilita o módulo `time`. | +| `time_range` | `"-"` | Define o intervalo de tempo o qual o módulo será exibido. O horário deve ser especificado no formato de 24-hours | If `use_12hr` is `true`, then `time_format` defaults to `"%r"`. Otherwise, it defaults to `"%T"`. Manually setting `time_format` will override the `use_12hr` setting. @@ -3004,7 +3036,7 @@ If `use_12hr` is `true`, then `time_format` defaults to `"%r"`. Otherwise, it de | Variável | Exemplo | Descrição | | --------- | ---------- | -------------------------------- | -| horário | `13:08:10` | The current time. | +| horário | `13:08:10` | A hora atual. | | style\* | | Espelha o valor da opção `style` | \*: Essa variável só pode ser usada como parte de uma string de estilo @@ -3024,12 +3056,12 @@ time_range = "10:00:00-14:00:00" ## Username -The `username` module shows active user's username. The module will be shown if any of the following conditions are met: +The `username` module shows active user's username. O módulo vai exibir se algumas das condições a seguir for atendida: -- The current user is root -- The current user isn't the same as the one that is logged in -- The user is currently connected as an SSH session -- The variable `show_always` is set to true +- O usuário atual é root +- O usuário atual não é o mesmo que está logado +- O usuário atual esta conectado em uma sessão SSH +- A variável `show_always` esta definida como true ::: tip @@ -3039,20 +3071,20 @@ SSH connection is detected by checking environment variables `SSH_CONNECTION`, ` ### Opções -| Opções | Padrão | Descrição | -| ------------- | ----------------------- | ------------------------------------- | -| `style_root` | `"bold red"` | The style used when the user is root. | -| `style_user` | `"bold yellow"` | The style used for non-root users. | -| `format` | `"[$user]($style) in "` | O formato do módulo. | -| `show_always` | `false` | Always shows the `username` module. | -| `disabled` | `false` | Disables the `username` module. | +| Opções | Padrão | Descrição | +| ------------- | ----------------------- | --------------------------------------- | +| `style_root` | `"bold red"` | O estilo usado quando o usuário é root. | +| `style_user` | `"bold yellow"` | O estilo usado para usuários não root. | +| `format` | `"[$user]($style) in "` | O formato do módulo. | +| `show_always` | `false` | Sempre exibe o módulo `username`. | +| `disabled` | `false` | Desabilita o módulo `username`. | ### Variáveis -| Variável | Exemplo | Descrição | -| -------- | ------------ | ------------------------------------------------------------------------------------------- | -| `style` | `"red bold"` | Mirrors the value of option `style_root` when root is logged in and `style_user` otherwise. | -| `user` | `"matchai"` | The currently logged-in user ID. | +| Variável | Exemplo | Descrição | +| -------- | ------------ | -------------------------------------------------------------------------------------- | +| `style` | `"red bold"` | Espelha o valor da opção `style_root` quando o root esta logado e `style_user` se não. | +| `user` | `"matchai"` | O ID do usuário logado atualmente. | ### Exemplo @@ -3069,7 +3101,7 @@ show_always = true ## Vagrant -O módulo `vagrant` exibe a versão atual instalada do [Vagrant](https://www.vagrantup.com/). Por padrão o módulo vai exibir se uma das condições a seguir for atendida: +The `vagrant` module shows the currently installed version of [Vagrant](https://www.vagrantup.com/). Por padrão o módulo vai exibir se uma das condições a seguir for atendida: - O diretório atual contem um arquivo `Vagrantfile` @@ -3107,7 +3139,7 @@ format = "via [⍱ $version](bold white) " ## V -O módulo `vlang` exibe a versão atual instalada do [V](https://vlang.io/). Por padrão o módulo vai exibir se uma das condições a seguir for atendida: +The `vlang` module shows you your currently installed version of [V](https://vlang.io/). Por padrão o módulo vai exibir se uma das condições a seguir for atendida: - O diretório atual cotem qualquer arquivo com a extensão `.v` - O diretório atual contem um arquivo `v.mod`, `vpkg.json` ou `.vpkg-lock.json` @@ -3148,10 +3180,10 @@ The `vcsh` module displays the current active [VCSH](https://github.com/RichiH/v | Opções | Padrão | Descrição | | ---------- | -------------------------------- | ------------------------------------------------------ | -| `symbol` | | The symbol used before displaying the repository name. | +| `symbol` | | O simbolo usado antes de exibir o nome do repositório. | | `style` | `"bold yellow"` | O estilo do módulo. | | `format` | `"vcsh [$symbol$repo]($style) "` | O formato do módulo. | -| `disabled` | `false` | Disables the `vcsh` module. | +| `disabled` | `false` | Desabilita o módulo `vcsh`. | ### Variáveis @@ -3174,9 +3206,9 @@ format = "[🆅 $repo](bold blue) " ## Zig -By default the the `zig` module shows the currently installed version of [Zig](https://ziglang.org/). The module will be shown if any of the following conditions are met: +By default the the `zig` module shows the currently installed version of [Zig](https://ziglang.org/). O módulo vai exibir se algumas das condições a seguir for atendida: -- The current directory contains a `.zig` file +- O diretório atual contém arquivo com a extensão `.zig` ### Opções @@ -3184,9 +3216,9 @@ By default the the `zig` module shows the currently installed version of [Zig](h | ------------------- | ------------------------------------ | ------------------------------------------------------------------------------------ | | `format` | `"via [$symbol($version )]($style)"` | O formato do módulo. | | `version_format` | `"v${raw}"` | O formato da versão. As variáveis disponíveis são `raw`, `major`, `minor`, & `patch` | -| `symbol` | `"↯ "` | The symbol used before displaying the version of Zig. | +| `symbol` | `"↯ "` | O simbolo usado antes de exibir a versão do Zig. | | `style` | `"bold yellow"` | O estilo do módulo. | -| `disabled` | `false` | Disables the `zig` module. | +| `disabled` | `false` | Desabilita o módulo `zig`. | | `detect_extensions` | `["zig"]` | Quais extensões devem ativar este módulo. | | `detect_files` | `[]` | Quais nomes de arquivos devem ativar este módulo. | | `detect_folders` | `[]` | Quais pastas devem ativar este módulo. | @@ -3216,15 +3248,15 @@ The `custom` modules show the output of some arbitrary commands. These modules will be shown if any of the following conditions are met: -- The current directory contains a file whose name is in `files` -- The current directory contains a directory whose name is in `directories` -- The current directory contains a file whose extension is in `extensions` -- The `when` command returns 0 -- The current Operating System (std::env::consts::OS) matchs with `os` field if defined. +- O diretório atual tenha um arquivo cujo o nome esta em `files` +- O diretório atual tenha um diretório cujo o nome esta em `directories` +- O diretório atual tenha um arquivo com extensão que esteja em `extensions` +- O comando `when` retorna 0 +- O sistema operacional (std::env::consts::OS) corresponde com o `os` se definido. ::: tip -Vários módulos personalizados podem ser definidos usando `.`. +Multiple custom modules can be defined by using a `.`. ::: @@ -3252,14 +3284,14 @@ Format strings can also contain shell specific prompt sequences, e.g. [Bash](htt | Opções | Padrão | Descrição | | ------------- | ------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `command` | `""` | The command whose output should be printed. The command will be passed on stdin to the shell. | -| `when` | | A shell command used as a condition to show the module. The module will be shown if the command returns a `0` status code. | -| `shell` | | [See below](#custom-command-shell) | -| `descrição` | `""` | The description of the module that is shown when running `starship explain`. | -| `files` | `[]` | The files that will be searched in the working directory for a match. | -| `directories` | `[]` | The directories that will be searched in the working directory for a match. | -| `extensions` | `[]` | The extensions that will be searched in the working directory for a match. | -| `symbol` | `""` | The symbol used before displaying the command output. | +| `command` | `""` | O comando cuja a saída deve ser exibida. O comando será passado no stdin para o shell. | +| `when` | | Um comando de shell usado como condição para exibir o módulo. O módulo será exibido se o comando retornar `0` como código de status. | +| `shell` | | [Veja abaixo](#custom-command-shell) | +| `descrição` | `""` | A descrição do módulo, isto será exibido quando executar `starship explain`. | +| `files` | `[]` | Os arquivos que serão buscados por correspondência no diretório atual. | +| `directories` | `[]` | Os diretórios que serão buscados por correspondência no diretório atual. | +| `extensions` | `[]` | As extensões que serão buscadas por correspondência no diretório atual. | +| `symbol` | `""` | O simbolo usado antes de exibir a saída do comando. | | `style` | `"bold green"` | O estilo do módulo. | | `format` | `"[$symbol($output )]($style)"` | O formato do módulo. | | `disabled` | `false` | Desabilita este módulo `custom`. | @@ -3279,8 +3311,8 @@ Format strings can also contain shell specific prompt sequences, e.g. [Bash](htt `shell` accepts a non-empty list of strings, where: -- The first string is the path to the shell to use to execute the command. -- Other following arguments are passed to the shell. +- A primeira string é o caminho para o shell que executará o comando. +- Outros argumentos que serão passados para o shell. If unset, it will fallback to STARSHIP_SHELL and then to "sh" on Linux, and "cmd /C" on Windows. diff --git a/docs/pt-BR/faq/README.md b/docs/pt-BR/faq/README.md index 56beee3b4..bee37be16 100644 --- a/docs/pt-BR/faq/README.md +++ b/docs/pt-BR/faq/README.md @@ -56,31 +56,31 @@ Se você está tendo um erro como "_version 'GLIBC_2.18' not found (required by sh -c "$(curl -fsSL https://starship.rs/install.sh)" -- --platform unknown-linux-musl ``` -## Why do I see `Executing command "..." timed out.` warnings? +## Porque eu vejo alertas de `Executing command "..." timed out.`? -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. +O Starship executa comandos diferentes para recuperar as informações para exibir no prompt, por exemplo a versão de um programa ou o status atual do git. Para ter certeza de que o starship não travou durante uma execução destes comandos nos definimos um limite de tempo, se um comando ultrapassar este limite o starship vai parar a execução do comando e exibe o alerta acima, esse é um comportamento esperado. Este limite de tempo é configurado usando o [`command_timeout` key](/config/#prompt) então se você quiser você pode aumentar este limite. Você pode também seguir os passos para debugar para ver qual comando esta demorando e se você pode otimizar ele. Finalmente você pode definir a variável de ambiente `STARSHIP_LOG` para `error` para esconder estes alertas. ## Eu vejo símbolos que não entendo ou não esperado, o que isso significa? 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? +## O Starship esta fazendo algo inesperado, como eu posso debugar? -You can enable the debug logs by using the `STARSHIP_LOG` env var. These logs can be very verbose so it is often useful to use the `module` command if you are trying to debug a particular module, for example, if you are trying to debug the `rust` module you could run the following command to get the trace logs and output from the module. +Você pode ativar os logs de debug usando a variavel de ambiente `STARSHIP_LOG`. Este logs podem ser bastantes verboso então é bastante útil usar o comando `module` se você esta tentando debugar um modulo em particular, por exemplo, se você esta tentando debugar o modulo `rust` você pode executar o seguinte comando para rastrear logs e saídas do modulo. ```sh -env STARHIP_LOG=trace starship module rust +env STARSHIP_LOG=trace starship module rust ``` -If starship is being slow you can try using the `timings` command to see if there is a particular module or command that to blame. +Se o starship começa a ficar lento você pode tentar usar o comando `timings` para ver se tem um modulo ou comando para culpar. ```sh -env STARHIP_LOG=trace starship timings +env STARSHIP_LOG=trace starship timings ``` -This will output the trace log and a breakdown of all modules that either took more than 1ms to execute or produced some output. +Isto vai retornar o rastreamento do log e um detalhamento de todos os módulos que levam mais que 1ms para executar ou produzir alguma saída. -Finally if you find a bug you can use the `bug-report` command to create a Github issue. +Finalmente se você quer procurar um bug você pode usar o comando `bug-report` para criar uma issue no Github. ```sh starship bug-report @@ -117,6 +117,6 @@ Se o Starship foi instalando usando algum gerenciador de pacotes, por favor cons Se o Starship foi instalado usando o script de instalação, o comando abaixo irá remover o binário: ```sh -# Localiza e deleta o binario do starship -sh -c 'rm "$(which starship)"' +# Locate and delete the starship binary +sh -c 'rm "$(command -v 'starship')"' ``` diff --git a/docs/pt-BR/guide/README.md b/docs/pt-BR/guide/README.md index 4da794550..f07bd4612 100644 --- a/docs/pt-BR/guide/README.md +++ b/docs/pt-BR/guide/README.md @@ -72,6 +72,22 @@ height="20" src="https://raw.githubusercontent.com/starship/starship/master/media/flag-fr.png" alt="Français" + /> +   + Bahasa Indonesia +   + Italiano   @@ -119,7 +119,7 @@ description: Starship is the minimal, blazing fast, and extremely customizable p #### Elvish - ::: warning Only elvish v0.15 or higher is supported. ::: + ::: warning Only elvish v0.17 or higher is supported. ::: Add the following to the end of `~/.elvish/rc.elv`: @@ -164,3 +164,14 @@ description: Starship is the minimal, blazing fast, and extremely customizable p execx($(starship init xonsh)) ``` + + + #### Cmd + + You need to use [Clink](https://chrisant996.github.io/clink/clink.html) (v1.2.30+) with Cmd. Add the following to a file `starship.lua` and place this file in Clink scripts directory: + + ```lua + -- starship.lua + + load(io.popen('starship init cmd'):read("*a"))() + ``` diff --git a/docs/pt-PT/advanced-config/README.md b/docs/pt-PT/advanced-config/README.md index 1bda2ae1a..f0f682a8a 100644 --- a/docs/pt-PT/advanced-config/README.md +++ b/docs/pt-PT/advanced-config/README.md @@ -8,6 +8,30 @@ The configurations in this section are subject to change in future releases of S ::: +## Custom pre-prompt and pre-execution Commands in Cmd + +Clink provides extremely flexible APIs to run pre-prompt and pre-exec commands in Cmd shell. It is fairly simple to use with Starship. Make the following changes to your `starship.lua` file as per your requirements: + +- To run a custom function right before the prompt is drawn, define a new function called `starship_preprompt_user_func`. This function receives the current prompt as a string that you can utilize. For example, to draw a rocket before the prompt, you would do + +```lua +function starship_preprompt_user_func(prompt) + print("🚀") +end + +load(io.popen('starship init cmd'):read("*a"))() +``` + +- To run a custom function right before a command is executed, define a new function called `starship_precmd_user_func`. This function receives the current commandline as a string that you can utilize. For example, to print the command that's about to be executed, you would do + +```lua +function starship_precmd_user_func(line) + print("Executing: "..line) +end + +load(io.popen('starship init cmd'):read("*a"))() +``` + ## Custom pre-prompt and pre-execution Commands in Bash Bash does not have a formal preexec/precmd framework like most other shells. Because of this, it is difficult to provide fully customizable hooks in `bash`. However, Starship does give you limited ability to insert your own functions into the prompt-rendering procedure: @@ -45,7 +69,7 @@ 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 even does it by default. Starship does not do this, but it's fairly straightforward to add this functionality to `bash`, `zsh`, `cmd` or `powershell`. First, define a window title change function (identical in bash and zsh): @@ -80,6 +104,16 @@ function set_win_title(){ starship_precmd_user_func="set_win_title" ``` +For Cmd, you can change the window title using the `starship_preprompt_user_func` function. + +```lua +function starship_preprompt_user_func(prompt) + console.settitle(os.getenv('USERNAME').."@"..os.getenv('COMPUTERNAME')..": "..os.getcwd()) +end + +load(io.popen('starship init cmd'):read("*a"))() +``` + You can also set a similar output with PowerShell by creating a function named `Invoke-Starship-PreCommand`. ```powershell @@ -97,7 +131,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). -`right_format` is currently supported for the following shells: elvish, fish, zsh. +`right_format` is currently supported for the following shells: elvish, fish, zsh, xonsh, cmd. ### Example @@ -117,6 +151,28 @@ Produces a prompt like the following: ▶ starship on  rprompt [!] is 📦 v0.57.0 via 🦀 v1.54.0 took 17s ``` +## Continuation Prompt + +Some shells support a continuation prompt along with the normal prompt. This prompt is rendered instead of the normal prompt when the user has entered an incomplete statement (such as a single left parenthesis or quote). + +Starship can set the continuation prompt using the `continuation_prompt` option. The default prompt is `"[∙](bright-black) "`. + +Note: `continuation_prompt` should be set to a literal string without any variables. + +Note: Continuation prompts are only available in the following shells: + + - `bash` + - `zsh` + - `PowerShell` + +### Example + +```toml +# ~/.config/starship.toml + +# A continuation prompt that displays two filled in arrows +continuation_prompt = "▶▶" +``` ## Style Strings diff --git a/docs/pt-PT/config/README.md b/docs/pt-PT/config/README.md index 7f953ab4b..2565504e2 100644 --- a/docs/pt-PT/config/README.md +++ b/docs/pt-PT/config/README.md @@ -24,13 +24,19 @@ disabled = true You can change default configuration file location with `STARSHIP_CONFIG` environment variable: ```sh -export STARSHIP_CONFIG=~/.starship/config.toml +export STARSHIP_CONFIG=~/example/non/default/path/starship.toml ``` Equivalently in PowerShell (Windows) would be adding this line to your `$PROFILE`: ```powershell -$ENV:STARSHIP_CONFIG = "$HOME\.starship\config.toml" +$ENV:STARSHIP_CONFIG = "$HOME\example\non\default\path\starship.toml" +``` + +Or for Cmd (Windows) would be adding this line to your `starship.lua`: + +```lua +os.setenv('STARSHIP_CONFIG', 'C:\\Users\\user\\example\\non\\default\\path\\starship.toml') ``` ### Logging @@ -47,6 +53,12 @@ Equivalently in PowerShell (Windows) would be adding this line to your `$PROFILE $ENV:STARSHIP_CACHE = "$HOME\AppData\Local\Temp" ``` +Or for Cmd (Windows) would be adding this line to your `starship.lua`: + +```lua +os.setenv('STARSHIP_CACHE', 'C:\\Users\\user\\AppData\\Local\\Temp') +``` + ### Terminology **Module**: A component in the prompt giving information based on contextual information from your OS. For example, the "nodejs" module shows the version of Node.js that is currently installed on your computer, if your current directory is a Node.js project. @@ -425,13 +437,13 @@ By default it only changes color. If you also want to change its shape take a lo ::: warning -`error_symbol` is not supported on elvish and nu shell. +`error_symbol` is not supported on nu shell. ::: ::: warning -`vicmd_symbol` is only supported in fish and zsh. +`vicmd_symbol` is only supported in cmd, fish and zsh. ::: @@ -568,7 +580,7 @@ Bash users who need preexec-like functionality can use [rcaloras's bash_preexec ::: tip -Showing desktop notifications requires starship to be built with `rust-notify` support. You check if your starship supports notifications by running `STARSHIP_LOG=debug starship module cmd_duration -d 60000` when `show_notifications` is set to `true`. +Showing desktop notifications requires starship to be built with `notify-rust` support. You check if your starship supports notifications by running `STARSHIP_LOG=debug starship module cmd_duration -d 60000` when `show_notifications` is set to `true`. ::: @@ -713,20 +725,20 @@ format = "via [🔰 $version](bold red) " ## Deno The `deno` module shows you your currently installed version of [Deno](https://deno.land/). By default the module will be shown if any of the following conditions are met: -- The current directory contains a `mod.ts`, `mod.js`, `deps.ts` or `deps.js` file +- The current directory contains a `deno.json`, `deno.jsonc`, `mod.ts`, `mod.js`, `deps.ts` or `deps.js` file ### Options -| Option | Default | Description | -| ------------------- | -------------------------------------------- | ------------------------------------------------------------------------- | -| `format` | `"via [$symbol($version )]($style)"` | The format for the module. | -| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | -| `symbol` | `"🦕 "` | A format string representing the symbol of Deno | -| `detect_extensions` | `[]` | Which extensions should trigger this module. | -| `detect_files` | `["mod.ts", "mod.js", "deps.ts", "deps.js"]` | Which filenames should trigger this module. | -| `detect_folders` | `[]` | Which folders should trigger this module. | -| `style` | `"green bold"` | The style for the module. | -| `disabled` | `false` | Disables the `deno` module. | +| Option | Default | Description | +| ------------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `format` | `"via [$symbol($version )]($style)"` | The format for the module. | +| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | +| `symbol` | `"🦕 "` | A format string representing the symbol of Deno | +| `detect_extensions` | `[]` | Which extensions should trigger this module. | +| `detect_files` | `["deno.json", "deno.jsonc", "mod.ts", "mod.js", "deps.ts", "deps.js"]` | Which filenames should trigger this module. | +| `detect_folders` | `[]` | Which folders should trigger this module. | +| `style` | `"green bold"` | The style for the module. | +| `disabled` | `false` | Disables the `deno` module. | ### Variables @@ -755,18 +767,19 @@ For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, an ### Options -| Option | Default | Description | -| ------------------- | -------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `truncation_length` | `3` | The number of parent folders that the current directory should be truncated to. | -| `truncate_to_repo` | `true` | Whether or not to truncate to the root of the git repo that you're currently in. | -| `format` | `"[$path]($style)[$read_only]($read_only_style) "` | The format for the module. | -| `style` | `"bold cyan"` | The style for the module. | -| `disabled` | `false` | Disables the `directory` module. | -| `read_only` | `"🔒"` | The symbol indicating current directory is read only. | -| `read_only_style` | `"red"` | The style for the read only symbol. | -| `truncation_symbol` | `""` | The symbol to prefix to truncated paths. eg: "…/" | -| `repo_root_style` | `None` | The style for the root of the git repo when `truncate_to_repo` option is set to false. | -| `home_symbol` | `"~"` | The symbol indicating home directory. | +| Option | Default | Description | +| ------------------- | -------------------------------------------------- | --------------------------------------------------------------------------------------- | +| `truncation_length` | `3` | The number of parent folders that the current directory should be truncated to. | +| `truncate_to_repo` | `true` | Whether or not to truncate to the root of the git repo that you're currently in. | +| `format` | `"[$path]($style)[$read_only]($read_only_style) "` | The format for the module. | +| `style` | `"bold cyan"` | The style for the module. | +| `disabled` | `false` | Disables the `directory` module. | +| `read_only` | `"🔒"` | The symbol indicating current directory is read only. | +| `read_only_style` | `"red"` | The style for the read only symbol. | +| `truncation_symbol` | `""` | The symbol to prefix to truncated paths. eg: "…/" | +| `repo_root_style` | `None` | The style for the root of the git repo when `truncate_to_repo` option is set to false. | +| `home_symbol` | `"~"` | The symbol indicating home directory. | +| `use_os_path_sep` | `true` | Use the OS specific path seperator instead of always using `/` (e.g. `\` on Windows) |
This module has a few advanced configuration options that control how the directory is displayed. @@ -1334,22 +1347,23 @@ The `git_status` module shows symbols representing the state of the repo in your ### Options -| Option | Default | Description | -| ------------ | ----------------------------------------------- | ----------------------------------- | -| `format` | `'([\[$all_status$ahead_behind\]]($style) )'` | The default format for `git_status` | -| `conflicted` | `"="` | This branch has merge conflicts. | -| `ahead` | `"⇡"` | The format of `ahead` | -| `behind` | `"⇣"` | The format of `behind` | -| `diverged` | `"⇕"` | The format of `diverged` | -| `up_to_date` | `""` | The format of `up_to_date` | -| `untracked` | `"?"` | The format of `untracked` | -| `stashed` | `"$"` | The format of `stashed` | -| `modified` | `"!"` | The format of `modified` | -| `staged` | `"+"` | The format of `staged` | -| `renamed` | `"»"` | The format of `renamed` | -| `deleted` | `"✘"` | The format of `deleted` | -| `style` | `"bold red"` | The style for the module. | -| `disabled` | `false` | Disables the `git_status` module. | +| Option | Default | Description | +| ------------------- | ----------------------------------------------- | ----------------------------------- | +| `format` | `'([\[$all_status$ahead_behind\]]($style) )'` | The default format for `git_status` | +| `conflicted` | `"="` | This branch has merge conflicts. | +| `ahead` | `"⇡"` | The format of `ahead` | +| `behind` | `"⇣"` | The format of `behind` | +| `diverged` | `"⇕"` | The format of `diverged` | +| `up_to_date` | `""` | The format of `up_to_date` | +| `untracked` | `"?"` | The format of `untracked` | +| `stashed` | `"$"` | The format of `stashed` | +| `modified` | `"!"` | The format of `modified` | +| `staged` | `"+"` | The format of `staged` | +| `renamed` | `"»"` | The format of `renamed` | +| `deleted` | `"✘"` | The format of `deleted` | +| `style` | `"bold red"` | The style for the module. | +| `ignore_submodules` | `false` | Ignore changes to submodules. | +| `disabled` | `false` | Disables the `git_status` module. | ### Variables @@ -1513,10 +1527,10 @@ The `hostname` module shows the system hostname. ### Variables -| Variable | Example | Description | -| --------- | ------- | ------------------------------------ | -| symbol | | Mirrors the value of option `symbol` | -| style\* | | Mirrors the value of option `style` | +| Variable | Example | Description | +| --------- | ---------- | ----------------------------------- | +| hostname | `computer` | The hostname of the computer | +| style\* | | Mirrors the value of option `style` | \*: This variable can only be used as a part of a style string @@ -2133,7 +2147,7 @@ symbol = "☁️ " ## Package Version -The `package` module is shown when the current directory is the repository for a package, and shows its current version. The module currently supports `npm`, `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`, `shards` and `dart` packages. - [**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 @@ -2150,6 +2164,7 @@ The `package` module is shown when the current directory is the repository for a - [**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 - [**SBT**](https://scala-sbt.org) - The `sbt` package version is extracted from the `build.sbt` present in the current directory +- [**Dart**](https://pub.dev/) - The `dart` package version is extracted from the `pubspec.yaml` 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. @@ -2673,6 +2688,8 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y | `elvish_indicator` | `esh` | A format string used to represent elvish. | | `tcsh_indicator` | `tsh` | A format string used to represent tcsh. | | `xonsh_indicator` | `xsh` | A format string used to represent xonsh. | +| `cmd_indicator` | `cmd` | A format string used to represent cmd. | +| `nu_indicator` | `nu` | A format string used to represent nu. | | `unknown_indicator` | | The default value to be displayed when the shell is unknown. | | `format` | `"[$indicator]($style) "` | The format for the module. | | `style` | `"white bold"` | The style for the module. | @@ -2778,7 +2795,7 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y ::: -::: warning This module is not supported on elvish and nu shell. ::: +::: warning This module is not supported on nu shell. ::: ### Options @@ -2804,6 +2821,7 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y | Variable | Example | Description | | -------------- | ------- | ------------------------------------------------------------------------------------------- | | status | `127` | The exit code of the last command | +| hex_status | `0x7F` | The exit code of the last command in hex | | int | `127` | The exit code of the last command | | common_meaning | `ERROR` | Meaning of the code if not a signal | | signal_number | `9` | Signal number corresponding to the exit code, only if signalled | diff --git a/docs/pt-PT/faq/README.md b/docs/pt-PT/faq/README.md index 8422ee2e3..99dd6bcc8 100644 --- a/docs/pt-PT/faq/README.md +++ b/docs/pt-PT/faq/README.md @@ -69,13 +69,13 @@ If you see symbols that you don't recognise you can use `starship explain` to ex You can enable the debug logs by using the `STARSHIP_LOG` env var. These logs can be very verbose so it is often useful to use the `module` command if you are trying to debug a particular module, for example, if you are trying to debug the `rust` module you could run the following command to get the trace logs and output from the module. ```sh -env STARHIP_LOG=trace starship module rust +env STARSHIP_LOG=trace starship module rust ``` If starship is being slow you can try using the `timings` command to see if there is a particular module or command that to blame. ```sh -env STARHIP_LOG=trace starship timings +env STARSHIP_LOG=trace starship timings ``` This will output the trace log and a breakdown of all modules that either took more than 1ms to execute or produced some output. @@ -118,5 +118,5 @@ If Starship was installed using the install script, the following command will d ```sh # Locate and delete the starship binary -sh -c 'rm "$(which starship)"' +sh -c 'rm "$(command -v 'starship')"' ``` diff --git a/docs/pt-PT/guide/README.md b/docs/pt-PT/guide/README.md index fb4093b57..88ac88719 100644 --- a/docs/pt-PT/guide/README.md +++ b/docs/pt-PT/guide/README.md @@ -72,6 +72,22 @@ height="20" src="https://raw.githubusercontent.com/starship/starship/master/media/flag-fr.png" alt="Français" + /> +   + Bahasa Indonesia +   + Italiano   @@ -119,7 +119,7 @@ description: Starship - минимальная, быстрая и бесконе #### Elvish - ::: warning Only elvish v0.15 or higher is supported. ::: + ::: warning Only elvish v0.17 or higher is supported. ::: Добавьте следующую строку в конец `~/.elvish/rc.elv`: @@ -164,3 +164,14 @@ description: Starship - минимальная, быстрая и бесконе execx($(starship init xonsh)) ``` + + + #### Cmd + + You need to use [Clink](https://chrisant996.github.io/clink/clink.html) (v1.2.30+) with Cmd. Add the following to a file `starship.lua` and place this file in Clink scripts directory: + + ```lua + -- starship.lua + + load(io.popen('starship init cmd'):read("*a"))() + ``` diff --git a/docs/ru-RU/advanced-config/README.md b/docs/ru-RU/advanced-config/README.md index b3821b123..edcec7f37 100644 --- a/docs/ru-RU/advanced-config/README.md +++ b/docs/ru-RU/advanced-config/README.md @@ -8,11 +8,35 @@ ::: -## Пользовательские команды перед командной строкой и перед запуском Bash +## Custom pre-prompt and pre-execution Commands in Cmd -Bash не имеет формальной среды preexec/precmd, как и большинство других оболочек. Из-за этого трудно предоставить полностью настраиваемые хуки в `bash`. Тем не менее, Starship дает вам ограниченную возможность вставить собственные функции в процедуру отображения подсказки: +Clink provides extremely flexible APIs to run pre-prompt and pre-exec commands in Cmd shell. It is fairly simple to use with Starship. Make the following changes to your `starship.lua` file as per your requirements: -- Чтобы запустить пользовательскую функцию прямо перед отображением подсказки, определите новую функцию и затем назначьте ей имя `starship_precmd_user_func`. Например, чтобы нарисовать ракету перед появлением подсказки, сделайте +- To run a custom function right before the prompt is drawn, define a new function called `starship_preprompt_user_func`. This function receives the current prompt as a string that you can utilize. For example, to draw a rocket before the prompt, you would do + +```lua +function starship_preprompt_user_func(prompt) + print("🚀") +end + +load(io.popen('starship init cmd'):read("*a"))() +``` + +- To run a custom function right before a command is executed, define a new function called `starship_precmd_user_func`. This function receives the current commandline as a string that you can utilize. For example, to print the command that's about to be executed, you would do + +```lua +function starship_precmd_user_func(line) + print("Executing: "..line) +end + +load(io.popen('starship init cmd'):read("*a"))() +``` + +## Custom pre-prompt and pre-execution Commands in Bash + +Bash does not have a formal preexec/precmd framework like most other shells. Because of this, it is difficult to provide fully customizable hooks in `bash`. Тем не менее, Starship дает вам ограниченную возможность вставить собственные функции в процедуру отображения подсказки: + +- To run a custom function right before the prompt is drawn, define a new function and then assign its name to `starship_precmd_user_func`. For example, to draw a rocket before the prompt, you would do ```bash function blastoff(){ @@ -21,7 +45,7 @@ function blastoff(){ starship_precmd_user_func="blastoff" ``` -- To run a custom function right before a command runs, you can use the [`DEBUG` trap mechanism](https://jichu4n.com/posts/debug-trap-and-prompt_command-in-bash/). Тем не менее, вы **должны** поймать сигнал DEBUG *перед* инициализацией Starship! Starship может сохранить значение ловушки DEBUG, но если ловушка перезаписана после запуска Starship, некоторая функциональность сломается. +- To run a custom function right before a command runs, you can use the [`DEBUG` trap mechanism](https://jichu4n.com/posts/debug-trap-and-prompt_command-in-bash/). However, you **must** trap the DEBUG signal *before* initializing Starship! Starship can preserve the value of the DEBUG trap, but if the trap is overwritten after starship starts up, some functionality will break. ```bash function blastoff(){ @@ -43,11 +67,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 даже делает это по умолчанию. Starship не делает этого, но достаточно легко добавить эту функциональность к `bash` или `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`, `zsh`, `cmd` or `powershell`. -Сначала задайте функцию изменения заголовка окна (идентичную в bash и zsh): +First, define a window title change function (identical in bash and zsh): ```bash function set_win_title(){ @@ -55,15 +79,15 @@ function set_win_title(){ } ``` -Вы можете использовать переменные для настройки этого заголовка (`$USER`, `$HOSTNAME`, и `$PWD` являются популярными вариантами). +You can use variables to customize this title (`$USER`, `$HOSTNAME`, and `$PWD` are popular choices). -В `bash`, установите эту функцию как функцию precmd в Starship: +In `bash`, set this function to be the precmd starship function: ```bash starship_precmd_user_func="set_win_title" ``` -В `zsh`, добавьте это в массив `precmd_functions`: +In `zsh`, add this to the `precmd_functions` array: ```bash precmd_functions+=(set_win_title) @@ -71,7 +95,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. -Например, если вы хотите отобразить ваш текущий каталог в заголовке вкладки терминала, добавьте следующие строки в `~/. 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`: ```bash function set_win_title(){ @@ -80,6 +104,16 @@ function set_win_title(){ starship_precmd_user_func="set_win_title" ``` +For Cmd, you can change the window title using the `starship_preprompt_user_func` function. + +```lua +function starship_preprompt_user_func(prompt) + console.settitle(os.getenv('USERNAME').."@"..os.getenv('COMPUTERNAME')..": "..os.getcwd()) +end + +load(io.popen('starship init cmd'):read("*a"))() +``` + You can also set a similar output with PowerShell by creating a function named `Invoke-Starship-PreCommand`. ```powershell @@ -97,7 +131,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). -`right_format` is currently supported for the following shells: elvish, fish, zsh. +`right_format` is currently supported for the following shells: elvish, fish, zsh, xonsh, cmd. ### Пример @@ -117,10 +151,32 @@ Produces a prompt like the following: ▶ starship on  rprompt [!] is 📦 v0.57.0 via 🦀 v1.54.0 took 17s ``` +## Continuation Prompt + +Some shells support a continuation prompt along with the normal prompt. This prompt is rendered instead of the normal prompt when the user has entered an incomplete statement (such as a single left parenthesis or quote). + +Starship can set the continuation prompt using the `continuation_prompt` option. The default prompt is `"[∙](bright-black) "`. + +Note: `continuation_prompt` should be set to a literal string without any variables. + +Note: Continuation prompts are only available in the following shells: + + - `bash` + - `zsh` + - `PowerShell` + +### Пример + +```toml +# ~/.config/starship.toml + +# A continuation prompt that displays two filled in arrows +continuation_prompt = "▶▶" +``` ## Строки стиля -Строки стиля - это список слов, разделенных пробелами. Слова не чувствительны к регистру (то есть `bold` и `BoLd` считаются одной строкой). Каждое слово может быть одним из следующих: +Style strings are a list of words, separated by whitespace. The words are not case sensitive (i.e. `bold` and `BoLd` are considered the same string). Each word can be one of the following: - `bold` - `italic` @@ -132,14 +188,14 @@ Produces a prompt like the following: - `` - `none` -где `` является цветовым спецификатором (обсуждается ниже). `fg:` and `` currently do the same thing, though this may change in the future. `inverted` swaps the background and foreground colors. Порядок слов в строке не имеет значения. +where `` is a color specifier (discussed below). `fg:` and `` 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. -Токен `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` в сочетании с другими токенами может стать ошибкой в будущем. +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. -Цветовой спецификатор может быть одним из следующих: +A color specifier can be one of the following: - - Некоторые из стандартных цветов терминалов: `black`, `red`, `green`, `blue`, `gellow`, `purple`, `cyan`, `white`. Вы можете по желанию добавить префикс `bright-`, чтобы получить яркую версию (например, `bright-white`). - - `#`, за которой следует шестизначное шестнадцатеричное число. Это определяет [шестнадцатеричный код цвета RGB](https://www.w3schools.com/colors/colors_hexadecimal.asp). - - Число от 0 до 255. Это определяет [8-битный код цвета ANSI](https://i.stack.imgur.com/KTSQa.png). + - One of the standard terminal colors: `black`, `red`, `green`, `blue`, `yellow`, `purple`, `cyan`, `white`. You can optionally prefix these with `bright-` to get the bright version (e.g. `bright-white`). + - A `#` followed by a six-digit hexadecimal number. This specifies an [RGB color hex code](https://www.w3schools.com/colors/colors_hexadecimal.asp). + - A number between 0-255. This specifies an [8-bit ANSI Color Code](https://i.stack.imgur.com/KTSQa.png). -Если для переднего плана/фона задано несколько цветов, то последняя из строк будет иметь приоритет. +If multiple colors are specified for foreground/background, the last one in the string will take priority. diff --git a/docs/ru-RU/config/README.md b/docs/ru-RU/config/README.md index 18dc696c1..ecb834880 100644 --- a/docs/ru-RU/config/README.md +++ b/docs/ru-RU/config/README.md @@ -24,18 +24,24 @@ disabled = true You can change default configuration file location with `STARSHIP_CONFIG` environment variable: ```sh -export STARSHIP_CONFIG=~/.starship/config.toml +export STARSHIP_CONFIG=~/example/non/default/path/starship.toml ``` Аналогично в PowerShell (Windows) следует добавить эту строку в `$PROFILE`: ```powershell -$ENV:STARSHIP_CONFIG = "$HOME\.starship\config.toml" +$ENV:STARSHIP_CONFIG = "$HOME\example\non\default\path\starship.toml" +``` + +Or for Cmd (Windows) would be adding this line to your `starship.lua`: + +```lua +os.setenv('STARSHIP_CONFIG', 'C:\\Users\\user\\example\\non\\default\\path\\starship.toml') ``` ### Логгирование (Запись действий) -По умолчанию в starship записываются предупреждения и ошибки в файл с именем `~/.cache/starship/session_${STARSHIP_SESSION_KEY}.log`, где ключ сессии соответствует экземпляру терминала. Это, однако, может быть изменено с помощью переменной окружения `STARSHIP_CACHE`: +By default starship logs warnings and errors into a file named `~/.cache/starship/session_${STARSHIP_SESSION_KEY}.log`, where the session key is corresponding to a instance of your terminal. This, however can be changed using the `STARSHIP_CACHE` environment variable: ```sh export STARSHIP_CACHE=~/.starship/cache @@ -47,23 +53,29 @@ export STARSHIP_CACHE=~/.starship/cache $ENV:STARSHIP_CACHE = "$HOME\AppData\Local\Temp" ``` +Or for Cmd (Windows) would be adding this line to your `starship.lua`: + +```lua +os.setenv('STARSHIP_CACHE', 'C:\\Users\\user\\AppData\\Local\\Temp') +``` + ### Терминология -**Модуль**: Компонент строки, дающий информацию на основе контекстной информации вашей ОС. For example, the "nodejs" module shows the version of Node.js that is currently installed on your computer, if your current directory is a Node.js project. +**Module**: A component in the prompt giving information based on contextual information from your OS. For example, the "nodejs" module shows the version of Node.js that is currently installed on your computer, if your current directory is a Node.js project. **Variable**: Smaller sub-components that contain information provided by the module. For example, the "version" variable in the "nodejs" module contains the current version of Node.js. -По традициям, большинство модулей имеют префикс цвета терминала по умолчанию (например, `через` в "узлах") и пустое пространство как суффикс. +By convention, most modules have a prefix of default terminal color (e.g. `via` in "nodejs") and an empty space as a suffix. ### Форматирование строк -Формат строк - это формат, с которым модуль печатает все переменные. Большинство модулей имеют запись `формата`, который настраивает формат отображения модуля. Вы можете использовать тексты, переменные и группы текста в строке формата. +Format strings are the format that a module prints all its variables with. Most modules have an entry called `format` that configures the display format of the module. You can use texts, variables and text groups in a format string. #### Переменная -Переменная содержит символ `$`, за которым следует имя переменной. The name of a variable can only contain 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: - `$version` это строка формата с именем `версии`. - `$git_branch$git_commit` это строка формата с двумя переменными `git_branch` и `git_commit`. @@ -71,13 +83,13 @@ $ENV:STARSHIP_CACHE = "$HOME\AppData\Local\Temp" #### Группа текста -Текстовая группа состоит из двух различных частей. +A text group is made up of two different parts. -Первая часть, которая заключена в `[]`, это [формат строки](#format-strings). Вы можете добавлять в него тексты, переменные, или даже вложенные текстовые группы. +The first part, which is enclosed in a `[]`, is a [format string](#format-strings). You can add texts, variables, or even nested text groups in it. -Во второй части, которая заключена в `()`, это строка стиля [](#style-strings). This can be used to style the first part. +In the second part, which is enclosed in a `()`, is a [style string](#style-strings). This can be used to style the first part. -Например: +For example: - `[on](red bold)` будет печатать строку `on` жирным текстом красного цвета. - `[⌘ $version](bold green)` will print a symbol `⌘` followed by the content of variable `version`, with bold text colored green. @@ -85,7 +97,7 @@ $ENV:STARSHIP_CACHE = "$HOME\AppData\Local\Temp" #### Строки стиля -В Starship, большинство модулей позволяют настроить стили отображения. Это делается записью (обычно называется `style`), которая представляет собой строку, определяющую конфигурацию. Ниже приведены несколько примеров стилей строк, а также, их действия. Подробнее о полном синтаксисе можно прочитать в [расширенном разделе конфигурации](/advanced-config/). +Most modules in starship allow you to configure their display styles. This is done with an entry (usually called `style`) which is a string specifying the configuration. Here are some examples of style strings along with what they do. For details on the full syntax, consult the [advanced config guide](/advanced-config/). - `"fg:green bg:blue"` устанавливает зеленый текст на синем фоне - `"bg:blue fg:bright-green"` устанавливает ярко-зеленый текст на синем фоне @@ -94,13 +106,13 @@ $ENV:STARSHIP_CACHE = "$HOME\AppData\Local\Temp" - `"bold italic fg:purple"` устанавливает жирный фиолетовый текст - `""` выключает все стили -Обратите внимание на то, что, вид стиля зависит от вашего эмулятора терминала. Например, некоторые эмуляторы терминала будут использовать яркие цвета вместо жирного текста, и некоторые цветовые темы используют одинаковые значение для обычных и ярких цветов. Также, чтобы получить курсивный текст, ваш терминал должен поддерживать курсив. +Note that what styling looks like will be controlled by your terminal emulator. For example, some terminal emulators will brighten the colors instead of bolding text, and some color themes use the same values for the normal and bright colors. Also, to get italic text, your terminal must support italics. #### Строки условного формата -Строка условного формата, завернутая в `(` и `)` не будет отображаться, если все переменные внутри являются пустыми. +A conditional format string wrapped in `(` and `)` will not render if all variables inside are empty. -Например: +For example: - `(@$region)` will show nothing if the variable `region` is `None` or empty string, otherwise `@` followed by the value of region. - `(некоторый текст)` всегда не показывает ничего, поскольку в скобках нет переменных. @@ -112,18 +124,18 @@ 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 `\\`). -Например, когда вы хотите напечатать символ `$` на новой строке, следующие настройки для `формата` эквивалентны: +For example, when you want to print a `$` symbol on a new line, the following configs for `format` are equivalent: ```toml -# с базовой строкой +# with basic string format = "\n\\$" -# с многолинейной строкой +# with multiline basic string format = """ \\$""" -# со строкой, состоящей из литералов +# with literal string format = ''' \$''' @@ -131,7 +143,7 @@ format = ''' ## Командная строка -Ниже находится список опций, применяющихся для всей командной строки. +This is the list of prompt-wide configuration options. ### Опции @@ -149,13 +161,13 @@ format = ''' ```toml # ~/.config/starship.toml -# Собственное форматирование оболочки +# Use custom format format = """ [┌───────────────────>](bold green) [│](bold green)$directory$rust$package [└─>](bold green) """ -# Подождите 10 милисекунд пока starship прочитает файлы в этой директории. +# Wait 10 milliseconds for starship to check files under the current directory. scan_timeout = 10 # Disable the blank line at the start of the prompt @@ -164,7 +176,7 @@ add_newline = false ### Формат оболочки по умолчанию -Формат по умолчанию `format` используется для определения формата подсказки (prompt), если `format` пустой или отсутствует. Значение по умолчанию: +The default `format` is used to define the format of the prompt, if empty or no `format` is provided. The default is as shown: ```toml format = "$all" @@ -248,7 +260,7 @@ format="$all$directory$character" ## AWS -Модуль `aws` показывает текущий регион и профиль AWS. Основано на `AWS_REGION`, `AWS_DEFAULT_REGION`, и `AWS_PROFILE` переменных окружения и файле`~/.aws/config`. This module also shows an expiration timer when using temporary credentials. +The `aws` module shows the current AWS region and profile. This is based on `AWS_REGION`, `AWS_DEFAULT_REGION`, and `AWS_PROFILE` env var with `~/.aws/config` file. This module also shows an expiration timer when using temporary credentials. When using [aws-vault](https://github.com/99designs/aws-vault) the profile is read from the `AWS_VAULT` env var and the credentials expiration date is read from the `AWS_SESSION_EXPIRATION` env var. @@ -347,7 +359,7 @@ style = "blue bold" ## Батарея -Модуль `battery` показывает насколько заряжена батарея девайса и статус зарядки на данный момент. Модуль виден только, если заряд батареи устройства меньше 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%. ### Опции @@ -375,7 +387,7 @@ discharging_symbol = "💀 " ### Отображение батареи -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. The default is as shown: ```toml [[battery.display]] @@ -387,7 +399,7 @@ The default value for the `charging_symbol` and `discharging_symbol` option is r #### Опции -Опция `display` представляет собой массив следующей таблицы. +The `display` option is an array of the following table. | Параметр | По умолчанию | Описание | | -------------------- | ------------ | --------------------------------------------------------------------------------------------------------- | @@ -414,9 +426,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 shape (`❯`/`✖`) @@ -425,13 +437,13 @@ By default it only changes color. If you also want to change its shape take a lo ::: warning -`error_symbol` is not supported on elvish and nu shell. +`error_symbol` is not supported on nu shell. ::: ::: warning -`vicmd_symbol` is only supported in fish and zsh. +`vicmd_symbol` is only supported in cmd, fish and zsh. ::: @@ -544,15 +556,15 @@ 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. -::: предупреждение Не подключайте ловушку DEBUG к Bash +::: warning Do not hook the DEBUG trap in Bash -Если вы испоьзуете Starship в `bash`, не подключайте ловушку `DEBUG` после запуска `eval $(starship init $0)`, иначе этот модуль сломается. +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, которым нужна функциональность, подобная preexec, могут использовать [фреймворк bash_preexec от rcaloras](https://github.com/rcaloras/bash-preexec). Просто определите массивы `preexec_functions` и `precmd_functions` перед запуском `eval $(starship init $0)`, а затем продолжайте нормально. +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. ### Опции @@ -566,9 +578,9 @@ The `cobol` module shows the currently installed version of COBOL. By default, t | `show_notifications` | `false` | Show desktop notifications when command completes. | | `min_time_to_notify` | `45_000` | Shortest duration for notification (in milliseconds). | -::: tip Подсказка +::: tip -Showing desktop notifications requires starship to be built with `rust-notify` support. You check if your starship supports notifications by running `STARSHIP_LOG=debug starship module cmd_duration -d 60000` when `show_notifications` is set to `true`. +Showing desktop notifications requires starship to be built with `notify-rust` support. You check if your starship supports notifications by running `STARSHIP_LOG=debug starship module cmd_duration -d 60000` when `show_notifications` is set to `true`. ::: @@ -595,9 +607,9 @@ format = "underwent [$duration](bold yellow)" The `conda` module shows the current [Conda](https://docs.conda.io/en/latest/) environment, if `$CONDA_DEFAULT_ENV` is set. -::: 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`. ::: @@ -713,20 +725,20 @@ format = "via [🔰 $version](bold red) " ## Deno The `deno` module shows you your currently installed version of [Deno](https://deno.land/). By default the module will be shown if any of the following conditions are met: -- Текущий каталог содержит файл `mod.ts`, `mod.js`, `deps.ts` или `deps.js` +- The current directory contains a `deno.json`, `deno.jsonc`, `mod.ts`, `mod.js`, `deps.ts` or `deps.js` file ### Опции -| Параметр | По умолчанию | Описание | -| ------------------- | -------------------------------------------- | ------------------------------------------------------------------------- | -| `format` | `"via [$symbol($version )]($style)"` | Формат модуля. | -| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | -| `symbol` | `"🦕 "` | A format string representing the symbol of Deno | -| `detect_extensions` | `[]` | Which extensions should trigger this module. | -| `detect_files` | `["mod.ts", "mod.js", "deps.ts", "deps.js"]` | Which filenames should trigger this module. | -| `detect_folders` | `[]` | Which folders should trigger this module. | -| `style` | `"green bold"` | Стиль модуля. | -| `disabled` | `false` | Disables the `deno` module. | +| Параметр | По умолчанию | Описание | +| ------------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `format` | `"via [$symbol($version )]($style)"` | Формат модуля. | +| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | +| `symbol` | `"🦕 "` | A format string representing the symbol of Deno | +| `detect_extensions` | `[]` | Which extensions should trigger this module. | +| `detect_files` | `["deno.json", "deno.jsonc", "mod.ts", "mod.js", "deps.ts", "deps.js"]` | Which filenames should trigger this module. | +| `detect_folders` | `[]` | Which folders should trigger this module. | +| `style` | `"green bold"` | Стиль модуля. | +| `disabled` | `false` | Disables the `deno` module. | ### Переменные @@ -747,29 +759,30 @@ 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, вместо скрытия усеченного каталога, вы увидите укороченное имя каталога, зависимое от числа символов вы установите для этой опции. +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`. ### Опции -| Параметр | По умолчанию | Описание | -| ------------------- | -------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `truncation_length` | `3` | Количество родительских папок, к которым должен быть усечен текущий каталог. | -| `truncate_to_repo` | `true` | Следует или нет обрезать до корня репозитория git, в котором вы находитесь. | -| `format` | `"[$path]($style)[$read_only]($read_only_style) "` | Формат модуля. | -| `style` | `"bold cyan"` | Стиль модуля. | -| `disabled` | `false` | Отключает модуль `directory`. | -| `read_only` | `"🔒"` | The symbol indicating current directory is read only. | -| `read_only_style` | `"red"` | The style for the read only symbol. | -| `truncation_symbol` | `""` | The symbol to prefix to truncated paths. eg: "…/" | -| `repo_root_style` | `None` | The style for the root of the git repo when `truncate_to_repo` option is set to false. | -| `home_symbol` | `"~"` | The symbol indicating home directory. | +| Параметр | По умолчанию | Описание | +| ------------------- | -------------------------------------------------- | --------------------------------------------------------------------------------------- | +| `truncation_length` | `3` | Количество родительских папок, к которым должен быть усечен текущий каталог. | +| `truncate_to_repo` | `true` | Следует или нет обрезать до корня репозитория git, в котором вы находитесь. | +| `format` | `"[$path]($style)[$read_only]($read_only_style) "` | Формат модуля. | +| `style` | `"bold cyan"` | Стиль модуля. | +| `disabled` | `false` | Отключает модуль `directory`. | +| `read_only` | `"🔒"` | The symbol indicating current directory is read only. | +| `read_only_style` | `"red"` | The style for the read only symbol. | +| `truncation_symbol` | `""` | The symbol to prefix to truncated paths. eg: "…/" | +| `repo_root_style` | `None` | The style for the root of the git repo when `truncate_to_repo` option is set to false. | +| `home_symbol` | `"~"` | The symbol indicating home directory. | +| `use_os_path_sep` | `true` | Use the OS specific path seperator instead of always using `/` (e.g. `\` on Windows) |
-Этот модуль имеет несколько расширенных опций конфигурации, которые контролируют отображение каталога. +This module has a few advanced configuration options that control how the directory is displayed. | Advanced Option | По умолчанию | Описание | | --------------------------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -785,7 +798,7 @@ format = "via [🦕 $version](green bold) " "src/com/long/java/path" = "mypath" ``` -`fish_style_pwd_dir_length` взаимодействует со стандартными параметрами усечения, которые могут сначала показаться странными: если он не равен нулю, элементы пути, который обычно усекается, вместо этого отображаются с указанным количеством символов. For example, the path `/built/this/city/on/rock/and/roll`, which would normally be displayed as as `rock/and/roll`, would be displayed as `/b/t/c/o/rock/and/roll` with `fish_style_pwd_dir_length = 1`--the path components that would normally be removed are displayed with a single character. For `fish_style_pwd_dir_length = 2`, it would be `/bu/th/ci/on/rock/and/roll`. +`fish_style_pwd_dir_length` interacts with the standard truncation options in a way that can be surprising at first: if it's non-zero, the components of the path that would normally be truncated are instead displayed with that many characters. For example, the path `/built/this/city/on/rock/and/roll`, which would normally be displayed as as `rock/and/roll`, would be displayed as `/b/t/c/o/rock/and/roll` with `fish_style_pwd_dir_length = 1`--the path components that would normally be removed are displayed with a single character. For `fish_style_pwd_dir_length = 2`, it would be `/bu/th/ci/on/rock/and/roll`.
@@ -846,7 +859,7 @@ format = "via [🐋 $context](blue bold)" ## 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: @@ -861,7 +874,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. -Внутренне этот модуль использует свой собственный механизм определения версий. Обычно он в два раза быстрее, чем `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 () when there is a csproj file in the current directory. @@ -984,7 +997,7 @@ 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` соответствует существующей переменной среды - Опция `variable` не определена, но определена опция `default` @@ -1174,7 +1187,7 @@ asia-northeast1 = "an1" ## Ветвь Git -Модуль `git_branch` показывает активную ветку репозитория в вашем текущей директории. +The `git_branch` module shows the active branch of the repo in your current directory. ### Опции @@ -1249,7 +1262,7 @@ tag_symbol = "🔖 " ## Состояние Git -Модуль `git_state` будет отображаться в директориях, являющимися частью репозитория git, и там, где выполняется операция, такие как: _REBASING_, _BISECTING_, и т. д. Если есть информация о прогрессе (например, REBASING 3/10), эта информация также будет показана. +The `git_state` module will show in directories which are part of a git repository, and where there is an operation in progress, such as: _REBASING_, _BISECTING_, etc. If there is progress information (e.g., REBASING 3/10), that information will be shown too. ### Опции @@ -1291,9 +1304,9 @@ cherry_pick = "[🍒 PICKING](bold red)" The `git_metrics` module will show the number of added and deleted lines in the current git repository. -::: tip Подсказка +::: tip -По умолчанию этот модуль отключен. Чтобы включить его, установите `disabled` на `false` в файле конфигурации. +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: @@ -1330,26 +1343,27 @@ format = '[+$added]($added_style)/[-$deleted]($deleted_style) ' ## Статус Git -Модуль `git_status` отображает символы, представляющие состояние репозитория в вашей текущей директории. +The `git_status` module shows symbols representing the state of the repo in your current directory. ### Опции -| Параметр | По умолчанию | Описание | -| ------------ | ----------------------------------------------- | ----------------------------------- | -| `format` | `'([\[$all_status$ahead_behind\]]($style) )'` | The default format for `git_status` | -| `conflicted` | `"="` | Эта ветка имеет конфликты слияния. | -| `ahead` | `"⇡"` | The format of `ahead` | -| `behind` | `"⇣"` | The format of `behind` | -| `diverged` | `"⇕"` | The format of `diverged` | -| `up_to_date` | `""` | The format of `up_to_date` | -| `untracked` | `"?"` | The format of `untracked` | -| `stashed` | `"$"` | The format of `stashed` | -| `modified` | `"!"` | The format of `modified` | -| `staged` | `"+"` | The format of `staged` | -| `renamed` | `"»"` | The format of `renamed` | -| `deleted` | `"✘"` | The format of `deleted` | -| `style` | `"bold red"` | Стиль модуля. | -| `disabled` | `false` | Отключает модуль `git_status`. | +| Параметр | По умолчанию | Описание | +| ------------------- | ----------------------------------------------- | ----------------------------------- | +| `format` | `'([\[$all_status$ahead_behind\]]($style) )'` | The default format for `git_status` | +| `conflicted` | `"="` | Эта ветка имеет конфликты слияния. | +| `ahead` | `"⇡"` | The format of `ahead` | +| `behind` | `"⇣"` | The format of `behind` | +| `diverged` | `"⇕"` | The format of `diverged` | +| `up_to_date` | `""` | The format of `up_to_date` | +| `untracked` | `"?"` | The format of `untracked` | +| `stashed` | `"$"` | The format of `stashed` | +| `modified` | `"!"` | The format of `modified` | +| `staged` | `"+"` | The format of `staged` | +| `renamed` | `"»"` | The format of `renamed` | +| `deleted` | `"✘"` | The format of `deleted` | +| `style` | `"bold red"` | Стиль модуля. | +| `ignore_submodules` | `false` | Ignore changes to submodules. | +| `disabled` | `false` | Disables the `git_status` module. | ### Переменные @@ -1402,7 +1416,7 @@ renamed = "👅" deleted = "🗑" ``` -Показывать счетчик впереди/позади для отслеживаемой ветки +Show ahead/behind count of the branch being tracked ```toml # ~/.config/starship.toml @@ -1499,7 +1513,7 @@ format = "via [⎈ $version](bold white) " ## Имя хоста -Модуль `hostname` отображает имя системного хоста. +The `hostname` module shows the system hostname. ### Опции @@ -1513,10 +1527,10 @@ format = "via [⎈ $version](bold white) " ### Переменные -| Переменная | Пример | Описание | -| ---------- | ------ | ------------------------------------ | -| symbol | | Отражает значение параметра `symbol` | -| style\* | | Отражает значение параметра `style` | +| Переменная | Пример | Описание | +| ---------- | ---------- | ----------------------------------- | +| hostname | `computer` | The hostname of the computer | +| style\* | | Отражает значение параметра `style` | \*: Эта переменная может использоваться только в качестве части строки style @@ -1573,7 +1587,7 @@ symbol = "🌟 " ## Задачи -Модуль `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: @@ -1720,9 +1734,9 @@ kotlin_binary = "kotlinc" Displays the current [Kubernetes context](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#context) name and, if set, the namespace from the kubeconfig file. The namespace needs to be set in the kubeconfig file, this can be done via `kubectl config set-context starship-cluster --namespace astronaut`. If the `$KUBECONFIG` env var is set the module will use that if not it will use the `~/.kube/config`. -::: tip Подсказка +::: tip -По умолчанию этот модуль отключен. Чтобы включить его, установите `disabled` на `false` в файле конфигурации. +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: @@ -1784,7 +1798,7 @@ Long and automatically generated cluster names can be identified and shortened u ## Перевод Строки -Модуль `line_break` разделяет командную строку на две строки. +The `line_break` module separates the prompt into two lines. ### Опции @@ -1844,13 +1858,13 @@ format = "via [🌕 $version](bold blue) " ## Использование памяти -Модуль `memory_usage` отображает текущую системную память и использование подкачки. +The `memory_usage` module shows current system memory and swap usage. -По умолчанию использование подкачки отображается, если общая сумма подкачки системы не равна нулю. +By default the swap usage is displayed if the total system swap is non-zero. -::: tip Подсказка +::: tip -По умолчанию этот модуль отключен. Чтобы включить его, установите `disabled` на `false` в файле конфигурации. +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: @@ -1891,7 +1905,7 @@ style = "bold dimmed green" ## Ветка Mercurial -Модуль `hg_branch` показывает активную ветку репозитория в вашем текущем каталоге. +The `hg_branch` module shows the active branch of the repo in your current directory. ### Опции @@ -1969,7 +1983,7 @@ symbol = "🎣 " ## 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. ### Опции @@ -2133,7 +2147,7 @@ symbol = "☁️ " ## Версия пакета -Модуль `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`, `shards` and `dart` packages. - [**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 @@ -2150,6 +2164,7 @@ symbol = "☁️ " - [**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 - [**SBT**](https://scala-sbt.org) - The `sbt` package version is extracted from the `build.sbt` present in the current directory +- [**Dart**](https://pub.dev/) - The `dart` package version is extracted from the `pubspec.yaml` present in the current directory > ⚠ Показана версия пакета, исходный код которого находится в текущем каталоге, а не в менеджере пакетов. @@ -2267,7 +2282,7 @@ format = "via [🔹 $version](147 bold) " The `pulumi` module shows the currently selected [Pulumi Stack](https://www.pulumi.com/docs/intro/concepts/stack/) and version. -::: tip Подсказка +::: tip By default the Pulumi version is not shown, since it takes an order of magnitude longer to load then most plugins (~70ms). If you still want to enable it, [follow the example shown below](#with-pulumi-version). @@ -2393,7 +2408,7 @@ By default the module will be shown if any of the following conditions are met: | `detect_folders` | `[]` | Which folders should trigger this module | | `disabled` | `false` | Disables the `python` module. | -::: tip Подсказка +::: tip The `python_binary` variable accepts either a string or a list of strings. Starship will try executing each binary until it gets a result. Note you can only change the binary that Starship executes to get the version of Python not the arguments that are used. @@ -2655,9 +2670,9 @@ symbol = "🌟 " 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. ::: @@ -2673,6 +2688,8 @@ The `shell` module shows an indicator for currently used shell. | `elvish_indicator` | `esh` | A format string used to represent elvish. | | `tcsh_indicator` | `tsh` | A format string used to represent tcsh. | | `xonsh_indicator` | `xsh` | A format string used to represent xonsh. | +| `cmd_indicator` | `cmd` | A format string used to represent cmd. | +| `nu_indicator` | `nu` | A format string used to represent nu. | | `unknown_indicator` | | The default value to be displayed when the shell is unknown. | | `format` | `"[$indicator]($style) "` | Формат модуля. | | `style` | `"white bold"` | Стиль модуля. | @@ -2772,13 +2789,13 @@ format = '[📦 \[$env\]]($style) ' The `status` module displays the exit code of the previous command. The module will be shown only if the exit code is not `0`. -::: tip Подсказка +::: tip -По умолчанию этот модуль отключен. Чтобы включить его, установите `disabled` на `false` в файле конфигурации. +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: -::: warning This module is not supported on elvish and nu shell. ::: +::: warning This module is not supported on nu shell. ::: ### Опции @@ -2804,6 +2821,7 @@ The `status` module displays the exit code of the previous command. The module w | Переменная | Пример | Описание | | -------------- | ------- | ------------------------------------------------------------------------------------------- | | status | `127` | The exit code of the last command | +| hex_status | `0x7F` | The exit code of the last command in hex | | int | `127` | The exit code of the last command | | common_meaning | `ERROR` | Meaning of the code if not a signal | | signal_number | `9` | Signal number corresponding to the exit code, only if signalled | @@ -2834,9 +2852,9 @@ disabled = false The `sudo` module displays if sudo credentials are currently cached. The module will only be shown if credentials are cached. -::: tip Подсказка +::: tip -По умолчанию этот модуль отключен. Чтобы включить его, установите `disabled` на `false` в файле конфигурации. +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: @@ -2923,7 +2941,7 @@ format = "via [🏎 $version](red bold)" The `terraform` module shows the currently selected [Terraform workspace](https://www.terraform.io/docs/language/state/workspaces.html) and version. -::: tip Подсказка +::: tip By default the Terraform version is not shown, since this is slow for current versions of Terraform when a lot of plugins are in use. If you still want to enable it, [follow the example shown below](#with-terraform-version). @@ -2980,11 +2998,11 @@ format = "[🏎💨 $workspace]($style) " ## Время -Модуль `time` показывает текущее **локальное** время. Значение конфигурации `format` используется пакетом [`chrono`](https://crates.io/crates/chrono) для контроля того, как отображается время. Ознакомьтесь с [документацией chrono strftime](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html), чтобы увидеть доступные параметры. +The `time` module shows the current **local** time. The `format` configuration value is used by the [`chrono`](https://crates.io/crates/chrono) crate to control how the time is displayed. Take a look [at the chrono strftime docs](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) to see what options are available. -::: tip Подсказка +::: tip -По умолчанию этот модуль отключен. Чтобы включить его, установите `disabled` на `false` в файле конфигурации. +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: @@ -3000,7 +3018,7 @@ format = "[🏎💨 $workspace]($style) " | `disabled` | `true` | Отключает модуль `time`. | | `time_range` | `"-"` | Sets the time range during which the module will be shown. Times must be specified in 24-hours format | -If `use_12hr` is `true`, then `time_format` defaults to `"%r"`. Иначе по умолчанию используется `"%T"`. Manually setting `time_format` will override the `use_12hr` setting. +If `use_12hr` is `true`, then `time_format` defaults to `"%r"`. Otherwise, it defaults to `"%T"`. Manually setting `time_format` will override the `use_12hr` setting. ### Переменные @@ -3026,14 +3044,14 @@ time_range = "10:00:00-14:00:00" ## Имя пользователя -Модуль `username` показывает имя активного пользователя. Модуль будет показан, если любое из следующих условий соблюдено: +The `username` module shows active user's username. Модуль будет показан, если любое из следующих условий соблюдено: - Текущий пользователь - root - Текущий пользователь отличается от залогиненного - Пользователь подключен к SSH-сессии - Переменная `show_always` равна true -::: tip Подсказка +::: tip SSH connection is detected by checking environment variables `SSH_CONNECTION`, `SSH_CLIENT`, and `SSH_TTY`. If your SSH host does not set up these variables, one workaround is to set one of them with a dummy value. @@ -3224,19 +3242,19 @@ These modules will be shown if any of the following conditions are met: - The `when` command returns 0 - The current Operating System (std::env::consts::OS) matchs with `os` field if defined. -::: tip Подсказка +::: tip Multiple custom modules can be defined by using a `.`. ::: -::: tip Подсказка +::: tip The order in which custom modules are shown can be individually set by including `${custom.foo}` in the top level `format` (as it includes a dot, you need to use `${...}`). By default, the `custom` module will simply show all custom modules in the order they were defined. ::: -::: tip Подсказка +::: tip [Issue #1252](https://github.com/starship/starship/discussions/1252) contains examples of custom modules. If you have an interesting example not covered there, feel free to share it there! diff --git a/docs/ru-RU/faq/README.md b/docs/ru-RU/faq/README.md index 07fba7625..c4efb5b42 100644 --- a/docs/ru-RU/faq/README.md +++ b/docs/ru-RU/faq/README.md @@ -69,13 +69,13 @@ If you see symbols that you don't recognise you can use `starship explain` to ex You can enable the debug logs by using the `STARSHIP_LOG` env var. These logs can be very verbose so it is often useful to use the `module` command if you are trying to debug a particular module, for example, if you are trying to debug the `rust` module you could run the following command to get the trace logs and output from the module. ```sh -env STARHIP_LOG=trace starship module rust +env STARSHIP_LOG=trace starship module rust ``` If starship is being slow you can try using the `timings` command to see if there is a particular module or command that to blame. ```sh -env STARHIP_LOG=trace starship timings +env STARSHIP_LOG=trace starship timings ``` This will output the trace log and a breakdown of all modules that either took more than 1ms to execute or produced some output. @@ -118,5 +118,5 @@ If Starship was installed using the install script, the following command will d ```sh # Locate and delete the starship binary -sh -c 'rm "$(which starship)"' +sh -c 'rm "$(command -v 'starship')"' ``` diff --git a/docs/ru-RU/guide/README.md b/docs/ru-RU/guide/README.md index 7c19635ee..6ebd14983 100644 --- a/docs/ru-RU/guide/README.md +++ b/docs/ru-RU/guide/README.md @@ -72,6 +72,22 @@ height="20" src="https://raw.githubusercontent.com/starship/starship/master/media/flag-fr.png" alt="Français" + />
+   + Bahasa Indonesia +   + Italiano   Изучите документацию Starship  ▶ @@ -149,13 +165,13 @@ ## 🚀 Установка -### Требования +### Обязательные требования - Установленный и включённый [шрифт Powerline](https://www.nerdfonts.com/) (например, [Fira Code Nerd Font](https://www.nerdfonts.com/font-downloads)). ### Начало работы -**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/). +**Примечание**: из-за распространения большого количества операционных систем, список поддерживаемых указан ниже. Can't see yours? Ознакомьтесь с [дополнительными инструкциями по платформе](https://starship.rs/installing/). 1. Установите двоичный файл **starship**: @@ -252,7 +268,7 @@ #### Elvish - **Внимание** Поддерживается только elvish v0.15 или выше. Добавьте следующую строку в конец `~/.elvish/rc.elv`: + **Warning** Only elvish v0.17 or higher is supported. Добавьте следующую строку в конец `~/.elvish/rc.elv`: ```sh # ~/.elvish/rc.elv @@ -283,6 +299,17 @@ ``` + #### Cmd + + You need to use [Clink](https://chrisant996.github.io/clink/clink.html) (v1.2.30+) with Cmd. Add the following to a file `starship.lua` and place this file in Clink scripts directory: + + ```lua + -- starship.lua + + load(io.popen('starship init cmd'):read("*a"))() + ``` + + #### 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. diff --git a/docs/ru-RU/presets/README.md b/docs/ru-RU/presets/README.md index cb5737fea..90b2ebc33 100644 --- a/docs/ru-RU/presets/README.md +++ b/docs/ru-RU/presets/README.md @@ -224,7 +224,7 @@ format = '\[[$symbol($version)]($style)\]' format = '\[[$symbol($version)]($style)\]' [sudo] -format = '\[[as $symbol]\] +format = '\[[as $symbol]\]' [swift] format = '\[[$symbol($version)]($style)\]' diff --git a/docs/tr-TR/README.md b/docs/tr-TR/README.md index be48afef2..f6ad8739e 100644 --- a/docs/tr-TR/README.md +++ b/docs/tr-TR/README.md @@ -18,7 +18,7 @@ features: footer: ISC Licensed | Copyright © 2019-present Starship Contributors #Used for the description meta tag, for SEO metaTitle: "Starship: Cross-Shell Prompt" -description: Starship is the minimal, blazing fast, and extremely customizable prompt for any shell! Shows the information you need, while staying sleek and minimal. Quick installation available for Bash, Fish, ZSH, Ion, Tcsh, Elvish, Nu, Xonsh, and PowerShell. +description: Starship is the minimal, blazing fast, and extremely customizable prompt for any shell! Shows the information you need, while staying sleek and minimal. Quick installation available for Bash, Fish, ZSH, Ion, Tcsh, Elvish, Nu, Xonsh, Cmd, and PowerShell. ---
@@ -119,7 +119,7 @@ description: Starship is the minimal, blazing fast, and extremely customizable p #### Elvish - ::: warning Only elvish v0.15 or higher is supported. ::: + ::: warning Only elvish v0.17 or higher is supported. ::: Add the following to the end of `~/.elvish/rc.elv`: @@ -164,3 +164,14 @@ description: Starship is the minimal, blazing fast, and extremely customizable p execx($(starship init xonsh)) ``` + + + #### Cmd + + You need to use [Clink](https://chrisant996.github.io/clink/clink.html) (v1.2.30+) with Cmd. Add the following to a file `starship.lua` and place this file in Clink scripts directory: + + ```lua + -- starship.lua + + load(io.popen('starship init cmd'):read("*a"))() + ``` diff --git a/docs/tr-TR/advanced-config/README.md b/docs/tr-TR/advanced-config/README.md index 0faee6643..20eb399fa 100644 --- a/docs/tr-TR/advanced-config/README.md +++ b/docs/tr-TR/advanced-config/README.md @@ -8,19 +8,44 @@ Bu bölümdeki yapılandırmalar, Starship'in gelecekteki sürümlerinde değiş ::: -## Bash'e Özel ön-komut istemi(pre-prompt) ve ön-çalıştırma(pre-execution) Komutları +## Custom pre-prompt and pre-execution Commands in Cmd -Bash, çoğu diğer kabuklar gibi resmi bir preexec/precmd çerçevesine sahip değildir. Bu yüzden, `Bash'i` tamamen özelleştirmek zordur. Ancak Starship, size istem oluşturma prosedürü sayesinde kendi işlevlerinizi ekleme konusunda sınırlı bir yetenek sağlar: +Clink provides extremely flexible APIs to run pre-prompt and pre-exec commands in Cmd shell. It is fairly simple to use with Starship. Make the following changes to your `starship.lua` file as per your requirements: -- Özel bir işlemi başlatmak için çizimin bitmesinden önce yeni bir işlev oluşturup adlandırmanız gerekmektedir.`starship_precmd_user_func`. Örneğin komut isteminden önce bir roket çizmek isterseniz +- To run a custom function right before the prompt is drawn, define a new function called `starship_preprompt_user_func`. This function receives the current prompt as a string that you can utilize. For example, to draw a rocket before the prompt, you would do -```bash -echo "🚀" -} -starship_precmd_user_func="fırlatıldı" +```lua +function starship_preprompt_user_func(prompt) + print("🚀") +end + +load(io.popen('starship init cmd'):read("*a"))() ``` -- Özel bir işlemi başlatmadan hemen önce komut istemini çalıştırıp, [`DEBUG`filtreleme mekanizmasını](https://jichu4n.com/posts/debug-trap-and-prompt_command-in-bash/) kullanabilirsiniz. Bununla birlikte, Starship başlatılmadan hemen *önce*, DEBUG sinyalini filtrelemek<1>**zorundasınız.! Starship, DEBUG filtrelemesinin ardından bazı değerleri içerisinde barındırabilir ancak filtreleme işlemi starship başlatıldıktan sonra yazılırsa bazı fonksiyonlar devre dışı kalabilir. +- To run a custom function right before a command is executed, define a new function called `starship_precmd_user_func`. This function receives the current commandline as a string that you can utilize. For example, to print the command that's about to be executed, you would do + +```lua +function starship_precmd_user_func(line) + print("Executing: "..line) +end + +load(io.popen('starship init cmd'):read("*a"))() +``` + +## Custom pre-prompt and pre-execution Commands in Bash + +Bash does not have a formal preexec/precmd framework like most other shells. Because of this, it is difficult to provide fully customizable hooks in `bash`. Ancak Starship, size istem oluşturma prosedürü sayesinde kendi işlevlerinizi ekleme konusunda sınırlı bir yetenek sağlar: + +- To run a custom function right before the prompt is drawn, define a new function and then assign its name to `starship_precmd_user_func`. For example, to draw a rocket before the prompt, you would do + +```bash +function blastoff(){ + echo "🚀" +} +starship_precmd_user_func="blastoff" +``` + +- To run a custom function right before a command runs, you can use the [`DEBUG` trap mechanism](https://jichu4n.com/posts/debug-trap-and-prompt_command-in-bash/). However, you **must** trap the DEBUG signal *before* initializing Starship! Starship can preserve the value of the DEBUG trap, but if the trap is overwritten after starship starts up, some functionality will break. ```bash function blastoff(){ @@ -42,9 +67,9 @@ function Invoke-Starship-PreCommand { } ``` -## Pencere Başlığını Değiştirme +## 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 even does it by default. Starship does not do this, but it's fairly straightforward to add this functionality to `bash`, `zsh`, `cmd` or `powershell`. First, define a window title change function (identical in bash and zsh): @@ -79,6 +104,16 @@ function set_win_title(){ starship_precmd_user_func="set_win_title" ``` +For Cmd, you can change the window title using the `starship_preprompt_user_func` function. + +```lua +function starship_preprompt_user_func(prompt) + console.settitle(os.getenv('USERNAME').."@"..os.getenv('COMPUTERNAME')..": "..os.getcwd()) +end + +load(io.popen('starship init cmd'):read("*a"))() +``` + You can also set a similar output with PowerShell by creating a function named `Invoke-Starship-PreCommand`. ```powershell @@ -96,7 +131,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). -`right_format` is currently supported for the following shells: elvish, fish, zsh. +`right_format` is currently supported for the following shells: elvish, fish, zsh, xonsh, cmd. ### Example @@ -116,6 +151,28 @@ Produces a prompt like the following: ▶ starship on  rprompt [!] is 📦 v0.57.0 via 🦀 v1.54.0 took 17s ``` +## Continuation Prompt + +Some shells support a continuation prompt along with the normal prompt. This prompt is rendered instead of the normal prompt when the user has entered an incomplete statement (such as a single left parenthesis or quote). + +Starship can set the continuation prompt using the `continuation_prompt` option. The default prompt is `"[∙](bright-black) "`. + +Note: `continuation_prompt` should be set to a literal string without any variables. + +Note: Continuation prompts are only available in the following shells: + + - `bash` + - `zsh` + - `PowerShell` + +### Example + +```toml +# ~/.config/starship.toml + +# A continuation prompt that displays two filled in arrows +continuation_prompt = "▶▶" +``` ## Style Strings diff --git a/docs/tr-TR/config/README.md b/docs/tr-TR/config/README.md index 0e84dc60a..008b75872 100644 --- a/docs/tr-TR/config/README.md +++ b/docs/tr-TR/config/README.md @@ -24,13 +24,19 @@ disabled = true You can change default configuration file location with `STARSHIP_CONFIG` environment variable: ```sh -export STARSHIP_CONFIG=~/.starship/config.toml +export STARSHIP_CONFIG=~/example/non/default/path/starship.toml ``` Equivalently in PowerShell (Windows) would be adding this line to your `$PROFILE`: ```powershell -$ENV:STARSHIP_CONFIG = "$HOME\.starship\config.toml" +$ENV:STARSHIP_CONFIG = "$HOME\example\non\default\path\starship.toml" +``` + +Or for Cmd (Windows) would be adding this line to your `starship.lua`: + +```lua +os.setenv('STARSHIP_CONFIG', 'C:\\Users\\user\\example\\non\\default\\path\\starship.toml') ``` ### Logging @@ -47,6 +53,12 @@ Equivalently in PowerShell (Windows) would be adding this line to your `$PROFILE $ENV:STARSHIP_CACHE = "$HOME\AppData\Local\Temp" ``` +Or for Cmd (Windows) would be adding this line to your `starship.lua`: + +```lua +os.setenv('STARSHIP_CACHE', 'C:\\Users\\user\\AppData\\Local\\Temp') +``` + ### Terminology **Module**: A component in the prompt giving information based on contextual information from your OS. For example, the "nodejs" module shows the version of Node.js that is currently installed on your computer, if your current directory is a Node.js project. @@ -425,13 +437,13 @@ By default it only changes color. If you also want to change its shape take a lo ::: uyarı -`error_symbol` is not supported on elvish and nu shell. +`error_symbol` is not supported on nu shell. ::: ::: uyarı -`vicmd_symbol` is only supported in fish and zsh. +`vicmd_symbol` is only supported in cmd, fish and zsh. ::: @@ -568,7 +580,7 @@ Bash users who need preexec-like functionality can use [rcaloras's bash_preexec ::: tip -Showing desktop notifications requires starship to be built with `rust-notify` support. You check if your starship supports notifications by running `STARSHIP_LOG=debug starship module cmd_duration -d 60000` when `show_notifications` is set to `true`. +Showing desktop notifications requires starship to be built with `notify-rust` support. You check if your starship supports notifications by running `STARSHIP_LOG=debug starship module cmd_duration -d 60000` when `show_notifications` is set to `true`. ::: @@ -713,20 +725,20 @@ format = "via [🔰 $version](bold red) " ## Deno The `deno` module shows you your currently installed version of [Deno](https://deno.land/). By default the module will be shown if any of the following conditions are met: -- The current directory contains a `mod.ts`, `mod.js`, `deps.ts` or `deps.js` file +- The current directory contains a `deno.json`, `deno.jsonc`, `mod.ts`, `mod.js`, `deps.ts` or `deps.js` file ### Options -| Option | Default | Description | -| ------------------- | -------------------------------------------- | ------------------------------------------------------------------------- | -| `format` | `"via [$symbol($version )]($style)"` | The format for the module. | -| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | -| `symbol` | `"🦕 "` | A format string representing the symbol of Deno | -| `detect_extensions` | `[]` | Which extensions should trigger this module. | -| `detect_files` | `["mod.ts", "mod.js", "deps.ts", "deps.js"]` | Which filenames should trigger this module. | -| `detect_folders` | `[]` | Which folders should trigger this module. | -| `style` | `"green bold"` | The style for the module. | -| `disabled` | `false` | Disables the `deno` module. | +| Option | Default | Description | +| ------------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `format` | `"via [$symbol($version )]($style)"` | The format for the module. | +| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | +| `symbol` | `"🦕 "` | A format string representing the symbol of Deno | +| `detect_extensions` | `[]` | Which extensions should trigger this module. | +| `detect_files` | `["deno.json", "deno.jsonc", "mod.ts", "mod.js", "deps.ts", "deps.js"]` | Which filenames should trigger this module. | +| `detect_folders` | `[]` | Which folders should trigger this module. | +| `style` | `"green bold"` | The style for the module. | +| `disabled` | `false` | Disables the `deno` module. | ### Variables @@ -755,18 +767,19 @@ For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, an ### Options -| Option | Default | Description | -| ------------------- | -------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `truncation_length` | `3` | The number of parent folders that the current directory should be truncated to. | -| `truncate_to_repo` | `true` | Whether or not to truncate to the root of the git repo that you're currently in. | -| `format` | `"[$path]($style)[$read_only]($read_only_style) "` | The format for the module. | -| `style` | `"bold cyan"` | The style for the module. | -| `disabled` | `false` | Disables the `directory` module. | -| `read_only` | `"🔒"` | The symbol indicating current directory is read only. | -| `read_only_style` | `"red"` | The style for the read only symbol. | -| `truncation_symbol` | `""` | The symbol to prefix to truncated paths. eg: "…/" | -| `repo_root_style` | `None` | The style for the root of the git repo when `truncate_to_repo` option is set to false. | -| `home_symbol` | `"~"` | The symbol indicating home directory. | +| Option | Default | Description | +| ------------------- | -------------------------------------------------- | --------------------------------------------------------------------------------------- | +| `truncation_length` | `3` | The number of parent folders that the current directory should be truncated to. | +| `truncate_to_repo` | `true` | Whether or not to truncate to the root of the git repo that you're currently in. | +| `format` | `"[$path]($style)[$read_only]($read_only_style) "` | The format for the module. | +| `style` | `"bold cyan"` | The style for the module. | +| `disabled` | `false` | Disables the `directory` module. | +| `read_only` | `"🔒"` | The symbol indicating current directory is read only. | +| `read_only_style` | `"red"` | The style for the read only symbol. | +| `truncation_symbol` | `""` | The symbol to prefix to truncated paths. eg: "…/" | +| `repo_root_style` | `None` | The style for the root of the git repo when `truncate_to_repo` option is set to false. | +| `home_symbol` | `"~"` | The symbol indicating home directory. | +| `use_os_path_sep` | `true` | Use the OS specific path seperator instead of always using `/` (e.g. `\` on Windows) |
This module has a few advanced configuration options that control how the directory is displayed. @@ -1334,22 +1347,23 @@ The `git_status` module shows symbols representing the state of the repo in your ### Options -| Option | Default | Description | -| ------------ | ----------------------------------------------- | ----------------------------------- | -| `format` | `'([\[$all_status$ahead_behind\]]($style) )'` | The default format for `git_status` | -| `conflicted` | `"="` | This branch has merge conflicts. | -| `ahead` | `"⇡"` | The format of `ahead` | -| `behind` | `"⇣"` | The format of `behind` | -| `diverged` | `"⇕"` | The format of `diverged` | -| `up_to_date` | `""` | The format of `up_to_date` | -| `untracked` | `"?"` | The format of `untracked` | -| `stashed` | `"$"` | The format of `stashed` | -| `modified` | `"!"` | The format of `modified` | -| `staged` | `"+"` | The format of `staged` | -| `renamed` | `"»"` | The format of `renamed` | -| `deleted` | `"✘"` | The format of `deleted` | -| `style` | `"bold red"` | The style for the module. | -| `disabled` | `false` | Disables the `git_status` module. | +| Option | Default | Description | +| ------------------- | ----------------------------------------------- | ----------------------------------- | +| `format` | `'([\[$all_status$ahead_behind\]]($style) )'` | The default format for `git_status` | +| `conflicted` | `"="` | This branch has merge conflicts. | +| `ahead` | `"⇡"` | The format of `ahead` | +| `behind` | `"⇣"` | The format of `behind` | +| `diverged` | `"⇕"` | The format of `diverged` | +| `up_to_date` | `""` | The format of `up_to_date` | +| `untracked` | `"?"` | The format of `untracked` | +| `stashed` | `"$"` | The format of `stashed` | +| `modified` | `"!"` | The format of `modified` | +| `staged` | `"+"` | The format of `staged` | +| `renamed` | `"»"` | The format of `renamed` | +| `deleted` | `"✘"` | The format of `deleted` | +| `style` | `"bold red"` | The style for the module. | +| `ignore_submodules` | `false` | Ignore changes to submodules. | +| `disabled` | `false` | Disables the `git_status` module. | ### Variables @@ -1513,10 +1527,10 @@ The `hostname` module shows the system hostname. ### Variables -| Variable | Example | Description | -| --------- | ------- | ------------------------------------ | -| symbol | | Mirrors the value of option `symbol` | -| style\* | | Mirrors the value of option `style` | +| Variable | Example | Description | +| --------- | ---------- | ----------------------------------- | +| hostname | `computer` | The hostname of the computer | +| style\* | | Mirrors the value of option `style` | \*: This variable can only be used as a part of a style string @@ -2133,7 +2147,7 @@ symbol = "☁️ " ## Package Version -The `package` module is shown when the current directory is the repository for a package, and shows its current version. The module currently supports `npm`, `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`, `shards` and `dart` packages. - [**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 @@ -2150,6 +2164,7 @@ The `package` module is shown when the current directory is the repository for a - [**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 - [**SBT**](https://scala-sbt.org) - The `sbt` package version is extracted from the `build.sbt` present in the current directory +- [**Dart**](https://pub.dev/) - The `dart` package version is extracted from the `pubspec.yaml` 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. @@ -2673,6 +2688,8 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y | `elvish_indicator` | `esh` | A format string used to represent elvish. | | `tcsh_indicator` | `tsh` | A format string used to represent tcsh. | | `xonsh_indicator` | `xsh` | A format string used to represent xonsh. | +| `cmd_indicator` | `cmd` | A format string used to represent cmd. | +| `nu_indicator` | `nu` | A format string used to represent nu. | | `unknown_indicator` | | The default value to be displayed when the shell is unknown. | | `format` | `"[$indicator]($style) "` | The format for the module. | | `style` | `"white bold"` | The style for the module. | @@ -2778,7 +2795,7 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y ::: -::: warning This module is not supported on elvish and nu shell. ::: +::: warning This module is not supported on nu shell. ::: ### Options @@ -2804,6 +2821,7 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y | Variable | Example | Description | | -------------- | ------- | ------------------------------------------------------------------------------------------- | | status | `127` | The exit code of the last command | +| hex_status | `0x7F` | The exit code of the last command in hex | | int | `127` | The exit code of the last command | | common_meaning | `ERROR` | Meaning of the code if not a signal | | signal_number | `9` | Signal number corresponding to the exit code, only if signalled | diff --git a/docs/tr-TR/faq/README.md b/docs/tr-TR/faq/README.md index 8422ee2e3..99dd6bcc8 100644 --- a/docs/tr-TR/faq/README.md +++ b/docs/tr-TR/faq/README.md @@ -69,13 +69,13 @@ If you see symbols that you don't recognise you can use `starship explain` to ex You can enable the debug logs by using the `STARSHIP_LOG` env var. These logs can be very verbose so it is often useful to use the `module` command if you are trying to debug a particular module, for example, if you are trying to debug the `rust` module you could run the following command to get the trace logs and output from the module. ```sh -env STARHIP_LOG=trace starship module rust +env STARSHIP_LOG=trace starship module rust ``` If starship is being slow you can try using the `timings` command to see if there is a particular module or command that to blame. ```sh -env STARHIP_LOG=trace starship timings +env STARSHIP_LOG=trace starship timings ``` This will output the trace log and a breakdown of all modules that either took more than 1ms to execute or produced some output. @@ -118,5 +118,5 @@ If Starship was installed using the install script, the following command will d ```sh # Locate and delete the starship binary -sh -c 'rm "$(which starship)"' +sh -c 'rm "$(command -v 'starship')"' ``` diff --git a/docs/tr-TR/guide/README.md b/docs/tr-TR/guide/README.md index 7db695b94..787940f58 100644 --- a/docs/tr-TR/guide/README.md +++ b/docs/tr-TR/guide/README.md @@ -72,6 +72,22 @@ height="20" src="https://raw.githubusercontent.com/starship/starship/master/media/flag-fr.png" alt="Français" + /> +   + Bahasa Indonesia +   + Italiano   @@ -119,7 +119,7 @@ eval $(starship init ion) #### Elvish - ::: warning Chỉ elvish v0.15 hoặc cao hơn được hỗ trợ. ::: + ::: warning Only elvish v0.17 or higher is supported. ::: Thêm đoạn sau vào cuối tệp tin `~/.elvish/rc.elv`: @@ -164,3 +164,14 @@ eval $(starship init ion) execx($(starship init xonsh)) ``` + + + #### Cmd + + You need to use [Clink](https://chrisant996.github.io/clink/clink.html) (v1.2.30+) with Cmd. Add the following to a file `starship.lua` and place this file in Clink scripts directory: + + ```lua + -- starship.lua + + load(io.popen('starship init cmd'):read("*a"))() + ``` diff --git a/docs/vi-VN/advanced-config/README.md b/docs/vi-VN/advanced-config/README.md index d94dc0ebd..b6958fa25 100644 --- a/docs/vi-VN/advanced-config/README.md +++ b/docs/vi-VN/advanced-config/README.md @@ -8,11 +8,35 @@ Các tùy chỉnh được mô tả trong phần này có thể sẽ thay đổi ::: -## Tùy chỉnh các hàm được thực thi trước prompt và các lệnh Linux mặc định của bash shell +## Custom pre-prompt and pre-execution Commands in Cmd -Bash không có một preexec/precmd framework chính thống giống như các shells khác. Do đó rất khó để cung cấp các hook với khả năng tuỳ biến hoàn toàn cho `bash` shell. Tuy nhiên, Starship cho phép bạn viết các hàm riêng của bạn để tùy biến việc render prompt: +Clink provides extremely flexible APIs to run pre-prompt and pre-exec commands in Cmd shell. It is fairly simple to use with Starship. Make the following changes to your `starship.lua` file as per your requirements: -- Để thực thi một hàm custom trước khi prompt được render, ta cần định nghĩa một hàm mới và gán `starship_precmd_user_func` cho tên của hàm này. Ví dụ, để vẽ một tên lửa trước prompt +- To run a custom function right before the prompt is drawn, define a new function called `starship_preprompt_user_func`. This function receives the current prompt as a string that you can utilize. For example, to draw a rocket before the prompt, you would do + +```lua +function starship_preprompt_user_func(prompt) + print("🚀") +end + +load(io.popen('starship init cmd'):read("*a"))() +``` + +- To run a custom function right before a command is executed, define a new function called `starship_precmd_user_func`. This function receives the current commandline as a string that you can utilize. For example, to print the command that's about to be executed, you would do + +```lua +function starship_precmd_user_func(line) + print("Executing: "..line) +end + +load(io.popen('starship init cmd'):read("*a"))() +``` + +## Custom pre-prompt and pre-execution Commands in Bash + +Bash does not have a formal preexec/precmd framework like most other shells. Because of this, it is difficult to provide fully customizable hooks in `bash`. Tuy nhiên, Starship cho phép bạn viết các hàm riêng của bạn để tùy biến việc render prompt: + +- To run a custom function right before the prompt is drawn, define a new function and then assign its name to `starship_precmd_user_func`. For example, to draw a rocket before the prompt, you would do ```bash function blastoff(){ @@ -21,13 +45,13 @@ function blastoff(){ starship_precmd_user_func="blastoff" ``` -- Để thực thi một hàm custom trước khi một câu lệnh Linux chạy, ta có thể sử dụng cơ chế bẫy tín hiệu [`DEBUG`](https://jichu4n.com/posts/debug-trap-and-prompt_command-in-bash/). Tuy nhiên, bạn **phải** đặt bẫy tín hiệu DEBUG *trước* khởi tạo Starship! Starship có thể giữ giá trị của DEBUG trap, nhưng nếu trap bị ghi đè sau khi starship khởi động, một vài chức năng sẽ không hoạt động. +- To run a custom function right before a command runs, you can use the [`DEBUG` trap mechanism](https://jichu4n.com/posts/debug-trap-and-prompt_command-in-bash/). However, you **must** trap the DEBUG signal *before* initializing Starship! Starship can preserve the value of the DEBUG trap, but if the trap is overwritten after starship starts up, some functionality will break. ```bash function blastoff(){ echo "🚀" } -trap blastoff DEBUG # Bẫy DEBUG *trước khi* starship chạy +trap blastoff DEBUG # Trap DEBUG *before* running starship eval $(starship init bash) ``` @@ -43,11 +67,11 @@ function Invoke-Starship-PreCommand { } ``` -## Thay đổi tên gọi trên cửa sổ của chương trình terminal +## Change Window Title -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. +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`, `zsh`, `cmd` or `powershell`. -Đầ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): +First, define a window title change function (identical in bash and zsh): ```bash function set_win_title(){ @@ -55,23 +79,23 @@ function set_win_title(){ } ``` -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). +You can use variables to customize this title (`$USER`, `$HOSTNAME`, and `$PWD` are popular choices). -Với `bash` shell, set precmd của starship bằng tên của hàm này: +In `bash`, set this function to be the precmd starship function: ```bash starship_precmd_user_func="set_win_title" ``` -Với `zsh` shell, thêm hàm này vào mảng `precmd_functions`: +In `zsh`, add this to the `precmd_functions` array: ```bash precmd_functions+=(set_win_title) ``` -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. +If you like the result, add these lines to your shell configuration file (`~/.bashrc` or `~/.zshrc`) to make it permanent. -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`: +For example, if you want to display your current directory in your terminal tab title, add the following snippet to your `~/.bashrc` or `~/.zshrc`: ```bash function set_win_title(){ @@ -80,6 +104,16 @@ function set_win_title(){ starship_precmd_user_func="set_win_title" ``` +For Cmd, you can change the window title using the `starship_preprompt_user_func` function. + +```lua +function starship_preprompt_user_func(prompt) + console.settitle(os.getenv('USERNAME').."@"..os.getenv('COMPUTERNAME')..": "..os.getcwd()) +end + +load(io.popen('starship init cmd'):read("*a"))() +``` + You can also set a similar output with PowerShell by creating a function named `Invoke-Starship-PreCommand`. ```powershell @@ -97,7 +131,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). -`right_format` is currently supported for the following shells: elvish, fish, zsh. +`right_format` is currently supported for the following shells: elvish, fish, zsh, xonsh, cmd. ### Ví dụ @@ -117,29 +151,51 @@ Produces a prompt like the following: ▶ starship on  rprompt [!] is 📦 v0.57.0 via 🦀 v1.54.0 took 17s ``` +## Continuation Prompt + +Some shells support a continuation prompt along with the normal prompt. This prompt is rendered instead of the normal prompt when the user has entered an incomplete statement (such as a single left parenthesis or quote). + +Starship can set the continuation prompt using the `continuation_prompt` option. The default prompt is `"[∙](bright-black) "`. + +Note: `continuation_prompt` should be set to a literal string without any variables. + +Note: Continuation prompts are only available in the following shells: + + - `bash` + - `zsh` + - `PowerShell` + +### Ví dụ + +```toml +# ~/.config/starship.toml + +# A continuation prompt that displays two filled in arrows +continuation_prompt = "▶▶" +``` ## Các chuỗi kiểu -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` và `Bold` là hai chuỗi tương đương). Mỗi từ có thể là một trong các từ sau: +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` - - `nghiêng` - - `gạch dưới` - - `làm tối đi` - - `đảo ngược` + - `italic` + - `underline` + - `dimmed` + - `inverted` - `bg:` - `fg:` - `` - `none` -`` là một nơi quy định màu (được bàn luận ở phía dưới). `fg:` and `` 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. +where `` is a color specifier (discussed below). `fg:` and `` 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. -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. +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. -Một quy định màu có thể là một trong các thứ sau: +A color specifier can be one of the following: - - 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 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). + - One of the standard terminal colors: `black`, `red`, `green`, `blue`, `yellow`, `purple`, `cyan`, `white`. You can optionally prefix these with `bright-` to get the bright version (e.g. `bright-white`). + - A `#` followed by a six-digit hexadecimal number. This specifies an [RGB color hex code](https://www.w3schools.com/colors/colors_hexadecimal.asp). + - A number between 0-255. This specifies an [8-bit ANSI Color Code](https://i.stack.imgur.com/KTSQa.png). -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. +If multiple colors are specified for foreground/background, the last one in the string will take priority. diff --git a/docs/vi-VN/config/README.md b/docs/vi-VN/config/README.md index 158855aa0..ed3a10a0b 100644 --- a/docs/vi-VN/config/README.md +++ b/docs/vi-VN/config/README.md @@ -24,18 +24,24 @@ disabled = true Bạn thay đổi địa chỉ tệp tin cấu hình mặc định bằng biến môi trường `STARSHIP_CONFIG`: ```sh -export STARSHIP_CONFIG=~/.starship/config.toml +export STARSHIP_CONFIG=~/example/non/default/path/starship.toml ``` Tương đương trong PowerShell (Windows) sẽ được thêm dòng này vào `$PROFILE` của bạn: ```powershell -$ENV:STARSHIP_CONFIG = "$HOME\.starship\config.toml" +$ENV:STARSHIP_CONFIG = "$HOME\example\non\default\path\starship.toml" +``` + +Or for Cmd (Windows) would be adding this line to your `starship.lua`: + +```lua +os.setenv('STARSHIP_CONFIG', 'C:\\Users\\user\\example\\non\\default\\path\\starship.toml') ``` ### Logging -Mặc định, starship logs các cảnh báo và các lỗi trong một tập tin tên là `~/.cache/starship/session_${STARSHIP_SESSION_KEY}.log`, nơi đó khoá của phiên làm việc tương ứng với thực thể terminal của bạn. Cái này, tuy nhiên có thể được thay đổi bằng cách sử dụng biến môi trường `STARSHIP_CACHE`: +By default starship logs warnings and errors into a file named `~/.cache/starship/session_${STARSHIP_SESSION_KEY}.log`, where the session key is corresponding to a instance of your terminal. This, however can be changed using the `STARSHIP_CACHE` environment variable: ```sh export STARSHIP_CACHE=~/.starship/cache @@ -47,23 +53,29 @@ Tương đương trong PowerShell (Windows) sẽ được thêm dòng này vào $ENV:STARSHIP_CACHE = "$HOME\AppData\Local\Temp" ``` +Or for Cmd (Windows) would be adding this line to your `starship.lua`: + +```lua +os.setenv('STARSHIP_CACHE', 'C:\\Users\\user\\AppData\\Local\\Temp') +``` + ### Thuật ngữ -**Module**: Một thành phần trong prompt, thông tin lấy được dựa trên thông tin ngữ cảnh từ hệ điều hành của bạn. For example, the "nodejs" module shows the version of Node.js that is currently installed on your computer, if your current directory is a Node.js project. +**Module**: A component in the prompt giving information based on contextual information from your OS. For example, the "nodejs" module shows the version of Node.js that is currently installed on your computer, if your current directory is a Node.js project. -**Variable**: Các thành phần con nhỏ hơn chứa thông tin cung cấp bởi module. For example, the "version" variable in the "nodejs" module contains the current version of Node.js. +**Variable**: Smaller sub-components that contain information provided by the module. For example, the "version" variable in the "nodejs" module contains the current version of Node.js. -Bằng việc quy ước, đa số các module có một tiền tố của terminal mặc định (ví dụ `via` trong "nodejs") và một khoảng trắng như là một hậu tố. +By convention, most modules have a prefix of default terminal color (e.g. `via` in "nodejs") and an empty space as a suffix. ### Định dạng các chuỗi -Định dạng các chuỗi là định dạng một module với việc in ra tất cả các biến của nó. Đa số các module có một cái bắt đầu gọi là `format`, cái đó cấu hình việc hiển thị định dạng của module. Bạn có thể sử dụng các văn bản, các biến và các nhóm văn bản trong một định dạng chuỗi. +Format strings are the format that a module prints all its variables with. Most modules have an entry called `format` that configures the display format of the module. You can use texts, variables and text groups in a format string. #### Biến -Một biến chứa một kí hiệu `$` theo sau bởi tên biến. The name of a variable can only contain 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 `_`. -Ví dụ: +For example: - `$version` là một đính dạng chuỗi với một biến đặt tên là `version`. - `$git_branch$git_commit` là một định dạng chuỗi với hai biến named `git_branch` và `git_commit`. @@ -71,13 +83,13 @@ Ví dụ: #### Nhóm văn bản -Một nhóm văn bản được tạo nên bởi hai phần khác nhau. +A text group is made up of two different parts. -Phần đầu tiên, cái được bao bọc trong một `[]`, là một [định dạng chuỗi](#format-strings). Bạn có thể thêm các văn bản, các biến, hoặc thậm chí các nhóm văn bản lồng nhau vào trong nó. +The first part, which is enclosed in a `[]`, is a [format string](#format-strings). You can add texts, variables, or even nested text groups in it. -Phần thứ hai, cái được bao bọc trong một `()`, là một [chuỗi kiểu](#style-strings). This can be used to style the first part. +In the second part, which is enclosed in a `()`, is a [style string](#style-strings). This can be used to style the first part. -Ví dụ: +For example: - `[on](red bold)` sẽ in một chuỗi `on` với chữ đậm tô màu đỏ. - `[⌘ $version](bold green)` sẽ in một biểu tượng `⌘` theo sau là nội dung của biến `version`, với chữ in đậm màu xanh lá cây. @@ -85,7 +97,7 @@ Ví dụ: #### Các chuỗi kiểu -Đa số các module trong starship cho phép bạn cấu hình kiểu hiển thị của chúng. This is done with an entry (thường được gọi là `kiểu`) cái là một cuỗi cấu hình đặc biệt. Đây là vài ví dụ của các chuỗi kiểu cũng với những gì chúng làm. Cú pháp chi tiết đầy đủ, tham khảo [hướng dẫn cấu hình nâng cao](/advanced-config/). +Most modules in starship allow you to configure their display styles. This is done with an entry (usually called `style`) which is a string specifying the configuration. Here are some examples of style strings along with what they do. For details on the full syntax, consult the [advanced config guide](/advanced-config/). - `"fg:green bg:blue"` thiết lập chữ màu xanh lá cây trên nền màu xanh nước biển - `"bg:blue fg:bright-green"` thiết lập chữ màu xanh lá cây sáng trên nền màu canh nước biển @@ -94,13 +106,13 @@ Ví dụ: - `"bold italic fg:purple"` thiết lập chữa nghiêng đậm có màu tím - `""` vô hiệu hoá tất cả các kiểu -Lưu ý rằng những style trông như thế nào sẽ được điều khiển bởi giả lập terminal của bạn. Ví dụ, một vài giả lập terminal sẽ làm sáng những màu thay vì làm đậm chữ, và một vài theme màu sử dụng cũng các giá trị cho các màu thường và màu sáng. Tương tự, để có được chữ nghiêng, terminal của bạn phải hỗ trợ các kiểu chữ nghiêng. +Note that what styling looks like will be controlled by your terminal emulator. For example, some terminal emulators will brighten the colors instead of bolding text, and some color themes use the same values for the normal and bright colors. Also, to get italic text, your terminal must support italics. #### Điều kiện định dạng chuỗi -Một điều kiện định dạng chuỗi bọc trong `(` và `)` sẽ không render nếu tất cả các biến bên trong là rỗng. +A conditional format string wrapped in `(` and `)` will not render if all variables inside are empty. -Ví dụ: +For example: - `(@$region)` will show nothing if the variable `region` is `None` or empty string, otherwise `@` followed by the value of region. - `(một vài văn bản)` sẽ không hiển thị thứ gì khi không có những biến bọc trong các dấu ngoặc. @@ -112,18 +124,18 @@ 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 `\\`). -Ví dụ, khi bạn muốn in một kí hiệu `$` trên một dòng mới, các cấu hình sau cho `định dạng` tương đương: +For example, when you want to print a `$` symbol on a new line, the following configs for `format` are equivalent: ```toml -# với chuỗi cơ bản +# with basic string format = "\n\\$" -# với chuỗi cơ bản trong nhiều dòng +# with multiline basic string format = """ \\$""" -# với chuỗi đặc biệt +# with literal string format = ''' \$''' @@ -131,7 +143,7 @@ format = ''' ## Prompt -Cái này là danh sách các tuỳ chọn cho cấu hình prompt-wide. +This is the list of prompt-wide configuration options. ### Các tuỳ chọn @@ -149,22 +161,22 @@ Cái này là danh sách các tuỳ chọn cho cấu hình prompt-wide. ```toml # ~/.config/starship.toml -# Sử dụng định dạng custom +# Use custom format format = """ [┌───────────────────>](bold green) [│](bold green)$directory$rust$package [└─>](bold green) """ -# Chờ 10 milliseconds để starship kiểm tra các tập tin trong đường dẫn hiện tại. +# Wait 10 milliseconds for starship to check files under the current directory. scan_timeout = 10 -# Vô hiệu hóa dòng trắng tại ví trị bắt đầu của dấu nhắc lệnh +# Disable the blank line at the start of the prompt add_newline = false ``` ### Định dạng prompt mặc định -Mặc định `format` được sử dụng để định nghĩa định dạng của prompt, nếu rỗng hoặc không `format` được cung cấp. Mặc định như sau: +The default `format` is used to define the format of the prompt, if empty or no `format` is provided. The default is as shown: ```toml format = "$all" @@ -248,7 +260,7 @@ format="$all$directory$character" ## AWS -`aws` module cho biết region và profile hiện tại của AWS. Cái này dựa trên các biến môi trường `AWS_REGION`, `AWS_DEFAULT_REGION`, và `AWS_PROFILE` với tập tin `~/.aws/config`. This module also shows an expiration timer when using temporary credentials. +The `aws` module shows the current AWS region and profile. This is based on `AWS_REGION`, `AWS_DEFAULT_REGION`, and `AWS_PROFILE` env var with `~/.aws/config` file. This module also shows an expiration timer when using temporary credentials. When using [aws-vault](https://github.com/99designs/aws-vault) the profile is read from the `AWS_VAULT` env var and the credentials expiration date is read from the `AWS_SESSION_EXPIRATION` env var. @@ -347,7 +359,7 @@ style = "blue bold" ## Battery -`battery` module cho biết cách sạc pin của thiết bị là gì và tình trạng sạc hiện tại của nó. Module chỉ được nhìn thấy khi pin của thiết bị dưới 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%. ### Các tuỳ chọn @@ -375,7 +387,7 @@ discharging_symbol = "💀 " ### Hiển thị pin -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). Nếu `display` không được cung cấp. Mặc định như sau: +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. The default is as shown: ```toml [[battery.display]] @@ -387,7 +399,7 @@ The default value for the `charging_symbol` and `discharging_symbol` option is r #### Các tuỳ chọn -Tuỳ chọn `display` là một mảng của của bảng sau. +The `display` option is an array of the following table. | Tuỳ chọn | Mặc định | Mô tả | | -------------------- | ---------- | --------------------------------------------------------------------------------------------------------- | @@ -414,24 +426,24 @@ discharging_symbol = "💦" ## Character -Module `character` cho biết một kí tự (thường là một mũi tên) bên cạnh nơi văn bản được nhập trong terminal của bạn. +The `character` module shows a character (usually an arrow) beside where the text is entered in your terminal. -Kí tự sẽ nói cho bạn câu lệnh cuối liệu thành công hay thất bại. Nó có thể làm điều này bằng hai cách: +The character will tell you whether the last command was successful or not. It can do this in two ways: - thay đổi màu(`đỏ`/`xanh lá`) - thay đổi hình dạng (`❯`/`✖`) -Mặc định, nó chỉ thay đổi màu. If you also want to change its shape take a look at [this example](#with-custom-error-shape). +By default it only changes color. If you also want to change its shape take a look at [this example](#with-custom-error-shape). ::: cảnh báo -`error_symbol` is not supported on elvish and nu shell. +`error_symbol` is not supported on nu shell. ::: ::: cảnh báo -`vicmd_symbol` is only supported in fish and zsh. +`vicmd_symbol` is only supported in cmd, fish and zsh. ::: @@ -484,7 +496,7 @@ vicmd_symbol = "[V](bold green) " ## CMake -The `cmake` module shows the currently installed version of [CMake](https://cmake.org/). Mặc định module sẽ được kích hoạt nếu thoả mãn bất kì điều kiện nào dưới đây: +The `cmake` module shows the currently installed version of [CMake](https://cmake.org/). By default the module will be activated if any of the following conditions are met: - Đường dẫn hiện tại chứa một tập tin `CmakeLists.txt` - Đường dẫn hiện tại chứa một tập tin `CMakeCache.txt` @@ -544,15 +556,15 @@ The `cobol` module shows the currently installed version of COBOL. By default, t ## Command Duration -Module `cmd_duration`. cho biết câu lệnh cuối cùng thực thi trong bao lâu. Module sẽ được hiện chỉ khi câu lệnh lấy nhiều hơn 2 giây, hoặc giá trị cấu hình `min_time`, nếu nó tồn tại. +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. -::: cảnh báo Không thể hook DEBUG trap trong Bash +::: warning Do not hook the DEBUG trap in Bash -Nếu bạn đang chạy Starship trong `bash`, không thể hook `DEBUG` trap sau khi chạy `eval $(starship init $0)`, hoặc module này **sẽ** ngắt. +If you are running Starship in `bash`, do not hook the `DEBUG` trap after running `eval $(starship init $0)`, or this module **will** break. ::: -Người dùng Bash, những người cần chức năng giống preexec có thể sử dụng [rcaloras's bash_preexec framework](https://github.com/rcaloras/bash-preexec). Đơn giản là định nghĩa các mảng `preexec_functions` và `precmd_functions` trước khi chạy `eval $(starship init $0)`, và sau đó thực thi như bình thường. +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. ### Các tuỳ chọn @@ -566,9 +578,9 @@ Người dùng Bash, những người cần chức năng giống preexec có th | `show_notifications` | `false` | Hiện thông báo desktop khi câu lệnh hoàn thành. | | `min_time_to_notify` | `45_000` | Khoảng thời gian ngắn nhất để thông báo (tính bằng milliseconds). | -::: thử thuật +::: tip -Hiện thông báo desktop yêu cầu starship được built với sự hỗ trợ của `rust-notify`. Bạn kiểm tra nếu starship hỗ trợ các thông báo bằng cách chạy `STARSHIP_LOG=debug starship module cmd_duration -d 60000` khi `show_notifications` được thiết lập là `true`. +Showing desktop notifications requires starship to be built with `notify-rust` support. You check if your starship supports notifications by running `STARSHIP_LOG=debug starship module cmd_duration -d 60000` when `show_notifications` is set to `true`. ::: @@ -595,9 +607,9 @@ format = "underwent [$duration](bold yellow)" The `conda` module shows the current [Conda](https://docs.conda.io/en/latest/) environment, if `$CONDA_DEFAULT_ENV` is set. -::: thử thuật +::: tip -Cái này không loại bỏ conda's prompt mà nó sở hữu, bạn có thể muốn chạy `conda config --set changeps1 False`. +This does not suppress conda's own prompt modifier, you may want to run `conda config --set changeps1 False`. ::: @@ -713,20 +725,20 @@ format = "via [🔰 $version](bold red) " ## Deno The `deno` module shows you your currently installed version of [Deno](https://deno.land/). Mặc định module sẽ được hiển thị nếu có bất kì điều kiện nào dưới đây thoả mãn: -- The current directory contains a `mod.ts`, `mod.js`, `deps.ts` or `deps.js` file +- The current directory contains a `deno.json`, `deno.jsonc`, `mod.ts`, `mod.js`, `deps.ts` or `deps.js` file ### Các tuỳ chọn -| Tuỳ chọn | Mặc định | Mô tả | -| ------------------- | -------------------------------------------- | ------------------------------------------------------------------------- | -| `format` | `"via [$symbol($version )]($style)"` | Định dạng cho module. | -| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | -| `symbol` | `"🦕 "` | A format string representing the symbol of Deno | -| `detect_extensions` | `[]` | Những tiện ích mở rộng nào sẽ kích hoạt mô-đun này. | -| `detect_files` | `["mod.ts", "mod.js", "deps.ts", "deps.js"]` | Những tên tệp nào sẽ kích hoạt mô-đun này. | -| `detect_folders` | `[]` | Những thư mục nào sẽ kích hoạt mô-đun này. | -| `style` | `"green bold"` | Kiểu cho module. | -| `disabled` | `false` | Disables the `deno` module. | +| Tuỳ chọn | Mặc định | Mô tả | +| ------------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `format` | `"via [$symbol($version )]($style)"` | Định dạng cho module. | +| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | +| `symbol` | `"🦕 "` | A format string representing the symbol of Deno | +| `detect_extensions` | `[]` | Những tiện ích mở rộng nào sẽ kích hoạt mô-đun này. | +| `detect_files` | `["deno.json", "deno.jsonc", "mod.ts", "mod.js", "deps.ts", "deps.js"]` | Những tên tệp nào sẽ kích hoạt mô-đun này. | +| `detect_folders` | `[]` | Những thư mục nào sẽ kích hoạt mô-đun này. | +| `style` | `"green bold"` | Kiểu cho module. | +| `disabled` | `false` | Disables the `deno` module. | ### Các biến @@ -747,29 +759,30 @@ format = "via [🦕 $version](green bold) " ## Đường dẫn -`directory` module hiển thị đường dẫn thư mục hiện hành của bạn,, cắt ngắn ba thư mục cha. Đường dẫn của bạn cũng sẽ được cắt ngắn tới đường dẫn gốc của git repo hiện tại của bạn. +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. -Khi sử dụng fish style pwd option, thay vì ẩn đường dẫn được rút gọn, bạn sẽ thấy một tên ngắn cho mỗi thư mục dựa trên số bạn cho phép trng tùy chọn. +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. -Cho ví dụ, `~/Dev/Nix/nixpkgs/pkgs` nơi `nixpkgs` là gốc của repo, và tuỳ chọn thiết lập sang `1`. Bây giờ bạn sẽ thấy `~/D/N/nixpkgs/pkgs`, trong khi trước nó là `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`. ### Các tuỳ chọn -| Tuỳ chọn | Mặc định | Mô tả | -| ------------------- | -------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `truncation_length` | `3` | Số lượng thư mục cha của thư mục hiện tại nên được rút gọn. | -| `truncate_to_repo` | `true` | Có hoặc không rút gọn đường dẫn gốc của git repo hiện tại của bạn. | -| `format` | `"[$path]($style)[$read_only]($read_only_style) "` | Định dạng cho module. | -| `style` | `"bold cyan"` | Kiểu cho module. | -| `disabled` | `false` | Vô hiệu mô đun `directory`. | -| `read_only` | `"🔒"` | Biểu tượng để nhận biết thư mục hiện tại là chỉ đọc. | -| `read_only_style` | `"red"` | Style cho biểu tượng chỉ đọc. | -| `truncation_symbol` | `""` | Biểu tượng tiền tố cho các đường dẫn rút gọn. ví dụ: "…/" | -| `repo_root_style` | `None` | The style for the root of the git repo when `truncate_to_repo` option is set to false. | -| `home_symbol` | `"~"` | Biểu tượng nhận biết thư mục home. | +| Tuỳ chọn | Mặc định | Mô tả | +| ------------------- | -------------------------------------------------- | --------------------------------------------------------------------------------------- | +| `truncation_length` | `3` | Số lượng thư mục cha của thư mục hiện tại nên được rút gọn. | +| `truncate_to_repo` | `true` | Có hoặc không rút gọn đường dẫn gốc của git repo hiện tại của bạn. | +| `format` | `"[$path]($style)[$read_only]($read_only_style) "` | Định dạng cho module. | +| `style` | `"bold cyan"` | Kiểu cho module. | +| `disabled` | `false` | Vô hiệu mô đun `directory`. | +| `read_only` | `"🔒"` | Biểu tượng để nhận biết thư mục hiện tại là chỉ đọc. | +| `read_only_style` | `"red"` | Style cho biểu tượng chỉ đọc. | +| `truncation_symbol` | `""` | Biểu tượng tiền tố cho các đường dẫn rút gọn. ví dụ: "…/" | +| `repo_root_style` | `None` | The style for the root of the git repo when `truncate_to_repo` option is set to false. | +| `home_symbol` | `"~"` | Biểu tượng nhận biết thư mục home. | +| `use_os_path_sep` | `true` | Use the OS specific path seperator instead of always using `/` (e.g. `\` on Windows) |
-Mô đun này có một vài tùy chọn nâng cao để điều khiển cách thư mục được hiển thị. +This module has a few advanced configuration options that control how the directory is displayed. | Tùy chọn nâng cao | Mặc định | Mô tả | | --------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -846,9 +859,9 @@ format = "via [🐋 $context](blue bold)" ## Dotnet -The `dotnet` module shows the relevant version of the [.NET Core SDK](https://dotnet.microsoft.com/) for the current directory. Nếu SDK được ghim trong thư mục hiện tại, phiên bản ghim đó được hiển thị. Ngược lại, mô đun hiển thị phiên bản cuối cùng của SDK được cài đặt. +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. -Mặc định, mô đun này sẽ chỉ được hiển thị trong dấu nhắc lệnh của bạn khi một hoặc nhiều tệp tin dưới đây xuất hiện trong thư mục hiện tại: +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: - `global.json` - `project.json` @@ -859,11 +872,11 @@ Mặc định, mô đun này sẽ chỉ được hiển thị trong dấu nhắc - `*.fsproj` - `*.xproj` -Bạn cũng sẽ cần cài đặt .NET Core SDK đúng cách để sử dụng một cách chính xác. +You'll also need the .NET Core SDK installed in order to use it correctly. -Mô đun này sử dụng cơ chế của bản thân để phát hiện phiên bản của chính nó. Thông thường, nó nhanh gấp đôi nếu chạy `dotnet --version`, nhưng nó có thể hiện sai phiên bản nếu dự án .NET của bạn có một cấu trúc thư mục bất thường. Nếu độ chính xác quan trọng hơn tốc độ, bạn có thể vô hiệu cơ chế bằng cài đặt `heuristic = false` trong các tùy chọn mô đun. +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. -Mô đun cũng sẽ hiện Target Framework Moniker () khi có một tệp tin csproj trong thư mục hiện tại. +The module will also show the Target Framework Moniker () when there is a csproj file in the current directory. ### Các tuỳ chọn @@ -984,7 +997,7 @@ format = "via [ $version](cyan bold) " ## Biến môi trường -The `env_var` module displays the current value of a selected environment variables. Mô đun sẽ được hiển thị chỉ khi bất kì điều kiện nào sau đây thỏa mãn: +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: - Tùy chọn `variable` khớp với mootjj biến môi trường tồn tại - Tùy chọn `variable` không được định nghĩa, nhưng tùy chọn `default` là @@ -1113,7 +1126,7 @@ AA -------------------------------------------- BB ----------------------------- ## Google Cloud (`gcloud`) -Mô đun `gcloud` hiển thị cấu hình hiện tại của [`gcloud`](https://cloud.google.com/sdk/gcloud) CLI. Cái này dựa trên tập tin `~/.config/gcloud/active_config`, `~/.config/gcloud/configurations/config_{CONFIG NAME}` và biến môi trường `CLOUDSDK_CONFIG`. +The `gcloud` module shows the current configuration for [`gcloud`](https://cloud.google.com/sdk/gcloud) CLI. This is based on the `~/.config/gcloud/active_config` file and the `~/.config/gcloud/configurations/config_{CONFIG NAME}` file and the `CLOUDSDK_CONFIG` env var. ### Các tuỳ chọn @@ -1174,7 +1187,7 @@ asia-northeast1 = "an1" ## Git Branch -Mô đun `git_branch` hiển thị nhánh hiệu lực của repo trong thư mục hiện tại của bạn. +The `git_branch` module shows the active branch of the repo in your current directory. ### Các tuỳ chọn @@ -1214,7 +1227,7 @@ truncation_symbol = "" ## Git Commit -Mô đun `git_commit` hiển thị hash commit hiện tại và tag (nếu có) của repo trong thư mục hiện tại của bạn. +The `git_commit` module shows the current commit hash and also the tag (if any) of the repo in your current directory. ### Các tuỳ chọn @@ -1249,7 +1262,7 @@ tag_symbol = "🔖 " ## Git State -Mô đun `git_state` sẽ hiển hiển thị trong các thư mục là một phần của gt repository và những nơi tồn tại một hoạt động trong tiến trình như _REBASING_, _BISECTING_. Nếu có thông tin tiến trình (ví dụ, REBASING 3/10), thông tin đó cũng sẽ được hiển thị. +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. ### Các tuỳ chọn @@ -1291,9 +1304,9 @@ cherry_pick = "[🍒 PICKING](bold red)" The `git_metrics` module will show the number of added and deleted lines in the current git repository. -::: thử thuật +::: tip -Mặc định, mô đun này được vô hiệu. Để kích hoạt nó, thiết lập `disabled` sang `false` trong tập tin cấu hình của bạn. +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: @@ -1330,30 +1343,31 @@ format = '[+$added]($added_style)/[-$deleted]($deleted_style) ' ## Git Status -Mô đun `git_status` hiển thị các biểu tượng đại diện cho trạng thái của repo trong thư mục hiện tại của bạn. +The `git_status` module shows symbols representing the state of the repo in your current directory. ### Các tuỳ chọn -| Tuỳ chọn | Mặc định | Mô tả | -| ------------ | ----------------------------------------------- | ----------------------------------- | -| `format` | `'([\[$all_status$ahead_behind\]]($style) )'` | Định dạng mặc định cho `git_status` | -| `conflicted` | `"="` | Nhánh này có nhiều merge conflicts. | -| `ahead` | `"⇡"` | Định dạng của `ahead` | -| `behind` | `"⇣"` | Định dạng của `behind` | -| `diverged` | `"⇕"` | Định dạng của `diverged` | -| `up_to_date` | `""` | The format of `up_to_date` | -| `untracked` | `"?"` | Định dạng của `untracked` | -| `stashed` | `"$"` | Định dạng của `stashed` | -| `modified` | `"!"` | Định dạng của `modified` | -| `staged` | `"+"` | Định dạng của `modified` | -| `renamed` | `"»"` | Định dạng của `renamed` | -| `deleted` | `"✘"` | Định dạng của `deleted` | -| `style` | `"bold red"` | Kiểu cho module. | -| `disabled` | `false` | Vô hiệu `git_status` module. | +| Tuỳ chọn | Mặc định | Mô tả | +| ------------------- | ----------------------------------------------- | ----------------------------------- | +| `format` | `'([\[$all_status$ahead_behind\]]($style) )'` | Định dạng mặc định cho `git_status` | +| `conflicted` | `"="` | Nhánh này có nhiều merge conflicts. | +| `ahead` | `"⇡"` | Định dạng của `ahead` | +| `behind` | `"⇣"` | Định dạng của `behind` | +| `diverged` | `"⇕"` | Định dạng của `diverged` | +| `up_to_date` | `""` | The format of `up_to_date` | +| `untracked` | `"?"` | Định dạng của `untracked` | +| `stashed` | `"$"` | Định dạng của `stashed` | +| `modified` | `"!"` | Định dạng của `modified` | +| `staged` | `"+"` | Định dạng của `modified` | +| `renamed` | `"»"` | Định dạng của `renamed` | +| `deleted` | `"✘"` | Định dạng của `deleted` | +| `style` | `"bold red"` | Kiểu cho module. | +| `ignore_submodules` | `false` | Ignore changes to submodules. | +| `disabled` | `false` | Disables the `git_status` module. | ### Các biến -Các biến dưới đây có thể được sử dụng trong `format`: +The following variables can be used in `format`: | Biến | Mô tả | | -------------- | ------------------------------------------------------------------------------------------------------------- | @@ -1370,14 +1384,14 @@ Các biến dưới đây có thể được sử dụng trong `format`: \*: Biến này có thể chỉ được sử dụng như một phần của style string -Các biến sau có thể được sử dụng trong `diverged`: +The following variables can be used in `diverged`: | Biến | Mô tả | | -------------- | --------------------------------------------- | | `ahead_count` | Số lượng commit phía trước của nhánh tracking | | `behind_count` | Số lượng commit phía sau nhánh tracking | -Các biến sau có thể được sử dụng trong `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`: | Biến | Mô tả | | ------- | ----------------------------- | @@ -1402,7 +1416,7 @@ renamed = "👅" deleted = "🗑" ``` -Hiển thị tổng số nhánh phía trước/phía sau của nhánh được track +Show ahead/behind count of the branch being tracked ```toml # ~/.config/starship.toml @@ -1499,7 +1513,7 @@ format = "via [⎈ $version](bold white) " ## Hostname -Mô đun `hostname` hiển thị hostnam hệ thống. +The `hostname` module shows the system hostname. ### Các tuỳ chọn @@ -1513,10 +1527,10 @@ Mô đun `hostname` hiển thị hostnam hệ thống. ### Các biến -| Biến | Ví dụ | Mô tả | -| --------- | ----- | -------------------------------- | -| symbol | | Giá trị ghi đè tuỳ chọn `symbol` | -| style\* | | Giá trị ghi đè của `style` | +| Biến | Ví dụ | Mô tả | +| --------- | ---------- | ---------------------------- | +| hostname | `computer` | The hostname of the computer | +| style\* | | Giá trị ghi đè của `style` | \*: Biến này có thể chỉ được sử dụng như một phần của style string @@ -1573,7 +1587,7 @@ symbol = "🌟 " ## Jobs -`jobs` module cho biết số lượng các jobs đang chạy. Mô đun sẽ được hiển thị chỉ khi có background jobs đang chạy. 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: @@ -1712,17 +1726,17 @@ symbol = "🅺 " # ~/.config/starship.toml [kotlin] -# Sử dụng Kitlin Compiler nhị phân để lấy phiên bản được cài đặt +# Uses the Kotlin Compiler binary to get the installed version kotlin_binary = "kotlinc" ``` ## Kubernetes -Displays the current [Kubernetes context](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#context) name and, if set, the namespace from the kubeconfig file. Namespace cần được thiết lập trong tệp tin kubeconfig, cài này có thể được thực thi thông qua `kubectl config set-context starship-cluster --namespace astronaut`. Nếu biến môi trường `$KUBECONFIG` được thiết lập, mô đun sẽ sử dụng cái đó nếu nó không sử dụng `~/.kube/config`. +Displays the current [Kubernetes context](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#context) name and, if set, the namespace from the kubeconfig file. The namespace needs to be set in the kubeconfig file, this can be done via `kubectl config set-context starship-cluster --namespace astronaut`. If the `$KUBECONFIG` env var is set the module will use that if not it will use the `~/.kube/config`. -::: thử thuật +::: tip -Mặc định, mô đun này được vô hiệu. Để kích hoạt nó, thiết lập `disabled` sang `false` trong tập tin cấu hình của bạn. +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: @@ -1848,9 +1862,9 @@ The `memory_usage` module shows current system memory and swap usage. By default the swap usage is displayed if the total system swap is non-zero. -::: thử thuật +::: tip -Mặc định, mô đun này được vô hiệu. Để kích hoạt nó, thiết lập `disabled` sang `false` trong tập tin cấu hình của bạn. +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: @@ -2133,7 +2147,7 @@ symbol = "☁️ " ## Package Version -The `package` module is shown when the current directory is the repository for a package, and shows its current version. The module currently supports `npm`, `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`, `shards` and `dart` packages. - [**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 @@ -2150,6 +2164,7 @@ The `package` module is shown when the current directory is the repository for a - [**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 - [**SBT**](https://scala-sbt.org) - The `sbt` package version is extracted from the `build.sbt` present in the current directory +- [**Dart**](https://pub.dev/) - The `dart` package version is extracted from the `pubspec.yaml` 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. @@ -2267,7 +2282,7 @@ format = "via [🔹 $version](147 bold) " The `pulumi` module shows the currently selected [Pulumi Stack](https://www.pulumi.com/docs/intro/concepts/stack/) and version. -::: thử thuật +::: tip By default the Pulumi version is not shown, since it takes an order of magnitude longer to load then most plugins (~70ms). If you still want to enable it, [follow the example shown below](#with-pulumi-version). @@ -2393,7 +2408,7 @@ Mặc định module sẽ được hiển thị nếu có bất kì điều ki | `detect_folders` | `[]` | Thư mục nào sẽ kích hoạt mô-đun này | | `disabled` | `false` | Disables the `python` module. | -::: thử thuật +::: tip The `python_binary` variable accepts either a string or a list of strings. Starship will try executing each binary until it gets a result. Note you can only change the binary that Starship executes to get the version of Python not the arguments that are used. @@ -2655,9 +2670,9 @@ symbol = "🌟 " The `shell` module shows an indicator for currently used shell. -::: thử thuật +::: tip -Mặc định, mô đun này được vô hiệu. Để kích hoạt nó, thiết lập `disabled` sang `false` trong tập tin cấu hình của bạn. +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: @@ -2673,6 +2688,8 @@ Mặc định, mô đun này được vô hiệu. Để kích hoạt nó, thiế | `elvish_indicator` | `esh` | A format string used to represent elvish. | | `tcsh_indicator` | `tsh` | A format string used to represent tcsh. | | `xonsh_indicator` | `xsh` | A format string used to represent xonsh. | +| `cmd_indicator` | `cmd` | A format string used to represent cmd. | +| `nu_indicator` | `nu` | A format string used to represent nu. | | `unknown_indicator` | | The default value to be displayed when the shell is unknown. | | `format` | `"[$indicator]($style) "` | Định dạng cho module. | | `style` | `"white bold"` | Kiểu cho module. | @@ -2772,13 +2789,13 @@ format = '[📦 \[$env\]]($style) ' The `status` module displays the exit code of the previous command. The module will be shown only if the exit code is not `0`. -::: thử thuật +::: tip -Mặc định, mô đun này được vô hiệu. Để kích hoạt nó, thiết lập `disabled` sang `false` trong tập tin cấu hình của bạn. +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: -::: warning This module is not supported on elvish and nu shell. ::: +::: warning This module is not supported on nu shell. ::: ### Các tuỳ chọn @@ -2804,6 +2821,7 @@ Mặc định, mô đun này được vô hiệu. Để kích hoạt nó, thiế | Biến | Ví dụ | Mô tả | | -------------- | ------- | ------------------------------------------------------------------------------------------- | | status | `127` | The exit code of the last command | +| hex_status | `0x7F` | The exit code of the last command in hex | | int | `127` | The exit code of the last command | | common_meaning | `ERROR` | Meaning of the code if not a signal | | signal_number | `9` | Signal number corresponding to the exit code, only if signalled | @@ -2834,9 +2852,9 @@ disabled = false The `sudo` module displays if sudo credentials are currently cached. The module will only be shown if credentials are cached. -::: thử thuật +::: tip -Mặc định, mô đun này được vô hiệu. Để kích hoạt nó, thiết lập `disabled` sang `false` trong tập tin cấu hình của bạn. +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: @@ -2923,7 +2941,7 @@ format = "via [🏎 $version](red bold)" The `terraform` module shows the currently selected [Terraform workspace](https://www.terraform.io/docs/language/state/workspaces.html) and version. -::: thử thuật +::: tip By default the Terraform version is not shown, since this is slow for current versions of Terraform when a lot of plugins are in use. If you still want to enable it, [follow the example shown below](#with-terraform-version). @@ -2982,9 +3000,9 @@ format = "[🏎💨 $workspace]($style) " The `time` module shows the current **local** time. The `format` configuration value is used by the [`chrono`](https://crates.io/crates/chrono) crate to control how the time is displayed. Take a look [at the chrono strftime docs](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) to see what options are available. -::: thử thuật +::: tip -Mặc định, mô đun này được vô hiệu. Để kích hoạt nó, thiết lập `disabled` sang `false` trong tập tin cấu hình của bạn. +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: @@ -3033,7 +3051,7 @@ The `username` module shows active user's username. Module cho sẽ được hi - The user is currently connected as an SSH session - The variable `show_always` is set to true -::: thử thuật +::: tip SSH connection is detected by checking environment variables `SSH_CONNECTION`, `SSH_CLIENT`, and `SSH_TTY`. If your SSH host does not set up these variables, one workaround is to set one of them with a dummy value. @@ -3224,19 +3242,19 @@ These modules will be shown if any of the following conditions are met: - The `when` command returns 0 - The current Operating System (std::env::consts::OS) matchs with `os` field if defined. -::: thử thuật +::: tip Multiple custom modules can be defined by using a `.`. ::: -::: thử thuật +::: tip The order in which custom modules are shown can be individually set by including `${custom.foo}` in the top level `format` (as it includes a dot, you need to use `${...}`). By default, the `custom` module will simply show all custom modules in the order they were defined. ::: -::: thử thuật +::: tip [Issue #1252](https://github.com/starship/starship/discussions/1252) contains examples of custom modules. If you have an interesting example not covered there, feel free to share it there! diff --git a/docs/vi-VN/faq/README.md b/docs/vi-VN/faq/README.md index 00be10735..4613fb740 100644 --- a/docs/vi-VN/faq/README.md +++ b/docs/vi-VN/faq/README.md @@ -69,13 +69,13 @@ Nếu bạn thấy các biểu tượng bạn không biết, bạn có thể s You can enable the debug logs by using the `STARSHIP_LOG` env var. These logs can be very verbose so it is often useful to use the `module` command if you are trying to debug a particular module, for example, if you are trying to debug the `rust` module you could run the following command to get the trace logs and output from the module. ```sh -env STARHIP_LOG=trace starship module rust +env STARSHIP_LOG=trace starship module rust ``` If starship is being slow you can try using the `timings` command to see if there is a particular module or command that to blame. ```sh -env STARHIP_LOG=trace starship timings +env STARSHIP_LOG=trace starship timings ``` This will output the trace log and a breakdown of all modules that either took more than 1ms to execute or produced some output. @@ -118,5 +118,5 @@ If Starship was installed using the install script, the following command will d ```sh # Locate and delete the starship binary -sh -c 'rm "$(which starship)"' +sh -c 'rm "$(command -v 'starship')"' ``` diff --git a/docs/vi-VN/guide/README.md b/docs/vi-VN/guide/README.md index 032fbbb5b..369c7a3b0 100644 --- a/docs/vi-VN/guide/README.md +++ b/docs/vi-VN/guide/README.md @@ -72,6 +72,22 @@ height="20" src="https://raw.githubusercontent.com/starship/starship/master/media/flag-fr.png" alt="Thiếng Pháp" + /> +   + Bahasa Indonesia +   + Italiano   Tiếng Nhật   Tiếng Nga   Tiếng Trung giản thể   Tiếng Trung hiện đại

@@ -252,7 +268,7 @@ #### Elvish - **Cảnh báo** Chỉ elvish v0.15 hoặc cao hơn được hỗ trợ. Thêm đoạn sau vào cuối tệp tin `~/.elvish/rc.elv`: + **Warning** Only elvish v0.17 or higher is supported. Thêm đoạn sau vào cuối tệp tin `~/.elvish/rc.elv`: ```sh # ~/.elvish/rc.elv @@ -283,9 +299,20 @@ ``` + #### Cmd + + You need to use [Clink](https://chrisant996.github.io/clink/clink.html) (v1.2.30+) with Cmd. Add the following to a file `starship.lua` and place this file in Clink scripts directory: + + ```lua + -- starship.lua + + load(io.popen('starship init cmd'):read("*a"))() + ``` + + #### Nushell - **Cảnh báo ** Cái này có thể bị thay đổi trong tương lai. Chỉ có nu phiên bản v. 033 hoặc cao hơn được hỗ trợ. Thêm dòng sau vào file cấu hình nu. Bạn có thể kiểm tra vị trí của cái file này bằng cách chạy `đường dẫn cấu hình` trong nu. + **Warning** This will change in the future. Chỉ có nu phiên bản v. 033 hoặc cao hơn được hỗ trợ. Add the following to your nu config file. Bạn có thể kiểm tra vị trí của cái file này bằng cách chạy `đường dẫn cấu hình` trong nu. ```toml startup = [ diff --git a/docs/vi-VN/presets/README.md b/docs/vi-VN/presets/README.md index 8195f1e8a..ed0d4c207 100644 --- a/docs/vi-VN/presets/README.md +++ b/docs/vi-VN/presets/README.md @@ -224,7 +224,7 @@ format = '\[[$symbol($version)]($style)\]' format = '\[[$symbol($version)]($style)\]' [sudo] -format = '\[[as $symbol]\] +format = '\[[as $symbol]\]' [swift] format = '\[[$symbol($version)]($style)\]' diff --git a/docs/zh-CN/README.md b/docs/zh-CN/README.md index 48a9cb7ab..4b985a9d7 100644 --- a/docs/zh-CN/README.md +++ b/docs/zh-CN/README.md @@ -18,7 +18,7 @@ features: footer: ISC Licensed | Copyright © 2019-present Starship Contributors #Used for the description meta tag, for SEO metaTitle: "Starship:可用于各种 Shell 的提示符" -description: Starship is the minimal, blazing fast, and extremely customizable prompt for any shell! Shows the information you need, while staying sleek and minimal. Quick installation available for Bash, Fish, ZSH, Ion, Tcsh, Elvish, Nu, Xonsh, and PowerShell. +description: Starship is the minimal, blazing fast, and extremely customizable prompt for any shell! Shows the information you need, while staying sleek and minimal. Quick installation available for Bash, Fish, ZSH, Ion, Tcsh, Elvish, Nu, Xonsh, Cmd, and PowerShell. ---
@@ -44,7 +44,7 @@ description: Starship is the minimal, blazing fast, and extremely customizable p ```sh sh -c "$(curl -fsSL https://starship.rs/install.sh)" ``` - To update the Starship itself, rerun the above script. It will replace the current version without touching Starship's configuration. + 自更新 Starship ,运行下面脚本 将会在不改动 Starship 配置文件的情况下升级版本 #### 通过软件包管理器安装 @@ -119,9 +119,9 @@ description: Starship is the minimal, blazing fast, and extremely customizable p #### Elvish - ::: warning Only elvish v0.15 or higher is supported. ::: + ::: warning Only elvish v0.17 or higher is supported. ::: - Add the following to the end of `~/.elvish/rc.elv`: + 在 `~/.config/fish/rc.elv` 的最后,添加以下内容: ```sh # ~/.elvish/rc.elv @@ -132,7 +132,7 @@ description: Starship is the minimal, blazing fast, and extremely customizable p #### Tcsh - Add the following to the end of `~/.tcshrc`: + 在 `~/.bashhrc` 的最后,添加以下内容: ```sh # ~/.tcshrc @@ -164,3 +164,14 @@ description: Starship is the minimal, blazing fast, and extremely customizable p execx($(starship init xonsh)) ``` + + + #### Cmd + + 您需要使用 [Clink](https://chrisant996.github.io/clink/clink.html) (v1.2.30+) 与 Cmd. 将以下文件添加到文件 `starship.lua` 中,并将此文件放置在 Clink脚本目录中: + + ```lua + -- starship.lua + + load(io.popen('starship init cmd'):read("*a"))() + ``` diff --git a/docs/zh-CN/advanced-config/README.md b/docs/zh-CN/advanced-config/README.md index 6350c0de0..4c532d2d7 100644 --- a/docs/zh-CN/advanced-config/README.md +++ b/docs/zh-CN/advanced-config/README.md @@ -8,11 +8,35 @@ ::: -## 在 Bash 中自定义预提示和预执行命令 +## Custom pre-prompt and pre-execution Commands in Cmd -Bash 并没有类似大多数其它 shell 的正式预执行/预命令框架。 因此,很难在 `bash` 中提供完全可自定义的 hook 机制。 然而,Starship 确实能使您有限地在提示符渲染过程中插入自己的函数执行: +Clink provides extremely flexible APIs to run pre-prompt and pre-exec commands in Cmd shell. It is fairly simple to use with Starship. Make the following changes to your `starship.lua` file as per your requirements: -- 若要在提示符显示之前运行自定义函数,需要定义此函数,然后将函数名赋值给 `starship_reserved_user_func`。 例如,要在提示符之前绘制一枚火箭,您应该写 +- To run a custom function right before the prompt is drawn, define a new function called `starship_preprompt_user_func`. This function receives the current prompt as a string that you can utilize. For example, to draw a rocket before the prompt, you would do + +```lua +function starship_preprompt_user_func(prompt) + print("🚀") +end + +load(io.popen('starship init cmd'):read("*a"))() +``` + +- To run a custom function right before a command is executed, define a new function called `starship_precmd_user_func`. This function receives the current commandline as a string that you can utilize. For example, to print the command that's about to be executed, you would do + +```lua +function starship_precmd_user_func(line) + print("Executing: "..line) +end + +load(io.popen('starship init cmd'):read("*a"))() +``` + +## Custom pre-prompt and pre-execution Commands in Bash + +Bash does not have a formal preexec/precmd framework like most other shells. Because of this, it is difficult to provide fully customizable hooks in `bash`. 然而,Starship 确实能使您有限地在提示符渲染过程中插入自己的函数执行: + +- To run a custom function right before the prompt is drawn, define a new function and then assign its name to `starship_precmd_user_func`. For example, to draw a rocket before the prompt, you would do ```bash function blastoff(){ @@ -21,13 +45,13 @@ function blastoff(){ starship_precmd_user_func="blastoff" ``` -- 要在一个命令运行前运行自定义函数,您可以使用 [`DEBUG` trap 机制](https://jichu4n.com/posts/debug-trap-and-prompt_command-in-bash/)。 然而,您**必须**在捕捉 DEBUG 信号*之前*启动 Starship! Starship 可以保留 DEBUG trap 的值,但如果该 trap 在 starship 启动后被覆盖,一些功能将会被破坏。 +- To run a custom function right before a command runs, you can use the [`DEBUG` trap mechanism](https://jichu4n.com/posts/debug-trap-and-prompt_command-in-bash/). However, you **must** trap the DEBUG signal *before* initializing Starship! Starship can preserve the value of the DEBUG trap, but if the trap is overwritten after starship starts up, some functionality will break. ```bash function blastoff(){ echo "🚀" } -trap blastoff DEBUG # 启动 starship *之前* 设置 DEBUG trap +trap blastoff DEBUG # Trap DEBUG *before* running starship eval $(starship init bash) ``` @@ -43,11 +67,11 @@ function Invoke-Starship-PreCommand { } ``` -## 更改窗口标题 +## Change Window Title -一些 shell 会自动更改您的窗口标题(比如改成您的工作目录)。 Fish 甚至默认会执行此功能。 Starship 没有实现此功能,但将这个功能添加到 `bash` 或 `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`, `zsh`, `cmd` or `powershell`. -首先,定义窗口标题更改函数(在 bash 和 zsh 中相同): +First, define a window title change function (identical in bash and zsh): ```bash function set_win_title(){ @@ -55,23 +79,23 @@ function set_win_title(){ } ``` -您可以使用变量来定制标题(常用的有 `$USER`,`$HOSTNAME` 和 `$PWD`)。 +You can use variables to customize this title (`$USER`, `$HOSTNAME`, and `$PWD` are popular choices). -在 `bash` 中,设置此函数为 starship 预执行函数: +In `bash`, set this function to be the precmd starship function: ```bash starship_precmd_user_func="set_win_title" ``` -在 `zsh`中,将此函数添加到 `reservmd_functions` 列表: +In `zsh`, add this to the `precmd_functions` array: ```bash precmd_functions+=(set_win_title) ``` -如果您对产生的效果感到满意,请将以上代码添加到您的 shell 配置文件(`~/.bashrc` 或 `~/zsrhc`)中以使其永久化。 +If you like the result, add these lines to your shell configuration file (`~/.bashrc` or `~/.zshrc`) to make it permanent. -例如,如果您想要在终端标签标题中显示当前目录, 将以下代码添加到您的 `~/.ashrc` 或 `~/.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`: ```bash function set_win_title(){ @@ -80,6 +104,16 @@ function set_win_title(){ starship_precmd_user_func="set_win_title" ``` +For Cmd, you can change the window title using the `starship_preprompt_user_func` function. + +```lua +function starship_preprompt_user_func(prompt) + console.settitle(os.getenv('USERNAME').."@"..os.getenv('COMPUTERNAME')..": "..os.getcwd()) +end + +load(io.popen('starship init cmd'):read("*a"))() +``` + You can also set a similar output with PowerShell by creating a function named `Invoke-Starship-PreCommand`. ```powershell @@ -91,13 +125,13 @@ function Invoke-Starship-PreCommand { Invoke-Expression (&starship init powershell) ``` -## 启用右侧提示 +## Enable Right Prompt -一些 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`. +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`. 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` is currently supported for the following shells: elvish, fish, zsh, xonsh, cmd. ### 示例 @@ -117,10 +151,32 @@ Produces a prompt like the following: ▶ starship on  rprompt [!] is 📦 v0.57.0 via 🦀 v1.54.0 took 17s ``` +## Continuation Prompt + +Some shells support a continuation prompt along with the normal prompt. This prompt is rendered instead of the normal prompt when the user has entered an incomplete statement (such as a single left parenthesis or quote). + +Starship can set the continuation prompt using the `continuation_prompt` option. The default prompt is `"[∙](bright-black) "`. + +Note: `continuation_prompt` should be set to a literal string without any variables. + +Note: Continuation prompts are only available in the following shells: + + - `bash` + - `zsh` + - `PowerShell` + +### 示例 + +```toml +# ~/.config/starship.toml + +# A continuation prompt that displays two filled in arrows +continuation_prompt = "▶▶" +``` ## 样式设定 -样式字符串是用空格分隔的单词列表。 其中单词不是大小写敏感的(例如 `bold` 和 `BoLd` 被视为同一字符串)。 每个单词可以是以下之一: +Style strings are a list of words, separated by whitespace. The words are not case sensitive (i.e. `bold` and `BoLd` are considered the same string). Each word can be one of the following: - `bold` - `italic` @@ -132,14 +188,14 @@ Produces a prompt like the following: - `` - `none` -`` 是颜色说明符(下面解释)。 `fg:` and `` currently do the same thing, though this may change in the future. `inverted` swaps the background and foreground colors. 字符串中的单词顺序不影响显示结果。 +where `` is a color specifier (discussed below). `fg:` and `` 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. -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` 与其它标识符一起使用视为一种错误。 +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. -颜色说明符可以是以下内容之一: +A color specifier can be one of the following: - - 标准终端颜色之一:`black`,`red`,`green`,`blue`,`yellow`,`purple`,`cyan`,`white`。 您可以使用可选前缀 `bright-` 来获取明亮版本的颜色(例如,`bright-white`)。 - - 一个 `#` 后跟一个六位十六进制数。 这将指定一个 [十六进制 RGB 颜色代码](https://www.w3schools.com/colors/colors_hexadecimal.asp)。 - - 0-255 之间的数字。 这将指定一个 [8 位 ANSI 颜色码](https://i.stack.imgur.com/KTSQa.png)。 + - One of the standard terminal colors: `black`, `red`, `green`, `blue`, `yellow`, `purple`, `cyan`, `white`. You can optionally prefix these with `bright-` to get the bright version (e.g. `bright-white`). + - A `#` followed by a six-digit hexadecimal number. This specifies an [RGB color hex code](https://www.w3schools.com/colors/colors_hexadecimal.asp). + - A number between 0-255. This specifies an [8-bit ANSI Color Code](https://i.stack.imgur.com/KTSQa.png). -如果为文本/背景指定了多个颜色,字符串中最后指定的颜色将具有最高优先级。 +If multiple colors are specified for foreground/background, the last one in the string will take priority. diff --git a/docs/zh-CN/config/README.md b/docs/zh-CN/config/README.md index 7debf017a..667d1c48a 100644 --- a/docs/zh-CN/config/README.md +++ b/docs/zh-CN/config/README.md @@ -9,11 +9,11 @@ mkdir -p ~/.config && touch ~/.config/starship.toml Starship 的所有配置都在此 [TOML](https://github.com/toml-lang/toml) 配置文件中完成: ```toml -# Inserts a blank line between shell prompts +# 在shell提示符插入新行 add_newline = true -# Replace the "❯" symbol in the prompt with "➜" -[character] # The name of the module we are configuring is "character" +# 在提示处使用"➜"替换"❯" +[character] # 配置的模块名:character success_symbol = "[➜](bold green)" # The "success_symbol" segment is being set to "➜" with the color "bold green" # Disable the package module, hiding it from the prompt completely @@ -24,18 +24,24 @@ disabled = true 您可以使用 `STARSHIP_CONFIG` 环境变量更改默认配置文件的位置: ```sh -export STARSHIP_CONFIG=~/.starship/config.toml +export STARSHIP_CONFIG=~/example/non/default/path/starship.toml ``` 在 PowerShell (Windows) 中,在 `$PROFILE` 中添加下面的代码行能达到同样的效果: ```powershell -$ENV:STARSHIP_CONFIG = "$HOME\.starship\config.toml" +$ENV:STARSHIP_CONFIG = "$HOME\example\non\default\path\starship.toml" +``` + +Or for Cmd (Windows) would be adding this line to your `starship.lua`: + +```lua +os.setenv('STARSHIP_CONFIG', 'C:\\Users\\user\\example\\non\\default\\path\\starship.toml') ``` ### 日志 -默认情况下,Starship 会将警告和错误日志记录到文件 `~/.cache/starship/session_${STARSHIP_SESSION_KEY}.log`. 其中 session key 与您的终端实例相对应。 不过,这也可以使用 `STARSHIP_CACHE` 环境变量来修改: +By default starship logs warnings and errors into a file named `~/.cache/starship/session_${STARSHIP_SESSION_KEY}.log`, where the session key is corresponding to a instance of your terminal. This, however can be changed using the `STARSHIP_CACHE` environment variable: ```sh export STARSHIP_CACHE=~/.starship/cache @@ -47,9 +53,15 @@ export STARSHIP_CACHE=~/.starship/cache $ENV:STARSHIP_CACHE = "$HOME\AppData\Local\Temp" ``` +Or for Cmd (Windows) would be adding this line to your `starship.lua`: + +```lua +os.setenv('STARSHIP_CACHE', 'C:\\Users\\user\\AppData\\Local\\Temp') +``` + ### 术语 -**组件(Module)**:提示符的组成部分,通过来自系统的上下文信息向用户显示各种信息。 例如,如果您当前的目录是 Node.js 项目,“nodejs” 模块会显示当前安装在您电脑上的 Node.js 的版本。 +**Module**: A component in the prompt giving information based on contextual information from your OS. For example, the "nodejs" module shows the version of Node.js that is currently installed on your computer, if your current directory is a Node.js project. **Variable**: Smaller sub-components that contain information provided by the module. For example, the "version" variable in the "nodejs" module contains the current version of Node.js. @@ -85,7 +97,7 @@ For example: #### 样式设定 -Starship 中的大多数组件允许您为其设置显示样式。 显示样式可以通过一个字符串字段(一般是 `style`)来设置。 以下的例子给出了一些样式字符串并描述了它们的效果。 样式字符串的完整语法请查阅 [高级配置指南](/advanced-config/)。 +Most modules in starship allow you to configure their display styles. This is done with an entry (usually called `style`) which is a string specifying the configuration. Here are some examples of style strings along with what they do. For details on the full syntax, consult the [advanced config guide](/advanced-config/). - `"fg:green bg:blue"` 在蓝色背景上显示绿色文本 - `"bg:blue fg:bright-green"` 在蓝色背景上显示亮绿色文本 @@ -94,7 +106,7 @@ Starship 中的大多数组件允许您为其设置显示样式。 显示样式 - `"bold italic fg:purple"` 设置文本为粗体、意大利体,颜色为紫色 - `""` 显式禁用所有样式 -请注意,最终的显示样式将由您的终端模拟器控制。 例如,有的终端模拟器对于“bold”属性的文本是加亮颜色而不是加粗文字,有的颜色主题对“普通”和“明亮”两种属性的颜色使用相同的颜色值。 此外,要获得意大利体文本(一般设计为斜体),您的终端必须支持意大利体显示。 +Note that what styling looks like will be controlled by your terminal emulator. For example, some terminal emulators will brighten the colors instead of bolding text, and some color themes use the same values for the normal and bright colors. Also, to get italic text, your terminal must support italics. #### Conditional Format Strings @@ -131,7 +143,7 @@ format = ''' ## 提示符 -以下是关于提示符的配置项。 +This is the list of prompt-wide configuration options. ### 配置项 @@ -164,7 +176,7 @@ add_newline = false ### 默认提示符格式 -The default `format` is used to define the format of the prompt, if empty or no `format` is provided. 默认设置如下: +The default `format` is used to define the format of the prompt, if empty or no `format` is provided. The default is as shown: ```toml format = "$all" @@ -248,7 +260,7 @@ format="$all$directory$character" ## AWS -`aws` 组件显示当前 AWS 主机所在区域与配置信息。 各组件基于 `AWS_REGION`,`AWS_DEFAULT_REGION` 和 `AWS_PROFILE` 环境变量与 `~/.aws/config` 文件。 This module also shows an expiration timer when using temporary credentials. +The `aws` module shows the current AWS region and profile. This is based on `AWS_REGION`, `AWS_DEFAULT_REGION`, and `AWS_PROFILE` env var with `~/.aws/config` file. This module also shows an expiration timer when using temporary credentials. When using [aws-vault](https://github.com/99designs/aws-vault) the profile is read from the `AWS_VAULT` env var and the credentials expiration date is read from the `AWS_SESSION_EXPIRATION` env var. @@ -347,7 +359,7 @@ style = "blue bold" ## Battery -`battery` 组件显示电池充电情况和当前充电状态。 这个组件只会在当前电量低于 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%. ### 配置项 @@ -375,7 +387,7 @@ discharging_symbol = "💀 " ### Battery 组件的显示 -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. The default is as shown: ```toml [[battery.display]] @@ -387,7 +399,7 @@ 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 | 默认值 | 描述 | | -------------------- | ---------- | --------------------------------------------------------------------------------------------------------- | @@ -414,9 +426,9 @@ discharging_symbol = "💦" ## 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 shape (`❯`/`✖`) @@ -425,13 +437,13 @@ By default it only changes color. If you also want to change its shape take a lo ::: warning -`error_symbol` is not supported on elvish and nu shell. +`error_symbol` is not supported on nu shell. ::: ::: warning -`vicmd_symbol` is only supported in fish and zsh. +`vicmd_symbol` is only supported in cmd, fish and zsh. ::: @@ -544,15 +556,15 @@ The `cobol` module shows the currently installed version of COBOL. By default, t ## 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. ### 配置项 @@ -568,7 +580,7 @@ The `cobol` module shows the currently installed version of COBOL. By default, t ::: tip -Showing desktop notifications requires starship to be built with `rust-notify` support. You check if your starship supports notifications by running `STARSHIP_LOG=debug starship module cmd_duration -d 60000` when `show_notifications` is set to `true`. +Showing desktop notifications requires starship to be built with `notify-rust` support. You check if your starship supports notifications by running `STARSHIP_LOG=debug starship module cmd_duration -d 60000` when `show_notifications` is set to `true`. ::: @@ -597,7 +609,7 @@ The `conda` module shows the current [Conda](https://docs.conda.io/en/latest/) e ::: 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`. ::: @@ -713,20 +725,20 @@ format = "via [🔰 $version](bold red) " ## Deno The `deno` module shows you your currently installed version of [Deno](https://deno.land/). By default the module will be shown if any of the following conditions are met: -- The current directory contains a `mod.ts`, `mod.js`, `deps.ts` or `deps.js` file +- The current directory contains a `deno.json`, `deno.jsonc`, `mod.ts`, `mod.js`, `deps.ts` or `deps.js` file ### 配置项 -| Option | 默认值 | 描述 | -| ------------------- | -------------------------------------------- | ------------------------------------------------------------------------- | -| `format` | `"via [$symbol($version )]($style)"` | 组件格式化模板。 | -| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | -| `symbol` | `"🦕 "` | A format string representing the symbol of Deno | -| `detect_extensions` | `[]` | Which extensions should trigger this module. | -| `detect_files` | `["mod.ts", "mod.js", "deps.ts", "deps.js"]` | Which filenames should trigger this module. | -| `detect_folders` | `[]` | Which folders should trigger this module. | -| `style` | `"green bold"` | 此组件的样式。 | -| `disabled` | `false` | Disables the `deno` module. | +| Option | 默认值 | 描述 | +| ------------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `format` | `"via [$symbol($version )]($style)"` | 组件格式化模板。 | +| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | +| `symbol` | `"🦕 "` | A format string representing the symbol of Deno | +| `detect_extensions` | `[]` | Which extensions should trigger this module. | +| `detect_files` | `["deno.json", "deno.jsonc", "mod.ts", "mod.js", "deps.ts", "deps.js"]` | Which filenames should trigger this module. | +| `detect_folders` | `[]` | Which folders should trigger this module. | +| `style` | `"green bold"` | 此组件的样式。 | +| `disabled` | `false` | Disables the `deno` module. | ### Variables @@ -747,29 +759,30 @@ format = "via [🦕 $version](green bold) " ## 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 | 默认值 | 描述 | -| ------------------- | -------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `truncation_length` | `3` | 当前目录路径被截断后最多保留的父目录数量。 | -| `truncate_to_repo` | `true` | 是否只截断到您当前处于的 git 仓库根目录下。 | -| `format` | `"[$path]($style)[$read_only]($read_only_style) "` | 组件格式化模板。 | -| `style` | `"bold cyan"` | 此组件的样式。 | -| `disabled` | `false` | 禁用 `directory` 组件。 | -| `read_only` | `"🔒"` | The symbol indicating current directory is read only. | -| `read_only_style` | `"red"` | The style for the read only symbol. | -| `truncation_symbol` | `""` | The symbol to prefix to truncated paths. eg: "…/" | -| `repo_root_style` | `None` | The style for the root of the git repo when `truncate_to_repo` option is set to false. | -| `home_symbol` | `"~"` | The symbol indicating home directory. | +| Option | 默认值 | 描述 | +| ------------------- | -------------------------------------------------- | --------------------------------------------------------------------------------------- | +| `truncation_length` | `3` | 当前目录路径被截断后最多保留的父目录数量。 | +| `truncate_to_repo` | `true` | 是否只截断到您当前处于的 git 仓库根目录下。 | +| `format` | `"[$path]($style)[$read_only]($read_only_style) "` | 组件格式化模板。 | +| `style` | `"bold cyan"` | 此组件的样式。 | +| `disabled` | `false` | 禁用 `directory` 组件。 | +| `read_only` | `"🔒"` | The symbol indicating current directory is read only. | +| `read_only_style` | `"red"` | The style for the read only symbol. | +| `truncation_symbol` | `""` | The symbol to prefix to truncated paths. eg: "…/" | +| `repo_root_style` | `None` | The style for the root of the git repo when `truncate_to_repo` option is set to false. | +| `home_symbol` | `"~"` | The symbol indicating home directory. | +| `use_os_path_sep` | `true` | Use the OS specific path seperator instead of always using `/` (e.g. `\` on Windows) |
-此组件有几个高级配置选项来控制当前目录路径的显示方式。 +This module has a few advanced configuration options that control how the directory is displayed. | Advanced Option | 默认值 | 描述 | | --------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -846,7 +859,7 @@ format = "via [🐋 $context](blue bold)" ## 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: @@ -861,7 +874,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. -在内部,此组件使用自己的版本检测机制。 一般来说此组件是直接执行 `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 () when there is a csproj file in the current directory. @@ -984,7 +997,7 @@ format = "via [ $version](cyan bold) " ## 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` 是一个已存在的环境变量 - 未定义 `variable`,但定义了 `default` @@ -1174,7 +1187,7 @@ asia-northeast1 = "an1" ## Git Branch -`git_branch` 组件显示当前目录的 git 仓库的活动分支。 +The `git_branch` module shows the active branch of the repo in your current directory. ### 配置项 @@ -1249,7 +1262,7 @@ tag_symbol = "🔖 " ## 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. ### 配置项 @@ -1293,7 +1306,7 @@ The `git_metrics` module will show the number of added and deleted lines in the ::: tip -此组件默认被禁用。 若要启用此组件,请在配置文件中设置 `disable` 字段为 `false`。 +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: @@ -1330,26 +1343,27 @@ format = '[+$added]($added_style)/[-$deleted]($deleted_style) ' ## Git Status -`git_status`组件通过相应的符号显示您当前目录中 git 仓库的状态。 +The `git_status` module shows symbols representing the state of the repo in your current directory. ### 配置项 -| Option | 默认值 | 描述 | -| ------------ | ----------------------------------------------- | ----------------------------------- | -| `format` | `'([\[$all_status$ahead_behind\]]($style) )'` | The default format for `git_status` | -| `conflicted` | `"="` | 这个分支有合并冲突。 | -| `ahead` | `"⇡"` | The format of `ahead` | -| `behind` | `"⇣"` | The format of `behind` | -| `diverged` | `"⇕"` | The format of `diverged` | -| `up_to_date` | `""` | The format of `up_to_date` | -| `untracked` | `"?"` | The format of `untracked` | -| `stashed` | `"$"` | The format of `stashed` | -| `modified` | `"!"` | The format of `modified` | -| `staged` | `"+"` | The format of `staged` | -| `renamed` | `"»"` | The format of `renamed` | -| `deleted` | `"✘"` | The format of `deleted` | -| `style` | `"bold red"` | 此组件的样式。 | -| `disabled` | `false` | 禁用 `git_status` 组件。 | +| Option | 默认值 | 描述 | +| ------------------- | ----------------------------------------------- | ----------------------------------- | +| `format` | `'([\[$all_status$ahead_behind\]]($style) )'` | The default format for `git_status` | +| `conflicted` | `"="` | 这个分支有合并冲突。 | +| `ahead` | `"⇡"` | The format of `ahead` | +| `behind` | `"⇣"` | The format of `behind` | +| `diverged` | `"⇕"` | The format of `diverged` | +| `up_to_date` | `""` | The format of `up_to_date` | +| `untracked` | `"?"` | The format of `untracked` | +| `stashed` | `"$"` | The format of `stashed` | +| `modified` | `"!"` | The format of `modified` | +| `staged` | `"+"` | The format of `staged` | +| `renamed` | `"»"` | The format of `renamed` | +| `deleted` | `"✘"` | The format of `deleted` | +| `style` | `"bold red"` | 此组件的样式。 | +| `ignore_submodules` | `false` | Ignore changes to submodules. | +| `disabled` | `false` | Disables the `git_status` module. | ### Variables @@ -1499,7 +1513,7 @@ format = "via [⎈ $version](bold white) " ## Hostname -`hostname` 组件显示系统主机名。 +The `hostname` module shows the system hostname. ### 配置项 @@ -1513,10 +1527,10 @@ format = "via [⎈ $version](bold white) " ### Variables -| 字段 | 示例 | 描述 | -| --------- | -- | ----------- | -| symbol | | `symbol`对应值 | -| style\* | | `style`对应值 | +| 字段 | 示例 | 描述 | +| --------- | ---------- | ---------------------------- | +| hostname | `computer` | The hostname of the computer | +| style\* | | `style`对应值 | \*: This variable can only be used as a part of a style string @@ -1573,7 +1587,7 @@ 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: @@ -1722,7 +1736,7 @@ Displays the current [Kubernetes context](https://kubernetes.io/docs/concepts/co ::: tip -此组件默认被禁用。 若要启用此组件,请在配置文件中设置 `disable` 字段为 `false`。 +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: @@ -1784,7 +1798,7 @@ Long and automatically generated cluster names can be identified and shortened u ## Line Break -`line_break` 组件将提示分隔为两行。 +The `line_break` module separates the prompt into two lines. ### 配置项 @@ -1844,13 +1858,13 @@ format = "via [🌕 $version](bold blue) " ## Memory Usage -`memory_usage` 组件显示当前系统内存和交换区使用情况。 +The `memory_usage` module shows current system memory and swap usage. -默认情况下,如果系统交换区使用不为 0,则会显示交换区使用情况。 +By default the swap usage is displayed if the total system swap is non-zero. ::: tip -此组件默认被禁用。 若要启用此组件,请在配置文件中设置 `disable` 字段为 `false`。 +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: @@ -1891,7 +1905,7 @@ style = "bold dimmed green" ## Mercurial Branch -`hg_branch` 组件显示当前目录的 hg 仓库的活动分支。 +The `hg_branch` module shows the active branch of the repo in your current directory. ### 配置项 @@ -1969,7 +1983,7 @@ symbol = "🎣 " ## 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. ### 配置项 @@ -2133,7 +2147,7 @@ symbol = "☁️ " ## 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`, `shards` and `dart` packages. - [**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 @@ -2150,6 +2164,7 @@ symbol = "☁️ " - [**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 - [**SBT**](https://scala-sbt.org) - The `sbt` package version is extracted from the `build.sbt` present in the current directory +- [**Dart**](https://pub.dev/) - The `dart` package version is extracted from the `pubspec.yaml` present in the current directory > ⚠ 此组件显示的是源代码在当前目录中的软件包的版本,而不是包管理器的版本。 @@ -2363,7 +2378,7 @@ format = "via [$symbol$version](bold white)" The `python` module shows the currently installed version of [Python](https://www.python.org/) and the current [Python virtual environment](https://docs.python.org/tutorial/venv.html) if one is activated. -如果`pyenv_version_name`被设置为`true`, 本组件将会展示pyenv版本名。 否则则显示通过`python --version`获得的版本号 +If `pyenv_version_name` is set to `true`, it will display the pyenv version name. Otherwise, it will display the version number from `python --version`. By default the module will be shown if any of the following conditions are met: @@ -2657,7 +2672,7 @@ The `shell` module shows an indicator for currently used shell. ::: tip -此组件默认被禁用。 若要启用此组件,请在配置文件中设置 `disable` 字段为 `false`。 +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: @@ -2673,6 +2688,8 @@ The `shell` module shows an indicator for currently used shell. | `elvish_indicator` | `esh` | A format string used to represent elvish. | | `tcsh_indicator` | `tsh` | A format string used to represent tcsh. | | `xonsh_indicator` | `xsh` | A format string used to represent xonsh. | +| `cmd_indicator` | `cmd` | A format string used to represent cmd. | +| `nu_indicator` | `nu` | A format string used to represent nu. | | `unknown_indicator` | | The default value to be displayed when the shell is unknown. | | `format` | `"[$indicator]($style) "` | 组件格式化模板。 | | `style` | `"white bold"` | 此组件的样式。 | @@ -2774,11 +2791,11 @@ The `status` module displays the exit code of the previous command. The module w ::: tip -此组件默认被禁用。 若要启用此组件,请在配置文件中设置 `disable` 字段为 `false`。 +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: -::: warning This module is not supported on elvish and nu shell. ::: +::: warning This module is not supported on nu shell. ::: ### 配置项 @@ -2804,6 +2821,7 @@ The `status` module displays the exit code of the previous command. The module w | 字段 | 示例 | 描述 | | -------------- | ------- | ------------------------------------------------------------------------------------------- | | status | `127` | The exit code of the last command | +| hex_status | `0x7F` | The exit code of the last command in hex | | int | `127` | The exit code of the last command | | common_meaning | `ERROR` | Meaning of the code if not a signal | | signal_number | `9` | Signal number corresponding to the exit code, only if signalled | @@ -2836,7 +2854,7 @@ The `sudo` module displays if sudo credentials are currently cached. The module ::: tip -此组件默认被禁用。 若要启用此组件,请在配置文件中设置 `disable` 字段为 `false`。 +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: @@ -2980,11 +2998,11 @@ format = "[🏎💨 $workspace]($style) " ## Time -`time` 组件显示当前的 **本地** 时间。 `format` 字段值会提供给 [`chrono`](https://crates.io/crates/chrono) crate 用来控制时间显示方式。 请参阅 [chrono strftime 文档](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) 以了解可用格式选项。 +The `time` module shows the current **local** time. The `format` configuration value is used by the [`chrono`](https://crates.io/crates/chrono) crate to control how the time is displayed. Take a look [at the chrono strftime docs](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) to see what options are available. ::: tip -此组件默认被禁用。 若要启用此组件,请在配置文件中设置 `disable` 字段为 `false`。 +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: @@ -3000,7 +3018,7 @@ format = "[🏎💨 $workspace]($style) " | `disabled` | `true` | 禁用 `time` 组件。 | | `time_range` | `"-"` | Sets the time range during which the module will be shown. Times must be specified in 24-hours format | -If `use_12hr` is `true`, then `time_format` defaults to `"%r"`. 否则,其默认值为 `"%T"`。 Manually setting `time_format` will override the `use_12hr` setting. +If `use_12hr` is `true`, then `time_format` defaults to `"%r"`. Otherwise, it defaults to `"%T"`. Manually setting `time_format` will override the `use_12hr` setting. ### Variables @@ -3026,7 +3044,7 @@ time_range = "10:00:00-14:00:00" ## Username -`username` 组件显示当前活跃的用户名。 此组件只有满足以下条件之一时才会被显示: +The `username` module shows active user's username. 此组件只有满足以下条件之一时才会被显示: - 当前用户是 root - 当前用户与登录用户不相同 diff --git a/docs/zh-CN/faq/README.md b/docs/zh-CN/faq/README.md index 5b8439e2c..3168265ae 100644 --- a/docs/zh-CN/faq/README.md +++ b/docs/zh-CN/faq/README.md @@ -69,13 +69,13 @@ If you see symbols that you don't recognise you can use `starship explain` to ex You can enable the debug logs by using the `STARSHIP_LOG` env var. These logs can be very verbose so it is often useful to use the `module` command if you are trying to debug a particular module, for example, if you are trying to debug the `rust` module you could run the following command to get the trace logs and output from the module. ```sh -env STARHIP_LOG=trace starship module rust +env STARSHIP_LOG=trace starship module rust ``` If starship is being slow you can try using the `timings` command to see if there is a particular module or command that to blame. ```sh -env STARHIP_LOG=trace starship timings +env STARSHIP_LOG=trace starship timings ``` This will output the trace log and a breakdown of all modules that either took more than 1ms to execute or produced some output. @@ -118,5 +118,5 @@ Starship 的卸载过程与安装过程一样简单。 ```sh # Locate and delete the starship binary -sh -c 'rm "$(which starship)"' +sh -c 'rm "$(command -v 'starship')"' ``` diff --git a/docs/zh-CN/guide/README.md b/docs/zh-CN/guide/README.md index 3babddf41..9914a2b22 100644 --- a/docs/zh-CN/guide/README.md +++ b/docs/zh-CN/guide/README.md @@ -72,6 +72,22 @@ height="20" src="https://raw.githubusercontent.com/starship/starship/master/media/flag-fr.png" alt="Français" + /> +   + Bahasa Indonesia +   + Italiano   -Explore the Starship docs  ▶ +探索 Starship 文档

@@ -155,7 +171,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/). +**注意**: 由于平台众多,下面只显示支持的部分平台 找不到你的平台? 查看 [额外的平台说明](https://starship.rs/installing/)。 1. 安装 **starship** 二进制文件: @@ -169,9 +185,9 @@ sh -c "$(curl -fsSL https://starship.rs/install.sh)" ``` - To update the Starship itself, rerun the above script. It will replace the current version without touching Starship's configuration. + 自更新 Starship ,运行下面脚本 将会在不改动 Starship 配置文件的情况下升级版本 - **Note** - The defaults of the install script can be overridden see the built-in help. + **注意** - 可以覆盖安装脚本的默认值,请参阅内置帮助。 ```sh sh -c "$(curl -fsSL https://starship.rs/install.sh)" -- --help @@ -252,7 +268,7 @@ #### Elvish - **Warning** Only elvish v0.15 or higher is supported. Add the following to the end of `~/.elvish/rc.elv`: + **警告** 只支持 elvish v0.17 及以上。 在 `~/.config/fish/rc.elv` 的最后,添加以下内容: ```sh # ~/.elvish/rc.elv @@ -263,7 +279,7 @@ #### Tcsh - Add the following to the end of `~/.tcshrc`: + 在 `~/.bashhrc` 的最后,添加以下内容: ```sh # ~/.tcshrc @@ -274,7 +290,7 @@ #### Xonsh - Add the following to the end of `~/.xonshrc`: + 在 `~/.bashhrc` 的最后,添加以下内容: ```sh # ~/.xonshrc @@ -283,9 +299,20 @@ ``` + #### Cmd + + 您需要使用 [Clink](https://chrisant996.github.io/clink/clink.html) (v1.2.30+) 与 Cmd. 将以下文件添加到文件 `starship.lua` 中,并将此文件放置在 Clink脚本目录中: + + ```lua + -- starship.lua + + load(io.popen('starship init cmd'):read("*a"))() + ``` + + #### 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. + **警告** 将来可能会改变。 仅支持 nu 版本 v0.33 或更高版本。 在您的 nu config 中添加以下内容: 您可以用 nu 运行 `config path` 来检查此 文件的位置。 ```toml startup = [ @@ -300,7 +327,7 @@ 我们一直在寻找贡献者!**不论你的技能如何**你都可以参与贡献 。 如果您希望快速为项目作出贡献,请尝试解决 [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/). +如果你能流利地使用非英语语种,我们非常感谢你帮助翻译我们的文件并将其更新到其他语言。 如果您想要帮助,可以在 [Starship Crowdin](https://translate.starship.rs/) 上贡献翻译。 如果您有兴趣贡献于 Starship,请查看我们的[贡献指南](https://github.com/starship/starship/blob/master/CONTRIBUTING.md)。 另外,你可以自由加入我们的 [Discord 服务器](https://discord.gg/8Jzqu3T) 。 👋 diff --git a/docs/zh-CN/installing/README.md b/docs/zh-CN/installing/README.md index c9d7e07a8..e50ddb9b0 100644 --- a/docs/zh-CN/installing/README.md +++ b/docs/zh-CN/installing/README.md @@ -7,7 +7,7 @@ 大部分用户按照[主页](/guide/#🚀-installation)上的步骤安装即可, 但有一些特殊系统上的安装步骤不同。 -There are so many platforms out there that they didn't fit into the main README.md file, so here are some installation instructions for other platforms from the community. Is yours not here? Please do add it here if you figure it out! +现有平台众多,README 中无法全部展示,所以这里是社区中对其他平台 的一些安装说明。 还没找到您的平台? 如果您找到它 ,请在这里添加它! ## [Chocolatey](https://chocolatey.org) @@ -39,7 +39,7 @@ sh -c "$(curl -fsSL https://starship.rs/install.sh)" -- --bin-dir /data/data/com ### 安装 -On Funtoo Linux, starship can be installed from [core-kit](https://github.com/funtoo/core-kit/tree/1.4-release/app-shells/starship) via Portage: +在 Funtom Linux 上,可以通过 Portact 从 [core-kit](https://github.com/funtoo/core-kit/tree/1.4-release/app-shells/starship) 安装启动: ```sh emerge app-shells/starship @@ -47,9 +47,9 @@ emerge app-shells/starship ## [Nix](https://nixos.wiki/wiki/Nix) -### Getting the Binary +### 获取二进制文件 -#### Imperatively +#### 命令 ```sh nix-env -iA nixos.starship @@ -57,7 +57,7 @@ nix-env -iA nixos.starship #### 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 { @@ -79,7 +79,7 @@ Enable the `programs.starship` module in your `home.nix` file, and add your sett } ``` -then run +然后运行 ```sh home-manager switch @@ -87,7 +87,7 @@ home-manager switch #### Declarative, system-wide, with NixOS -Add `pkgs.starship` to `environment.systemPackages` in your `configuration.nix`, then run +在您的 `configuration.nix`中,将 `pkgs.starship` 添加到 `environment.systemPackages`,然后运行 ```sh sudo nixos-rebuild switch diff --git a/docs/zh-CN/migrating-to-0.45.0/README.md b/docs/zh-CN/migrating-to-0.45.0/README.md index 95a847bf2..06c138d19 100644 --- a/docs/zh-CN/migrating-to-0.45.0/README.md +++ b/docs/zh-CN/migrating-to-0.45.0/README.md @@ -1,10 +1,10 @@ -# Migrating to v0.45.0 +# 迁移到 v0.45.0 -Starship v0.45.0 is a release containing breaking changes, in preparation for the big v1.0.0. We have made some major changes around how configuration is done on the prompt, to allow for a greater degree of customization. +Starship v0.45.0 是一个含有破坏性变化的版本,它将为大版本v1.0.0作准备。 我们围绕如何迅速进行配置作了一些重大改变,以便能够更大程度地定制化。 -This guide is intended to walk you through the breaking changes. +本指南将指明版本的破坏性变化。 -## `prompt_order` has been replaced by a root-level `format` +## `propt_order` 已被root-level `format`代替 Previously to v0.45.0, `prompt_order` would accept an array of module names in the order which they should be rendered by Starship. diff --git a/docs/zh-CN/presets/README.md b/docs/zh-CN/presets/README.md index ac241efaf..2b63d9646 100644 --- a/docs/zh-CN/presets/README.md +++ b/docs/zh-CN/presets/README.md @@ -1,10 +1,10 @@ -# 社区配置分享 +# 预设 -这里有一系列社区提供的 Starship 预设配置。 如果您想分享一套配置,请 [提交 PR](https://github.com/starship/starship/edit/master/docs/presets/README.md) 来更新此文件! 😊 +这里有一系列社区提供的 Starship 预设。 如果您想分享一套配置,请 [提交 PR](https://github.com/starship/starship/edit/master/docs/presets/README.md) 来更新此文件! 😊 -## Nerd Font Symbols +## Nerd 字体符号 -除了每个组件使用的符号外,这套配置不会改变任何内容。 如果你不喜欢 emoji,这可能会吸引你的眼球! +除了每个组件使用的符号外,这套配置不会改变任何内容。 如果你不喜欢 emoji,这可能能满足你! ![Screenshot of Nerd Font Symbols preset](/presets/nerd-font-symbols.png) @@ -224,7 +224,7 @@ format = '\[[$symbol($version)]($style)\]' format = '\[[$symbol($version)]($style)\]' [sudo] -format = '\[[as $symbol]\] +format = '\[[as $symbol]\]' [swift] format = '\[[$symbol($version)]($style)\]' @@ -248,15 +248,15 @@ format = '\[[$symbol($version)]($style)\]' format = '\[[$symbol($version)]($style)\]' ``` -## Plain Text Symbols +## 纯文本符号 -This preset changes the symbols into plain text. If your terminal/font could not render the NerdFonts/emojis, maybe you could try this preset! +此预设会将符号变成纯文本。 如果您的终端/字体无法渲染NerdFont/emojis,也许您可以尝试此预设! -Before (default setting with Fixedsys font): +前 (使用Fixedsys 字体的默认设置): ![Screenshot of default Starship configuration with Fixedsys font](/presets/plain-text-symbols-before.png) -After (Plain Text Symbols): +之后(纯文本符号): ![Screenshot of Plain Text Symbols preset](/presets/plain-text-symbols-after.png) @@ -381,9 +381,9 @@ symbol = "sudo " symbol = "swift " ``` -## Hide Runtime Versions +## 隐藏运行时版本 -This preset hides the version of language runtimes. If you work in containers or virtualized environments, this one is for you! +此预设隐藏语言运行时版本。 如果你在容器或虚拟环境中使用,这个适合你! ![Screenshot of Hide Runtime Versions preset](/presets/hide-runtime-versions.png) @@ -478,9 +478,9 @@ format = 'via [$symbol]($style)' format = 'via [$symbol]($style)' ``` -## Pure +## 纯色 -This preset emulates the look and behavior of [Pure](https://github.com/sindresorhus/pure). +此预设模拟 [Pure](https://github.com/sindresorhus/pure) 的外观和行为。 ![Screenshot of Pure preset](/presets/pure-prompt.png) diff --git a/docs/zh-TW/README.md b/docs/zh-TW/README.md index 84b2d0ce4..8999fba0d 100644 --- a/docs/zh-TW/README.md +++ b/docs/zh-TW/README.md @@ -18,7 +18,7 @@ features: footer: ISC Licensed | Copyright © 2019-present Starship Contributors #Used for the description meta tag, for SEO metaTitle: "Starship:跨 Shell 提示字元" -description: Starship 是適合任何 shell 的最小、極速、高度客製化的提示字元! 顯示你需要的訊息,同時保持順暢與最小化。 針對 Bash、Fish、ZSH、Ion、Tcsh、Elvish、Nu、Xonsh 以及 Powershell 有快速安裝可供使用。 +description: Starship 是適合任何 shell 的最小、極速、高度客製化的提示字元! 顯示你需要的訊息,同時保持順暢與最小化。 Quick installation available for Bash, Fish, ZSH, Ion, Tcsh, Elvish, Nu, Xonsh, Cmd, and PowerShell. ---
@@ -119,7 +119,7 @@ description: Starship 是適合任何 shell 的最小、極速、高度客製化 #### Elvish - ::: warning 只有 elvish v0.15 或以上版本才有支援 ::: + ::: warning Only elvish v0.17 or higher is supported. ::: 將以下內容放到 `~/.elvish/rc.elv` 的結尾: @@ -164,3 +164,14 @@ description: Starship 是適合任何 shell 的最小、極速、高度客製化 execx($(starship init xonsh)) ``` + + + #### Cmd + + You need to use [Clink](https://chrisant996.github.io/clink/clink.html) (v1.2.30+) with Cmd. Add the following to a file `starship.lua` and place this file in Clink scripts directory: + + ```lua + -- starship.lua + + load(io.popen('starship init cmd'):read("*a"))() + ``` diff --git a/docs/zh-TW/advanced-config/README.md b/docs/zh-TW/advanced-config/README.md index c09abf788..c1e93f477 100644 --- a/docs/zh-TW/advanced-config/README.md +++ b/docs/zh-TW/advanced-config/README.md @@ -8,11 +8,35 @@ ::: -## Bash 中的自定義預提示 (pre-prompt) 與預執行 (pre-execution) 指令 +## Custom pre-prompt and pre-execution Commands in Cmd -Bash 不像其他大多的 shell 具有正式的預執行/預指令框架。 因為這個原因,很難在 `bash` 中提供能完全自定義的 hook。 然而,Starship 有提供給你有限的能力來插入你自己的函式到渲染提示字元的程序中: +Clink provides extremely flexible APIs to run pre-prompt and pre-exec commands in Cmd shell. It is fairly simple to use with Starship. Make the following changes to your `starship.lua` file as per your requirements: -- 為了在畫出提示字元之前執行一個自定義的函式,請定義一個函式,並將它的名稱放入 `starship_precmd_user_func` 之中。 例如,為了要在提示字元前畫出一個火箭,你就要 +- To run a custom function right before the prompt is drawn, define a new function called `starship_preprompt_user_func`. This function receives the current prompt as a string that you can utilize. For example, to draw a rocket before the prompt, you would do + +```lua +function starship_preprompt_user_func(prompt) + print("🚀") +end + +load(io.popen('starship init cmd'):read("*a"))() +``` + +- To run a custom function right before a command is executed, define a new function called `starship_precmd_user_func`. This function receives the current commandline as a string that you can utilize. For example, to print the command that's about to be executed, you would do + +```lua +function starship_precmd_user_func(line) + print("Executing: "..line) +end + +load(io.popen('starship init cmd'):read("*a"))() +``` + +## Custom pre-prompt and pre-execution Commands in Bash + +Bash does not have a formal preexec/precmd framework like most other shells. Because of this, it is difficult to provide fully customizable hooks in `bash`. 然而,Starship 有提供給你有限的能力來插入你自己的函式到渲染提示字元的程序中: + +- To run a custom function right before the prompt is drawn, define a new function and then assign its name to `starship_precmd_user_func`. For example, to draw a rocket before the prompt, you would do ```bash function blastoff(){ @@ -21,13 +45,13 @@ function blastoff(){ starship_precmd_user_func="blastoff" ``` -- To run a custom function right before a command runs, you can use the [`DEBUG` trap mechanism](https://jichu4n.com/posts/debug-trap-and-prompt_command-in-bash/). 然而,你**必須**在初始化 Starship *之前* 對 DEBUG 訊號設下trap! Starship 可以保留 DEBUG trap 的數值,但是如果該 trap 在 starship 啟動後被被覆寫,某些功能會損壞。 +- To run a custom function right before a command runs, you can use the [`DEBUG` trap mechanism](https://jichu4n.com/posts/debug-trap-and-prompt_command-in-bash/). However, you **must** trap the DEBUG signal *before* initializing Starship! Starship can preserve the value of the DEBUG trap, but if the trap is overwritten after starship starts up, some functionality will break. ```bash function blastoff(){ echo "🚀" } -trap blastoff DEBUG # 在 Starship 啟用*前*對 DEBUG 訊號設下 trap +trap blastoff DEBUG # Trap DEBUG *before* running starship eval $(starship init bash) ``` @@ -43,33 +67,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 甚至預設就會這樣做。 Starship 沒有幫你這樣做,但是可以用直覺的方式加入這個功能到 `bash` 或 `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`, `zsh`, `cmd` or `powershell`. -首先,定義一個改變視窗標題的函式(在 bash 與 zsh 之中都一樣): +First, define a window title change function (identical in bash and zsh): ```bash function set_win_title(){ - echo -ne "\033]0; 你的標題在此 \007" + echo -ne "\033]0; YOUR_WINDOW_TITLE_HERE \007" } ``` -你可以利用變數來自定義這個標題(`$USER`、`$HOSTNAME` 與 `$PWD` 是很受歡迎的選項)。 +You can use variables to customize this title (`$USER`, `$HOSTNAME`, and `$PWD` are popular choices). -在 `bash` 中,將這個函式設定為 Starship 的預執行函式: +In `bash`, set this function to be the precmd starship function: ```bash starship_precmd_user_func="set_win_title" ``` -在 `zsh` 中,將這個函式加入 `precmd_functions` 陣列: +In `zsh`, add this to the `precmd_functions` array: ```bash precmd_functions+=(set_win_title) ``` -如果你喜歡這個結果,把這幾行加入你的 shell 設定檔中(`~/.bashrc` or `~/.zsrhc`)來將此設為永久設定。 +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`: @@ -80,6 +104,16 @@ function set_win_title(){ starship_precmd_user_func="set_win_title" ``` +For Cmd, you can change the window title using the `starship_preprompt_user_func` function. + +```lua +function starship_preprompt_user_func(prompt) + console.settitle(os.getenv('USERNAME').."@"..os.getenv('COMPUTERNAME')..": "..os.getcwd()) +end + +load(io.popen('starship init cmd'):read("*a"))() +``` + You can also set a similar output with PowerShell by creating a function named `Invoke-Starship-PreCommand`. ```powershell @@ -97,7 +131,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). -`right_format` is currently supported for the following shells: elvish, fish, zsh. +`right_format` is currently supported for the following shells: elvish, fish, zsh, xonsh, cmd. ### 範例 @@ -117,13 +151,35 @@ Produces a prompt like the following: ▶ starship on  rprompt [!] is 📦 v0.57.0 via 🦀 v1.54.0 took 17s ``` +## Continuation Prompt + +Some shells support a continuation prompt along with the normal prompt. This prompt is rendered instead of the normal prompt when the user has entered an incomplete statement (such as a single left parenthesis or quote). + +Starship can set the continuation prompt using the `continuation_prompt` option. The default prompt is `"[∙](bright-black) "`. + +Note: `continuation_prompt` should be set to a literal string without any variables. + +Note: Continuation prompts are only available in the following shells: + + - `bash` + - `zsh` + - `PowerShell` + +### 範例 + +```toml +# ~/.config/starship.toml + +# A continuation prompt that displays two filled in arrows +continuation_prompt = "▶▶" +``` ## 風格字串 -風格字串是一個以空白分開的單詞清單。 單字並不會區分大小寫(換句話說,`bold` 與 `BoLd` 是被當作兩個相同的字串)。 每個單詞可以是下列其中之一: +Style strings are a list of words, separated by whitespace. The words are not case sensitive (i.e. `bold` and `BoLd` are considered the same string). Each word can be one of the following: - `bold` - - `斜體字` + - `italic` - `underline` - `dimmed` - `inverted` @@ -132,14 +188,14 @@ Produces a prompt like the following: - `` - `none` -其中 `` 是指定顏色用的(下面解釋)。 `fg:` and `` currently do the same thing, though this may change in the future. `inverted` swaps the background and foreground colors. 單詞在字串中的順序不重要。 +where `` is a color specifier (discussed below). `fg:` and `` 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. -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` 與其他符號一起使用的情形視為是一種錯誤。 +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. -一個顏色指定符號可以是下列其中之一: +A color specifier can be one of the following: - - 任一個標準終端機顏色:`black`、`red`、`green`、`blue`、`yellow`、`purple`、`cyan`、`white`。 你可以選擇性地加上前綴 `bright-` 來取得明亮版本的顏色(例如:`bright-white`)。 - - 一個 `#` 後面跟隨著六位數的十六進位數字。 這個指定了 [RGB 十六進制色碼](https://www.w3schools.com/colors/colors_hexadecimal.asp)。 - - 一個介於 0~255 之間的數字。 這個指定了 [8-bit ANSI 色碼](https://i.stack.imgur.com/KTSQa.png)。 + - One of the standard terminal colors: `black`, `red`, `green`, `blue`, `yellow`, `purple`, `cyan`, `white`. You can optionally prefix these with `bright-` to get the bright version (e.g. `bright-white`). + - A `#` followed by a six-digit hexadecimal number. This specifies an [RGB color hex code](https://www.w3schools.com/colors/colors_hexadecimal.asp). + - A number between 0-255. This specifies an [8-bit ANSI Color Code](https://i.stack.imgur.com/KTSQa.png). -如果前景/後景被指定了多種顏色,最後一個顏色具有最高優先性。 +If multiple colors are specified for foreground/background, the last one in the string will take priority. diff --git a/docs/zh-TW/config/README.md b/docs/zh-TW/config/README.md index 74da40cbe..c71552055 100644 --- a/docs/zh-TW/config/README.md +++ b/docs/zh-TW/config/README.md @@ -24,13 +24,19 @@ disabled = true 你可以透過更改環境變數 `STARSHIP_CONFIG` 來變更設定檔存放的位置: ```sh -export STARSHIP_CONFIG=~/.starship/config.toml +export STARSHIP_CONFIG=~/example/non/default/path/starship.toml ``` 等同於在 PowersShell(Windows)的 `$PROFILE` 中添加下列文字: ```powershell -$ENV:STARSHIP_CONFIG = "$HOME\.starship\config.toml" +$ENV:STARSHIP_CONFIG = "$HOME\example\non\default\path\starship.toml" +``` + +Or for Cmd (Windows) would be adding this line to your `starship.lua`: + +```lua +os.setenv('STARSHIP_CONFIG', 'C:\\Users\\user\\example\\non\\default\\path\\starship.toml') ``` ### Logging @@ -47,11 +53,17 @@ export STARSHIP_CACHE=~/.starship/cache $ENV:STARSHIP_CACHE = "$HOME\AppData\Local\Temp" ``` +Or for Cmd (Windows) would be adding this line to your `starship.lua`: + +```lua +os.setenv('STARSHIP_CACHE', 'C:\\Users\\user\\AppData\\Local\\Temp') +``` + ### 術語 -**模組 (Module)**: 提示字元中的一個元件,基於你的作業系統提供的背景資訊來提供訊息。 舉例來說,如果你現在的資料夾是一個 Node.js 專案,"nodejs" 模組會顯示出現在安裝在你的電腦上的 Node.js 版本。 +**Module**: A component in the prompt giving information based on contextual information from your OS. For example, the "nodejs" module shows the version of Node.js that is currently installed on your computer, if your current directory is a Node.js project. -變數 (**Variable**):模組的子元件,主要是由模組提供的訊息。 舉例來說,在 "nodejs" 模組中提供的 "version" 變數代表著當下使用的 Node.js 版本。 +**Variable**: Smaller sub-components that contain information provided by the module. For example, the "version" variable in the "nodejs" module contains the current version of Node.js. By convention, most modules have a prefix of default terminal color (e.g. `via` in "nodejs") and an empty space as a suffix. @@ -85,7 +97,7 @@ For example: #### 風格字串 -Starship 內大多數的模組允許你設定他們的顯示風格。 這要透過一個條目 (通常叫做 `style`),這個條目使用一個字串來進行設定。 這裡給幾個風格字串的例子,以及這些字串的功用。 對於完整語法的詳細說明,請參照 [進階設定指南](/advanced-config/)。 +Most modules in starship allow you to configure their display styles. This is done with an entry (usually called `style`) which is a string specifying the configuration. Here are some examples of style strings along with what they do. For details on the full syntax, consult the [advanced config guide](/advanced-config/). - `"fg:green bg:blue"` 在一個藍色背景上設定綠色文字 - `"bg:blue fg:bright-green"` 在一個藍色背景上設定亮綠色文字 @@ -94,7 +106,7 @@ Starship 內大多數的模組允許你設定他們的顯示風格。 這要透 - `"bold italic fg:purple"` 設定粗體、斜體且紫色的文字 - `""` 明確地關閉所有風格 -注意風格產出的樣子取決於你的終端機模擬器。 例如,有些終端機模擬器會提升顏色的亮度而不是讓文字變粗體,而且有些色彩主題對一般與加亮顏色使用的是相同色碼。 除此之外,為了要有斜體字,你的終端機一定要支援斜體。 +Note that what styling looks like will be controlled by your terminal emulator. For example, some terminal emulators will brighten the colors instead of bolding text, and some color themes use the same values for the normal and bright colors. Also, to get italic text, your terminal must support italics. #### Conditional Format Strings @@ -131,7 +143,7 @@ format = ''' ## 提示字元 -以下是針對提示字元內容的設定。 +This is the list of prompt-wide configuration options. ### 選項 @@ -164,7 +176,7 @@ add_newline = false ### Default Prompt Format -The default `format` is used to define the format of the prompt, if empty or no `format` is provided. 預設如下: +The default `format` is used to define the format of the prompt, if empty or no `format` is provided. The default is as shown: ```toml format = "$all" @@ -248,7 +260,7 @@ format="$all$directory$character" ## AWS -`aws` 模組顯示現在 AWS 的區域與概況。 這是根據 `AWS_REGION`、`AWS_DEFAULT_REGION` 與 `AWS_PROFILE` 環境變數及 `~/.aws/config` 檔案。 This module also shows an expiration timer when using temporary credentials. +The `aws` module shows the current AWS region and profile. This is based on `AWS_REGION`, `AWS_DEFAULT_REGION`, and `AWS_PROFILE` env var with `~/.aws/config` file. This module also shows an expiration timer when using temporary credentials. When using [aws-vault](https://github.com/99designs/aws-vault) the profile is read from the `AWS_VAULT` env var and the credentials expiration date is read from the `AWS_SESSION_EXPIRATION` env var. @@ -347,7 +359,7 @@ style = "blue bold" ## 電池 -`battery` 模組顯示電池的電量以及現在的充電狀態。 這個模組只會在裝置的電量低於 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%. ### 選項 @@ -375,7 +387,7 @@ discharging_symbol = "💀 " ### 電池顯示 -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. The default is as shown: ```toml [[battery.display]] @@ -387,7 +399,7 @@ 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 | 預設 | 說明 | | -------------------- | ---------- | --------------------------------------------------------------------------------------------------------- | @@ -414,9 +426,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 shape (`❯`/`✖`) @@ -425,13 +437,13 @@ By default it only changes color. If you also want to change its shape take a lo ::: warning -`error_symbol` is not supported on elvish and nu shell. +`error_symbol` is not supported on nu shell. ::: ::: warning -`vicmd_symbol` is only supported in fish and zsh. +`vicmd_symbol` is only supported in cmd, fish and zsh. ::: @@ -544,15 +556,15 @@ 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. ### 選項 @@ -568,7 +580,7 @@ The `cobol` module shows the currently installed version of COBOL. By default, t ::: tip -Showing desktop notifications requires starship to be built with `rust-notify` support. You check if your starship supports notifications by running `STARSHIP_LOG=debug starship module cmd_duration -d 60000` when `show_notifications` is set to `true`. +Showing desktop notifications requires starship to be built with `notify-rust` support. You check if your starship supports notifications by running `STARSHIP_LOG=debug starship module cmd_duration -d 60000` when `show_notifications` is set to `true`. ::: @@ -713,20 +725,20 @@ format = "via [🔰 $version](bold red) " ## Deno The `deno` module shows you your currently installed version of [Deno](https://deno.land/). By default the module will be shown if any of the following conditions are met: -- The current directory contains a `mod.ts`, `mod.js`, `deps.ts` or `deps.js` file +- The current directory contains a `deno.json`, `deno.jsonc`, `mod.ts`, `mod.js`, `deps.ts` or `deps.js` file ### 選項 -| Option | 預設 | 說明 | -| ------------------- | -------------------------------------------- | ------------------------------------------------------------------------- | -| `format` | `"via [$symbol($version )]($style)"` | The format for the module. | -| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | -| `symbol` | `"🦕 "` | A format string representing the symbol of Deno | -| `detect_extensions` | `[]` | Which extensions should trigger this module. | -| `detect_files` | `["mod.ts", "mod.js", "deps.ts", "deps.js"]` | Which filenames should trigger this module. | -| `detect_folders` | `[]` | Which folders should trigger this module. | -| `style` | `"green bold"` | 這個模組的風格。 | -| `disabled` | `false` | Disables the `deno` module. | +| Option | 預設 | 說明 | +| ------------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `format` | `"via [$symbol($version )]($style)"` | The format for the module. | +| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | +| `symbol` | `"🦕 "` | A format string representing the symbol of Deno | +| `detect_extensions` | `[]` | Which extensions should trigger this module. | +| `detect_files` | `["deno.json", "deno.jsonc", "mod.ts", "mod.js", "deps.ts", "deps.js"]` | Which filenames should trigger this module. | +| `detect_folders` | `[]` | Which folders should trigger this module. | +| `style` | `"green bold"` | 這個模組的風格。 | +| `disabled` | `false` | Disables the `deno` module. | ### Variables @@ -747,29 +759,30 @@ 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 | 預設 | 說明 | -| ------------------- | -------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `truncation_length` | `3` | 到達現在資料夾的路徑中,要被裁減掉的資料夾數目。 | -| `truncate_to_repo` | `true` | 是否要裁減到你現在所在的 git 儲存庫的根目錄。 | -| `format` | `"[$path]($style)[$read_only]($read_only_style) "` | The format for the module. | -| `style` | `"bold cyan"` | 這個模組的風格。 | -| `disabled` | `false` | 停用 `directory` 模組。 | -| `read_only` | `"🔒"` | The symbol indicating current directory is read only. | -| `read_only_style` | `"red"` | The style for the read only symbol. | -| `truncation_symbol` | `""` | The symbol to prefix to truncated paths. eg: "…/" | -| `repo_root_style` | `None` | The style for the root of the git repo when `truncate_to_repo` option is set to false. | -| `home_symbol` | `"~"` | The symbol indicating home directory. | +| Option | 預設 | 說明 | +| ------------------- | -------------------------------------------------- | --------------------------------------------------------------------------------------- | +| `truncation_length` | `3` | 到達現在資料夾的路徑中,要被裁減掉的資料夾數目。 | +| `truncate_to_repo` | `true` | 是否要裁減到你現在所在的 git 儲存庫的根目錄。 | +| `format` | `"[$path]($style)[$read_only]($read_only_style) "` | The format for the module. | +| `style` | `"bold cyan"` | 這個模組的風格。 | +| `disabled` | `false` | 停用 `directory` 模組。 | +| `read_only` | `"🔒"` | The symbol indicating current directory is read only. | +| `read_only_style` | `"red"` | The style for the read only symbol. | +| `truncation_symbol` | `""` | The symbol to prefix to truncated paths. eg: "…/" | +| `repo_root_style` | `None` | The style for the root of the git repo when `truncate_to_repo` option is set to false. | +| `home_symbol` | `"~"` | The symbol indicating home directory. | +| `use_os_path_sep` | `true` | Use the OS specific path seperator instead of always using `/` (e.g. `\` on Windows) |
-這個模組有些進階設定選項可以控制顯示資料夾。 +This module has a few advanced configuration options that control how the directory is displayed. | Advanced Option | 預設 | 說明 | | --------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -846,7 +859,7 @@ format = "via [🐋 $context](blue bold)" ## 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: @@ -861,7 +874,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. -這個模組內部是使用它自己的機制來偵測版本。 一般來說這個模組有 `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 () when there is a csproj file in the current directory. @@ -984,7 +997,7 @@ 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` 設定選項符合一個存在的環境變數。 - 沒有設定 `variable` 選項,但是有設定 `default` 選項。 @@ -1174,7 +1187,7 @@ asia-northeast1 = "an1" ## Git 分支 -`git_branch` 模組顯示現在的資料夾中使用中的儲存庫的分支。 +The `git_branch` module shows the active branch of the repo in your current directory. ### 選項 @@ -1249,7 +1262,7 @@ tag_symbol = "🔖 " ## 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. ### 選項 @@ -1293,7 +1306,7 @@ The `git_metrics` module will show the number of added and deleted lines in the ::: tip -這個模組預設是停用的。 想要啟用它的話,請在設定檔中將 `disabled` 設定為 `false`。 +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: @@ -1330,26 +1343,27 @@ format = '[+$added]($added_style)/[-$deleted]($deleted_style) ' ## Git Status -`git_status` 模組顯示用來表示現在資料夾之中儲存庫狀態的符號。 +The `git_status` module shows symbols representing the state of the repo in your current directory. ### 選項 -| Option | 預設 | 說明 | -| ------------ | ----------------------------------------------- | ----------------------------------- | -| `format` | `'([\[$all_status$ahead_behind\]]($style) )'` | The default format for `git_status` | -| `conflicted` | `"="` | 這個分支有合併衝突。 | -| `ahead` | `"⇡"` | The format of `ahead` | -| `behind` | `"⇣"` | The format of `behind` | -| `diverged` | `"⇕"` | The format of `diverged` | -| `up_to_date` | `""` | The format of `up_to_date` | -| `untracked` | `"?"` | The format of `untracked` | -| `stashed` | `"$"` | The format of `stashed` | -| `modified` | `"!"` | The format of `modified` | -| `staged` | `"+"` | The format of `staged` | -| `renamed` | `"»"` | The format of `renamed` | -| `deleted` | `"✘"` | The format of `deleted` | -| `style` | `"bold red"` | 這個模組的風格。 | -| `disabled` | `false` | 停用 `git_status` 模組。 | +| Option | 預設 | 說明 | +| ------------------- | ----------------------------------------------- | ----------------------------------- | +| `format` | `'([\[$all_status$ahead_behind\]]($style) )'` | The default format for `git_status` | +| `conflicted` | `"="` | 這個分支有合併衝突。 | +| `ahead` | `"⇡"` | The format of `ahead` | +| `behind` | `"⇣"` | The format of `behind` | +| `diverged` | `"⇕"` | The format of `diverged` | +| `up_to_date` | `""` | The format of `up_to_date` | +| `untracked` | `"?"` | The format of `untracked` | +| `stashed` | `"$"` | The format of `stashed` | +| `modified` | `"!"` | The format of `modified` | +| `staged` | `"+"` | The format of `staged` | +| `renamed` | `"»"` | The format of `renamed` | +| `deleted` | `"✘"` | The format of `deleted` | +| `style` | `"bold red"` | 這個模組的風格。 | +| `ignore_submodules` | `false` | Ignore changes to submodules. | +| `disabled` | `false` | Disables the `git_status` module. | ### Variables @@ -1499,7 +1513,7 @@ format = "via [⎈ $version](bold white) " ## 主機名稱 -`hostname` 模組顯示系統的主機名稱。 +The `hostname` module shows the system hostname. ### 選項 @@ -1513,10 +1527,10 @@ format = "via [⎈ $version](bold white) " ### Variables -| 變數 | 範例 | 說明 | -| --------- | -- | ------------------------------------ | -| symbol | | Mirrors the value of option `symbol` | -| style\* | | Mirrors the value of option `style` | +| 變數 | 範例 | 說明 | +| --------- | ---------- | ----------------------------------- | +| hostname | `computer` | The hostname of the computer | +| style\* | | Mirrors the value of option `style` | \*: This variable can only be used as a part of a style string @@ -1573,7 +1587,7 @@ symbol = "🌟 " ## 工作 -`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: @@ -1722,7 +1736,7 @@ Displays the current [Kubernetes context](https://kubernetes.io/docs/concepts/co ::: tip -這個模組預設是停用的。 想要啟用它的話,請在設定檔中將 `disabled` 設定為 `false`。 +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: @@ -1784,7 +1798,7 @@ Long and automatically generated cluster names can be identified and shortened u ## 換行 -`line_break` 模組將提示字元分成兩行。 +The `line_break` module separates the prompt into two lines. ### 選項 @@ -1844,13 +1858,13 @@ format = "via [🌕 $version](bold blue) " ## 記憶體使用量 -`memory_usage` 模組顯示現在系統記憶體與 swap 的使用量。 +The `memory_usage` module shows current system memory and swap usage. -預設 swap 使用量會在系統總 swap 使用量不為 0 時顯示出來。 +By default the swap usage is displayed if the total system swap is non-zero. ::: tip -這個模組預設是停用的。 想要啟用它的話,請在設定檔中將 `disabled` 設定為 `false`。 +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: @@ -1969,7 +1983,7 @@ symbol = "🎣 " ## 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. ### 選項 @@ -2133,7 +2147,7 @@ symbol = "☁️ " ## 套件版本 -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`, `shards` and `dart` packages. - [**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 @@ -2150,6 +2164,7 @@ The `package` 模組在現在資料夾是一個套件的儲藏庫時出現,並 - [**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 - [**SBT**](https://scala-sbt.org) - The `sbt` package version is extracted from the `build.sbt` present in the current directory +- [**Dart**](https://pub.dev/) - The `dart` package version is extracted from the `pubspec.yaml` present in the current directory > ⚠️ 顯示出來的版本是從你的現在資料夾之中擷取出來的,並非從套件管理員取得。 @@ -2657,7 +2672,7 @@ The `shell` module shows an indicator for currently used shell. ::: tip -這個模組預設是停用的。 想要啟用它的話,請在設定檔中將 `disabled` 設定為 `false`。 +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: @@ -2673,6 +2688,8 @@ The `shell` module shows an indicator for currently used shell. | `elvish_indicator` | `esh` | A format string used to represent elvish. | | `tcsh_indicator` | `tsh` | A format string used to represent tcsh. | | `xonsh_indicator` | `xsh` | A format string used to represent xonsh. | +| `cmd_indicator` | `cmd` | A format string used to represent cmd. | +| `nu_indicator` | `nu` | A format string used to represent nu. | | `unknown_indicator` | | The default value to be displayed when the shell is unknown. | | `format` | `"[$indicator]($style) "` | The format for the module. | | `style` | `"white bold"` | 這個模組的風格。 | @@ -2774,11 +2791,11 @@ The `status` module displays the exit code of the previous command. The module w ::: tip -這個模組預設是停用的。 想要啟用它的話,請在設定檔中將 `disabled` 設定為 `false`。 +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: -::: warning This module is not supported on elvish and nu shell. ::: +::: warning This module is not supported on nu shell. ::: ### 選項 @@ -2804,6 +2821,7 @@ The `status` module displays the exit code of the previous command. The module w | 變數 | 範例 | 說明 | | -------------- | ------- | ------------------------------------------------------------------------------------------- | | status | `127` | The exit code of the last command | +| hex_status | `0x7F` | The exit code of the last command in hex | | int | `127` | The exit code of the last command | | common_meaning | `ERROR` | Meaning of the code if not a signal | | signal_number | `9` | Signal number corresponding to the exit code, only if signalled | @@ -2836,7 +2854,7 @@ The `sudo` module displays if sudo credentials are currently cached. The module ::: tip -這個模組預設是停用的。 想要啟用它的話,請在設定檔中將 `disabled` 設定為 `false`。 +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: @@ -2980,11 +2998,11 @@ format = "[🏎💨 $workspace]($style) " ## 時間 -`time` 模組顯示目前的**當地**時間. `format` 設定值被 [`chrono`](https://crates.io/crates/chrono) crate 用來控制時間如何顯示。 請看 [chrono 的 strftime 文件](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html)來了解有那些選項可以使用。 +The `time` module shows the current **local** time. The `format` configuration value is used by the [`chrono`](https://crates.io/crates/chrono) crate to control how the time is displayed. Take a look [at the chrono strftime docs](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) to see what options are available. ::: tip -這個模組預設是停用的。 想要啟用它的話,請在設定檔中將 `disabled` 設定為 `false`。 +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: @@ -3000,7 +3018,7 @@ format = "[🏎💨 $workspace]($style) " | `disabled` | `true` | 停用 `time` 模組。 | | `time_range` | `"-"` | Sets the time range during which the module will be shown. Times must be specified in 24-hours format | -If `use_12hr` is `true`, then `time_format` defaults to `"%r"`. 不然的話,它會被預設為 `"%T"`。 Manually setting `time_format` will override the `use_12hr` setting. +If `use_12hr` is `true`, then `time_format` defaults to `"%r"`. Otherwise, it defaults to `"%T"`. Manually setting `time_format` will override the `use_12hr` setting. ### Variables @@ -3026,7 +3044,7 @@ time_range = "10:00:00-14:00:00" ## 使用者名稱 -`username` 模組顯示現在使用中的使用者名稱。 這個模組在下列其中一個條件達成時顯示: +The `username` module shows active user's username. 這個模組在下列其中一個條件達成時顯示: - 目前使用者為 root - 目前使用者並非登入時的使用者 diff --git a/docs/zh-TW/faq/README.md b/docs/zh-TW/faq/README.md index 919dc15db..c423d39b4 100644 --- a/docs/zh-TW/faq/README.md +++ b/docs/zh-TW/faq/README.md @@ -69,13 +69,13 @@ Starship executes different commands to get information to display in the prompt You can enable the debug logs by using the `STARSHIP_LOG` env var. These logs can be very verbose so it is often useful to use the `module` command if you are trying to debug a particular module, for example, if you are trying to debug the `rust` module you could run the following command to get the trace logs and output from the module. ```sh -env STARHIP_LOG=trace starship module rust +env STARSHIP_LOG=trace starship module rust ``` If starship is being slow you can try using the `timings` command to see if there is a particular module or command that to blame. ```sh -env STARHIP_LOG=trace starship timings +env STARSHIP_LOG=trace starship timings ``` This will output the trace log and a breakdown of all modules that either took more than 1ms to execute or produced some output. @@ -117,6 +117,6 @@ echo -e "\xee\x82\xa0" 如果你是透過安裝腳本來安裝 Starship 的,可以執行以下的命令來移除執行檔。 ```sh -# 定位並且刪除 starship 執行檔 -sh -c 'rm "$(which starship)"' +# Locate and delete the starship binary +sh -c 'rm "$(command -v 'starship')"' ``` diff --git a/docs/zh-TW/guide/README.md b/docs/zh-TW/guide/README.md index 3252b579e..9ebea1047 100644 --- a/docs/zh-TW/guide/README.md +++ b/docs/zh-TW/guide/README.md @@ -72,6 +72,22 @@ height="20" src="https://raw.githubusercontent.com/starship/starship/master/media/flag-fr.png" alt="Français" + /> +   + Bahasa Indonesia +   + Italiano