fix(pwsh): do not clear after valid and error lines

This commit is contained in:
Clement Yan 2024-08-20 22:38:34 +08:00 committed by GitHub
parent 373e2f8961
commit 4bcba545d9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -110,10 +110,14 @@ func (e *Engine) ExtraPrompt(promptType ExtraPromptType) string {
} }
return str return str
case shell.PWSH, shell.PWSH5: case shell.PWSH, shell.PWSH5:
// Return the string and empty our buffer if promptType == Transient {
// clear the line afterwards to prevent text from being written on the same line // Return the string and empty our buffer
// see https://github.com/JanDeDobbeleer/oh-my-posh/issues/3628 // clear the line afterwards to prevent text from being written on the same line
return str + terminal.ClearAfter() // 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: case shell.CMD, shell.BASH, shell.FISH, shell.NU, shell.GENERIC:
// Return the string and empty our buffer // Return the string and empty our buffer
return str return str