From 4bf820b10fe4aece1e8cf3c7d8b207b351069fbb Mon Sep 17 00:00:00 2001 From: lnu Date: Sun, 26 Sep 2021 08:44:08 +0200 Subject: [PATCH] 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 --- docs/docs/share-theme.mdx | 2 +- src/init/omp.ps1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/docs/share-theme.mdx b/docs/docs/share-theme.mdx index cc06664f..21b2ae39 100644 --- a/docs/docs/share-theme.mdx +++ b/docs/docs/share-theme.mdx @@ -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: diff --git a/src/init/omp.ps1 b/src/init/omp.ps1 index 0f227805..9deaf367 100644 --- a/src/init/omp.ps1 +++ b/src/init/omp.ps1 @@ -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" }