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