fix: set shell in Export-PoshImage

When the shell is not set, some ansi characters are added at the end of the prompt

fix #980
This commit is contained in:
lnu 2021-09-26 08:44:08 +02:00 committed by Jan De Dobbeleer
parent 0bbc26d635
commit 4bf820b10f
2 changed files with 2 additions and 2 deletions

View file

@ -42,7 +42,7 @@ There are a couple of parameters you can use to tweak the image rendering:
The oh-my-posh executable has the `--export-png` switch to export your current theme configuration.
```powershell
oh-my-posh --config ~/.mytheme.omp.json --export-png --cursor-padding 50
oh-my-posh --shell shell --config ~/.mytheme.omp.json --export-png --cursor-padding 50
```
There are a couple of additional switches you can use to tweak the image rendering:

View file

@ -203,7 +203,7 @@ function global:Export-PoshImage {
$omp = "::OMP::"
$config, $cleanPWD, $cleanPSWD = Get-PoshContext
$standardOut = @(&$omp --config="$config" --pwd="$cleanPWD" --pswd="$cleanPSWD" --export-png --rprompt-offset="$RPromptOffset" --cursor-padding="$CursorPadding" $Author $BGColor 2>&1)
$standardOut = @(&$omp --shell=shell --config="$config" --pwd="$cleanPWD" --pswd="$cleanPSWD" --export-png --rprompt-offset="$RPromptOffset" --cursor-padding="$CursorPadding" $Author $BGColor 2>&1)
$standardOut -join "`n"
}