mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-03-05 20:49:04 -08:00
fix(pwsh): only clear console after block write
This commit is contained in:
parent
b11b69f0e8
commit
3b7b854fdc
|
@ -19,13 +19,6 @@ type engine struct {
|
|||
|
||||
func (e *engine) write(text string) {
|
||||
e.console.WriteString(text)
|
||||
// Due to a bug in Powershell, the end of the line needs to be cleared.
|
||||
// If this doesn't happen, the portion after the prompt gets colored in the background
|
||||
// color of the line above the new input line. Clearing the line fixes this,
|
||||
// but can hopefully one day be removed when this is resolved natively.
|
||||
if e.ansi.shell == pwsh || e.ansi.shell == powershell5 {
|
||||
e.console.WriteString(e.ansi.clearEOL)
|
||||
}
|
||||
}
|
||||
|
||||
func (e *engine) string() string {
|
||||
|
@ -86,6 +79,13 @@ func (e *engine) renderBlock(block *Block) {
|
|||
case RPrompt:
|
||||
e.rprompt = block.renderSegments()
|
||||
}
|
||||
// Due to a bug in Powershell, the end of the line needs to be cleared.
|
||||
// If this doesn't happen, the portion after the prompt gets colored in the background
|
||||
// color of the line above the new input line. Clearing the line fixes this,
|
||||
// but can hopefully one day be removed when this is resolved natively.
|
||||
if e.ansi.shell == pwsh || e.ansi.shell == powershell5 {
|
||||
e.write(e.ansi.clearEOL)
|
||||
}
|
||||
}
|
||||
|
||||
// debug will loop through your config file and output the timings for each segments
|
||||
|
|
Loading…
Reference in a new issue