mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-27 11:59:40 -08:00
fix: escape double quotes for zsh prompt
This commit is contained in:
parent
494d3b2d20
commit
cd3f8742ad
|
@ -2,6 +2,7 @@ package main
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
|
@ -247,7 +248,8 @@ func (e *engine) print() {
|
|||
switch e.env.getShellName() {
|
||||
case zsh:
|
||||
if *e.env.getArgs().Eval {
|
||||
fmt.Printf("PS1=\"%s\"", e.renderer.string())
|
||||
// escape double quotes contained in the prompt
|
||||
fmt.Printf("PS1=\"%s\"", strings.ReplaceAll(e.renderer.string(), "\"", "\"\""))
|
||||
fmt.Printf("\nRPROMPT=\"%s\"", e.rprompt)
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue