mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-03-05 20:49:04 -08:00
parent
96a2af1405
commit
82c8efe0ed
|
@ -146,6 +146,7 @@ func (e *engine) render() {
|
||||||
if e.settings.FinalSpace {
|
if e.settings.FinalSpace {
|
||||||
e.renderer.print(" ")
|
e.renderer.print(" ")
|
||||||
}
|
}
|
||||||
|
e.renderer.clearEOL()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *engine) reset() {
|
func (e *engine) reset() {
|
||||||
|
|
|
@ -20,6 +20,7 @@ type formats struct {
|
||||||
rANSI string
|
rANSI string
|
||||||
title string
|
title string
|
||||||
creset string
|
creset string
|
||||||
|
clearOEL string
|
||||||
}
|
}
|
||||||
|
|
||||||
//Renderer writes colorized strings
|
//Renderer writes colorized strings
|
||||||
|
@ -49,6 +50,7 @@ func (r *Renderer) init(shell string) {
|
||||||
r.formats.right = "%%{\x1b[%dD%%}"
|
r.formats.right = "%%{\x1b[%dD%%}"
|
||||||
r.formats.title = "%%{\033]0;%s\007%%}"
|
r.formats.title = "%%{\033]0;%s\007%%}"
|
||||||
r.formats.creset = "%{\x1b[0m%}"
|
r.formats.creset = "%{\x1b[0m%}"
|
||||||
|
r.formats.clearOEL = "%{\x1b[K%}"
|
||||||
case "bash":
|
case "bash":
|
||||||
r.formats.single = "\\[\x1b[%sm\\]%s\\[\x1b[0m\\]"
|
r.formats.single = "\\[\x1b[%sm\\]%s\\[\x1b[0m\\]"
|
||||||
r.formats.full = "\\[\x1b[%sm\x1b[%sm\\]%s\\[\x1b[0m\\]"
|
r.formats.full = "\\[\x1b[%sm\x1b[%sm\\]%s\\[\x1b[0m\\]"
|
||||||
|
@ -58,6 +60,7 @@ func (r *Renderer) init(shell string) {
|
||||||
r.formats.right = "\\[\x1b[%dD\\]"
|
r.formats.right = "\\[\x1b[%dD\\]"
|
||||||
r.formats.title = "\\[\033]0;%s\007\\]"
|
r.formats.title = "\\[\033]0;%s\007\\]"
|
||||||
r.formats.creset = "\\[\x1b[0m\\]"
|
r.formats.creset = "\\[\x1b[0m\\]"
|
||||||
|
r.formats.clearOEL = "\\[\x1b[K\\]"
|
||||||
default:
|
default:
|
||||||
r.formats.single = "\x1b[%sm%s\x1b[0m"
|
r.formats.single = "\x1b[%sm%s\x1b[0m"
|
||||||
r.formats.full = "\x1b[%sm\x1b[%sm%s\x1b[0m"
|
r.formats.full = "\x1b[%sm\x1b[%sm%s\x1b[0m"
|
||||||
|
@ -67,6 +70,7 @@ func (r *Renderer) init(shell string) {
|
||||||
r.formats.right = "\x1b[%dD"
|
r.formats.right = "\x1b[%dD"
|
||||||
r.formats.title = "\033]0;%s\007"
|
r.formats.title = "\033]0;%s\007"
|
||||||
r.formats.creset = "\x1b[0m"
|
r.formats.creset = "\x1b[0m"
|
||||||
|
r.formats.clearOEL = "\x1b[K"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -167,3 +171,7 @@ func (r *Renderer) creset() {
|
||||||
func (r *Renderer) print(text string) {
|
func (r *Renderer) print(text string) {
|
||||||
fmt.Print(text)
|
fmt.Print(text)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (r *Renderer) clearEOL() {
|
||||||
|
fmt.Print(r.formats.clearOEL)
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue