Skip to content

Commit

Permalink
fix: set shell in Export-PoshImage
Browse files Browse the repository at this point in the history
When the shell is not set, some ansi characters are added at the end of the prompt

fix #980
  • Loading branch information
lnu authored and JanDeDobbeleer committed Sep 26, 2021
1 parent 0bbc26d commit 4bf820b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/docs/share-theme.mdx
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/init/omp.ps1
Expand Up @@ -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"
}

Expand Down

0 comments on commit 4bf820b

Please sign in to comment.