fix(pwsh): clear line after extra prompts

resolves #3628
This commit is contained in:
Jan De Dobbeleer 2023-03-24 21:17:26 +01:00 committed by Jan De Dobbeleer
parent 4ff3bdf359
commit 27c8f65cd5

View file

@ -466,7 +466,13 @@ func (e *Engine) PrintExtraPrompt(promptType ExtraPromptType) string {
return prompt
}
return str
case shell.PWSH, shell.PWSH5, shell.CMD, shell.BASH, shell.FISH, shell.NU, shell.GENERIC:
case shell.PWSH, shell.PWSH5:
// Return the string and empty our buffer
str, _ := e.Writer.String()
// clear the line afterwards to prevent text from being written on the same line
// see https://github.com/JanDeDobbeleer/oh-my-posh/issues/3628
return str + e.Writer.ClearAfter()
case shell.CMD, shell.BASH, shell.FISH, shell.NU, shell.GENERIC:
// Return the string and empty our buffer
str, _ := e.Writer.String()
return str