refactor: typo in EOL

This commit is contained in:
Jan De Dobbeleer 2020-12-27 11:53:28 +01:00 committed by Jan De Dobbeleer
parent d9cf3b0e40
commit 85ee0bb0c0
2 changed files with 5 additions and 5 deletions

View file

@ -12,7 +12,7 @@ type ansiFormats struct {
left string
right string
creset string
clearOEL string
clearEOL string
saveCursorPosition string
restoreCursorPosition string
title string
@ -31,7 +31,7 @@ func (a *ansiFormats) init(shell string) {
a.left = "%%{\x1b[%dC%%}"
a.right = "%%{\x1b[%dD%%}"
a.creset = "%{\x1b[0m%}"
a.clearOEL = "%{\x1b[K%}"
a.clearEOL = "%{\x1b[K%}"
a.saveCursorPosition = "%{\x1b7%}"
a.restoreCursorPosition = "%{\x1b8%}"
a.title = "%%{\033]0;%s\007%%}"
@ -45,7 +45,7 @@ func (a *ansiFormats) init(shell string) {
a.left = "\\[\x1b[%dC\\]"
a.right = "\\[\x1b[%dD\\]"
a.creset = "\\[\x1b[0m\\]"
a.clearOEL = "\\[\x1b[K\\]"
a.clearEOL = "\\[\x1b[K\\]"
a.saveCursorPosition = "\\[\x1b7\\]"
a.restoreCursorPosition = "\\[\x1b8\\]"
a.title = "\\[\033]0;%s\007\\]"
@ -59,7 +59,7 @@ func (a *ansiFormats) init(shell string) {
a.left = "\x1b[%dC"
a.right = "\x1b[%dD"
a.creset = "\x1b[0m"
a.clearOEL = "\x1b[K"
a.clearEOL = "\x1b[K"
a.saveCursorPosition = "\x1b7"
a.restoreCursorPosition = "\x1b8"
a.title = "\033]0;%s\007"

View file

@ -40,7 +40,7 @@ func (r *AnsiRenderer) print(text string) {
// 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 r.formats.shell == pwsh || r.formats.shell == powershell5 {
r.buffer.WriteString(r.formats.clearOEL)
r.buffer.WriteString(r.formats.clearEOL)
}
}