mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-28 20:39: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 (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
@ -247,7 +248,8 @@ func (e *engine) print() {
|
||||||
switch e.env.getShellName() {
|
switch e.env.getShellName() {
|
||||||
case zsh:
|
case zsh:
|
||||||
if *e.env.getArgs().Eval {
|
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)
|
fmt.Printf("\nRPROMPT=\"%s\"", e.rprompt)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue