feat(nushell): enable set_poshcontext

resolves #5095
This commit is contained in:
Nibodhika 2024-06-16 10:25:18 +02:00 committed by Jan De Dobbeleer
parent 0e45aa5997
commit 8eb8d88a20
2 changed files with 13 additions and 0 deletions

View file

@ -28,6 +28,10 @@ $env.PROMPT_COMMAND = { ||
$clear = (history | is-empty) or ((history | last 1 | get 0.command) == "clear")
}
if ($env.SET_POSHCONTEXT? | is-not-empty) {
do --env $env.SET_POSHCONTEXT
}
^::OMP:: print primary $"--config=($env.POSH_THEME)" --shell=nu $"--shell-version=($env.POSH_SHELL_VERSION)" $"--execution-time=(posh_cmd_duration)" $"--status=($env.LAST_EXIT_CODE)" $"--terminal-width=(posh_width)" $"--cleared=($clear)"
}

View file

@ -90,6 +90,15 @@ function set_poshcontext
end
```
</TabItem>
<TabItem value="nu">
```bash
$env.SET_POSHCONTEXT = {
$env.POSH = ( date now );
}
```
</TabItem>
</Tabs>