Skip to content

Commit

Permalink
fix(pwsh): do not clear after valid and error lines
Browse files Browse the repository at this point in the history
  • Loading branch information
clemyan authored Aug 20, 2024
1 parent 373e2f8 commit 4bcba54
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/prompt/extra.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,14 @@ func (e *Engine) ExtraPrompt(promptType ExtraPromptType) string {
}
return str
case shell.PWSH, shell.PWSH5:
// Return the string and empty our buffer
// 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 + terminal.ClearAfter()
if promptType == Transient {
// Return the string and empty our buffer
// 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 + terminal.ClearAfter()
}

return str
case shell.CMD, shell.BASH, shell.FISH, shell.NU, shell.GENERIC:
// Return the string and empty our buffer
return str
Expand Down

0 comments on commit 4bcba54

Please sign in to comment.