Files
starship/docs/de-DE/migrating-to-0.45.0/README.md
T

268 lines
6.5 KiB
Markdown
Raw Normal View History

2021-04-05 10:55:57 -04:00
# Migration auf v0.45.0
2020-09-30 16:26:13 -04:00
2026-04-18 20:11:45 +09:00
Starship v0.45.0 ist ein Release mit bahnbrechenden Änderungen in Vorbereitung auf das große v1.0.0. Wir haben einige wichtige Änderungen vorgenommen, wie die Konfiguration auf der Eingabeaufforderung durchgeführt wird, um einen höheren Grad an Individualisierung zu ermöglichen.
2020-09-30 16:26:13 -04:00
This guide is intended to walk you through the breaking changes.
## `prompt_order` has been replaced by a 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.
2020-10-13 15:09:01 -04:00
Starship v0.45.0 instead accepts a `format` value, allowing for customization of the prompt outside of the modules themselves.
2020-09-30 16:26:13 -04:00
2026-04-18 20:11:45 +09:00
**Beispiel für Pre-v0.45.0 Konfiguration**
2020-09-30 16:26:13 -04:00
```toml
prompt_order = [
"username",
"hostname",
"directory",
"git_branch",
"git_commit",
"git_state",
"git_status",
"cmd_duration",
"custom",
"line_break",
"jobs",
"battery",
"time",
"character",
]
```
2026-04-18 20:11:45 +09:00
**Beispiel für v0.45.0 Konfiguration**
2020-09-30 16:26:13 -04:00
```toml
format = """\
$username\
$hostname\
$directory\
$git_branch\
$git_commit\
$git_state\
$git_status\
$cmd_duration\
$custom\
$line_break\
$jobs\
$battery\
$time\
$character\
"""
```
2020-10-13 15:09:01 -04:00
## Module `prefix` and `suffix` have been replaced by `format`
2020-09-30 16:26:13 -04:00
Previously to v0.45.0, some modules would accept `prefix` and/or `suffix` in order to stylize the way that modules are rendered.
2020-10-13 15:09:01 -04:00
Starship v0.45.0 instead accepts a `format` value, allowing for further customization of how modules are rendered. Instead of defining a prefix and suffix for the context-based variables, the variables can now be substituted from within a format string, which represents the module's output.
2020-09-30 16:26:13 -04:00
2026-04-18 20:11:45 +09:00
**Beispiel für Pre-v0.45.0 Konfiguration**
2020-09-30 16:26:13 -04:00
```toml
[cmd_duration]
prefix = "took "
```
2026-04-18 20:11:45 +09:00
**Beispiel für v0.45.0 Konfiguration**
2020-09-30 16:26:13 -04:00
```toml
[cmd_duration]
# $duration The command duration (e.g. "15s")
# $style The default style of the module (e.g. "bold yellow")
2020-10-13 15:09:01 -04:00
format = "took [$duration]($style) "
2020-09-30 16:26:13 -04:00
```
2026-04-18 20:11:45 +09:00
### Betroffene Module
2020-09-30 16:26:13 -04:00
#### Zeichen
2026-04-18 20:11:45 +09:00
| Entfernte Eigenschaft | Ersetzung |
2020-09-30 16:26:13 -04:00
| ----------------------- | ---------------- |
2026-04-18 20:11:45 +09:00
| `Symbol` | `success_symbol` |
2020-09-30 16:26:13 -04:00
| `use_symbol_for_status` | `error_symbol` |
| `style_success` | `success_symbol` |
| `style_failure` | `error_symbol` |
2023-04-11 13:05:27 +09:00
**Änderungen an der Standardkonfiguration**
2020-09-30 16:26:13 -04:00
```diff
[character]
-- symbol = ""
-- error_symbol = "✖"
-- use_symbol_for_status = true
-- vicmd_symbol = ""
2020-10-13 15:09:01 -04:00
++ success_symbol = "[](bold green)"
++ error_symbol = "[](bold red)"
2020-09-30 16:26:13 -04:00
++ vicmd_symbol = "[](bold green)"
```
Previously, the `use_symbol_for_status` property was used to configure the prompt to show the `error_symbol` when the last command resulted in a non-zero status code.
With the release of v0.45.0, we now always use `error_symbol` after non-zero status codes, unifying `use_symbol_for_status` and `error_symbol` properties.
To configure the prompt to use the older `use_symbol_for_status = true` configuration, add the following to your config file:
```toml
[character]
2020-10-13 15:09:01 -04:00
error_symbol = "[✖](bold red)"
2020-09-30 16:26:13 -04:00
```
2022-02-07 15:53:55 +01:00
_Note:_ The `character` element automatically adds a space after, so unlike the other `format` strings, we specifically do not add one in the above examples.
2020-10-13 15:09:01 -04:00
2020-09-30 16:26:13 -04:00
#### Befehlsdauer
2026-04-18 20:11:45 +09:00
| Entfernte Eigenschaft | Ersetzung |
| --------------------- | --------- |
| `prefix` | `format` |
2020-09-30 16:26:13 -04:00
2023-04-11 13:05:27 +09:00
**Änderungen an der Standardkonfiguration**
2020-09-30 16:26:13 -04:00
```diff
[cmd_duration]
-- prefix = "took "
2020-10-13 15:09:01 -04:00
++ format = "took [$duration]($style) "
2020-09-30 16:26:13 -04:00
```
2020-09-30 21:23:36 -04:00
#### Verzeichnis
2020-09-30 16:26:13 -04:00
2026-04-18 20:11:45 +09:00
| Entfernte Eigenschaft | Ersetzung |
| --------------------- | --------- |
| `prefix` | `format` |
2020-09-30 16:26:13 -04:00
2023-04-11 13:05:27 +09:00
**Änderungen an der Standardkonfiguration**
2020-09-30 16:26:13 -04:00
```diff
[directory]
-- prefix = "in "
2020-10-13 15:09:01 -04:00
++ format = "[$path]($style)[$read_only]($read_only_style) "
2020-09-30 16:26:13 -04:00
```
2020-09-30 21:23:36 -04:00
#### Umgebungsvariablen
2020-09-30 16:26:13 -04:00
2026-04-18 20:11:45 +09:00
| Entfernte Eigenschaft | Ersetzung |
| --------------------- | --------- |
| `prefix` | `format` |
| `suffix` | `format` |
2020-09-30 16:26:13 -04:00
2023-04-11 13:05:27 +09:00
**Änderungen an der Standardkonfiguration**
2020-09-30 16:26:13 -04:00
```diff
[env_var]
-- prefix = ""
-- suffix = ""
++ format = "with [$env_value]($style) "
```
2026-04-18 20:11:45 +09:00
#### Git-Commit
2020-09-30 16:26:13 -04:00
2026-04-18 20:11:45 +09:00
| Entfernte Eigenschaft | Ersetzung |
| --------------------- | --------- |
| `prefix` | `format` |
| `suffix` | `format` |
2020-09-30 16:26:13 -04:00
2023-04-11 13:05:27 +09:00
**Änderungen an der Standardkonfiguration**
2020-09-30 16:26:13 -04:00
```diff
[git_commit]
-- prefix = "("
-- suffix = ")"
2020-10-13 15:09:01 -04:00
++ format = '[\($hash\)]($style) '
2020-09-30 16:26:13 -04:00
```
2020-09-30 21:23:36 -04:00
#### Git-Status
2020-09-30 16:26:13 -04:00
2026-04-18 20:11:45 +09:00
| Entfernte Eigenschaft | Ersetzung |
| --------------------- | --------- |
| `prefix` | `format` |
| `suffix` | `format` |
| `show_sync_count` | `format` |
2020-09-30 16:26:13 -04:00
2023-04-11 13:05:27 +09:00
**Änderungen an der Standardkonfiguration**
2020-09-30 16:26:13 -04:00
```diff
[git_status]
-- prefix = "["
-- suffix = "]"
-- show_sync_count = false
2020-10-13 15:09:01 -04:00
++ format = '([\[$all_status$ahead_behind\]]($style) )'
2020-09-30 16:26:13 -04:00
```
Previously, the `show_sync_count` property was used to configure the prompt to show the number of commits the branch was ahead or behind the remote branch.
2020-10-13 15:09:01 -04:00
With the release of v0.45.0, this has been replaced with three separate properties, `ahead`, `behind`, and `diverged`.
2020-09-30 16:26:13 -04:00
To configure the prompt to use the older `show_sync_count = true` configuration, set the following to your config file:
```toml
[git_status]
ahead = "⇡${count}"
diverged = "⇕⇡${ahead_count}⇣${behind_count}"
behind = "⇣${count}"
```
#### Hostname
2026-04-18 20:11:45 +09:00
| Entfernte Eigenschaft | Ersetzung |
| --------------------- | --------- |
| `prefix` | `format` |
| `suffix` | `format` |
2020-09-30 16:26:13 -04:00
2023-04-11 13:05:27 +09:00
**Änderungen an der Standardkonfiguration**
2020-09-30 16:26:13 -04:00
```diff
[hostname]
-- prefix = ""
-- suffix = ""
++ format = "[$hostname]($style) in "
```
2026-04-18 20:11:45 +09:00
#### Singularität
2020-09-30 16:26:13 -04:00
2026-04-18 20:11:45 +09:00
| Entfernte Eigenschaft | Ersetzung |
| --------------------- | --------- |
| `Label` | `format` |
| `prefix` | `format` |
| `suffix` | `format` |
2020-09-30 16:26:13 -04:00
2023-04-11 13:05:27 +09:00
**Änderungen an der Standardkonfiguration**
2020-09-30 16:26:13 -04:00
```diff
[singularity]
-- prefix = ""
-- suffix = ""
2020-10-13 15:09:01 -04:00
++ format = '[$symbol\[$env\]]($style) '
2020-09-30 16:26:13 -04:00
```
2022-03-24 15:47:11 -05:00
#### Uhrzeit
2020-09-30 16:26:13 -04:00
2026-04-18 20:11:45 +09:00
| Entfernte Eigenschaft | Ersetzung |
| --------------------- | ------------- |
| `format` | `time_format` |
2020-09-30 16:26:13 -04:00
2023-04-11 13:05:27 +09:00
**Änderungen an der Standardkonfiguration**
2020-09-30 16:26:13 -04:00
```diff
[time]
-- format = "🕙[ %T ]"
++ time_format = "%T"
2020-10-13 15:09:01 -04:00
++ format = "at 🕙[$time]($style) "
2020-09-30 16:26:13 -04:00
```
2026-04-18 20:11:45 +09:00
#### Benutzerdefinierte Befehle
2020-09-30 16:26:13 -04:00
2026-04-18 20:11:45 +09:00
| Entfernte Eigenschaft | Ersetzung |
| --------------------- | --------- |
| `prefix` | `format` |
| `suffix` | `format` |
2020-09-30 16:26:13 -04:00
2023-04-11 13:05:27 +09:00
**Änderungen an der Standardkonfiguration**
2020-09-30 16:26:13 -04:00
```diff
[custom.example]
-- prefix = ""
-- suffix = ""
++ format = "[$symbol$output]($style) "
```