mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-31 22:07:25 -08:00
fix(warp): support newlines
This commit is contained in:
parent
3dc8538136
commit
1e50107ff6
|
@ -354,3 +354,9 @@ func (a *Ansi) SaveCursorPosition() string {
|
|||
func (a *Ansi) RestoreCursorPosition() string {
|
||||
return a.restoreCursorPosition
|
||||
}
|
||||
|
||||
func (a *Ansi) LineBreak() string {
|
||||
cr := fmt.Sprintf(a.left, 1000)
|
||||
lf := fmt.Sprintf(a.linechange, 1, "B")
|
||||
return cr + lf
|
||||
}
|
||||
|
|
|
@ -103,7 +103,13 @@ func (e *Engine) printPWD() {
|
|||
}
|
||||
|
||||
func (e *Engine) newline() {
|
||||
e.write("\n")
|
||||
// WARP terminal will remove \n from the prompt, so we hack a newline in
|
||||
if e.Env.Getenv("TERM_PROGRAM") == "WarpTerminal" {
|
||||
// fmt.Println("TERM_PROGRAM")
|
||||
e.write(e.Ansi.LineBreak())
|
||||
} else {
|
||||
e.write("\n")
|
||||
}
|
||||
e.currentLineLength = 0
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue