mirror of
https://github.com/starship/starship.git
synced 2026-06-22 02:02:12 +07:00
docs(i18n): new Crowdin updates (#4124)
This commit is contained in:
@@ -8,6 +8,52 @@ Las configuraciones de esta sección están sujetos a cambios en futuras version
|
||||
|
||||
:::
|
||||
|
||||
## TransientPrompt in PowerShell
|
||||
|
||||
It is possible to replace the previous-printed prompt with a custom string. This is useful in cases where all the prompt information is not always needed. To enable this, run `Enable-TransientPrompt` in the shell session. To make it permanent, put this statement in your `$PROFILE`. Transience can be disabled on-the-fly with `Disable-TransientPrompt`.
|
||||
|
||||
By default, the left side of input gets replaced with `>`. To customize this, define a new function called `Invoke-Starship-TransientFunction`. For example, to display Starship's `character` module here, you would do
|
||||
|
||||
```powershell
|
||||
function Invoke-Starship-TransientFunction {
|
||||
&starship module character
|
||||
}
|
||||
|
||||
Invoke-Expression (&starship init powershell)
|
||||
|
||||
Enable-TransientPrompt
|
||||
```
|
||||
|
||||
## TransientPrompt and TransientRightPrompt in Cmd
|
||||
|
||||
Clink allows you to replace the previous-printed prompt with custom strings. This is useful in cases where all the prompt information is not always needed. To enable this, run `clink set prompt.transient <value>` where \<value\> can be one of:
|
||||
|
||||
- `always`: always replace the previous prompt
|
||||
- `same_dir`: replace the previous prompt only if the working directory is same
|
||||
- `off`: do not replace the prompt (i.e. turn off transience)
|
||||
|
||||
You need to do this only once. Make the following changes to your `starship.lua` to customize what gets displayed on the left and on the right:
|
||||
|
||||
- By default, the left side of input gets replaced with `>`. To customize this, define a new function called `starship_transient_prompt_func`. This function receives the current prompt as a string that you can utilize. For example, to display Starship's `character` module here, you would do
|
||||
|
||||
```lua
|
||||
function starship_transient_prompt_func(prompt)
|
||||
return io.popen("starship module character"
|
||||
.." --keymap="..rl.getvariable('keymap')
|
||||
):read("*a")
|
||||
end
|
||||
load(io.popen('starship init cmd'):read("*a"))()
|
||||
```
|
||||
|
||||
- By default, the right side of input is empty. To customize this, define a new function called `starship_transient_rprompt_func`. This function receives the current prompt as a string that you can utilize. For example, to display the time at which the last command was started here, you would do
|
||||
|
||||
```lua
|
||||
function starship_transient_rprompt_func(prompt)
|
||||
return io.popen("starship module time"):read("*a")
|
||||
end
|
||||
load(io.popen('starship init cmd'):read("*a"))()
|
||||
```
|
||||
|
||||
## Comandos pre-prompt y pre-ejecución personalizados en Cmd
|
||||
|
||||
Clink proporciona una API extremadamente flexible para ejecutar comandos pre-prompt y pre-ejecución en la shell de Cmd. Es bastante sencillo de usar con Starship. Haz los siguientes cambios a tu archivo `starship.lua` según tus requisitos:
|
||||
@@ -185,6 +231,9 @@ Las cadenas de estilo son una lista de palabras, separadas por espacios en blanc
|
||||
- `underline`
|
||||
- `dimmed`
|
||||
- `inverted`
|
||||
- `parpadear`
|
||||
- `oculto`
|
||||
- `tachado`
|
||||
- `bg:<color>`
|
||||
- `fg:<color>`
|
||||
- `<color>`
|
||||
@@ -201,3 +250,9 @@ Un especificador de color puede ser uno de los siguientes:
|
||||
- Un número entre 0-255. Esto especifica un [Código de color ANSI de 8-bits](https://i.stack.imgur.com/KTSQa.png).
|
||||
|
||||
Si se especifican varios colores para el primer plano/fondo, el último en la cadena tendrá prioridad.
|
||||
|
||||
Not every style string will be displayed correctly by every terminal. In particular, the following known quirks exist:
|
||||
|
||||
- Many terminals disable support for `blink` by default
|
||||
- `hidden` is not supported on iTerm (https://gitlab.com/gnachman/iterm2/-/issues/4564).
|
||||
- `strikethrough` is not supported by the default macOS Terminal.app
|
||||
|
||||
Reference in New Issue
Block a user