mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-11-10 04:54:03 -08:00
parent
4e8051d423
commit
e5213551bd
|
@ -129,6 +129,7 @@ func (e *engine) render() {
|
|||
if e.settings.ConsoleTitle {
|
||||
e.renderer.setConsoleTitle(e.env.getcwd())
|
||||
}
|
||||
e.renderer.creset()
|
||||
if e.settings.FinalSpace {
|
||||
fmt.Print(" ")
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@ type formats struct {
|
|||
right string
|
||||
rANSI string
|
||||
title string
|
||||
creset string
|
||||
}
|
||||
|
||||
//Shell indicates the shell we're currently in
|
||||
|
@ -54,6 +55,7 @@ func (r *Renderer) init(shell string) {
|
|||
r.formats.left = "%%{\x1b[%dC%%}"
|
||||
r.formats.right = "%%{\x1b[%dD%%}"
|
||||
r.formats.title = "%%{\033]0;%s\007%%}"
|
||||
r.formats.creset = "%{\x1b[0m%}"
|
||||
r.shell = zsh
|
||||
case "bash":
|
||||
r.formats.single = "\\[\x1b[%sm\\]%s\\[\x1b[0m\\]"
|
||||
|
@ -64,6 +66,7 @@ func (r *Renderer) init(shell string) {
|
|||
r.formats.left = "\\[\x1b[%dC\\]"
|
||||
r.formats.right = "\\[\x1b[%dD\\]"
|
||||
r.formats.title = "\\[\033]0;%s\007\\]"
|
||||
r.formats.creset = "\\[\x1b[0m\\]"
|
||||
r.shell = bash
|
||||
default:
|
||||
r.formats.single = "\x1b[%sm%s\x1b[0m"
|
||||
|
@ -74,6 +77,7 @@ func (r *Renderer) init(shell string) {
|
|||
r.formats.left = "\x1b[%dC"
|
||||
r.formats.right = "\x1b[%dD"
|
||||
r.formats.title = "\033]0;%s\007"
|
||||
r.formats.creset = "\x1b[0m"
|
||||
r.shell = universal
|
||||
}
|
||||
}
|
||||
|
@ -171,3 +175,7 @@ func (r *Renderer) string() string {
|
|||
func (r *Renderer) reset() {
|
||||
r.Buffer.Reset()
|
||||
}
|
||||
|
||||
func (r *Renderer) creset() {
|
||||
fmt.Print(r.formats.creset)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue