mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-02-02 05:41:10 -08:00
parent
2cf288e46c
commit
2eb45b5863
|
@ -2,6 +2,7 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
@ -90,7 +91,13 @@ func (b *Block) renderSegments() string {
|
||||||
}
|
}
|
||||||
b.activeSegment = segment
|
b.activeSegment = segment
|
||||||
b.endPowerline()
|
b.endPowerline()
|
||||||
b.renderSegmentText(segment.stringValue)
|
segmentValue := segment.stringValue
|
||||||
|
// escape backslashes to avoid replacements
|
||||||
|
// https://tldp.org/HOWTO/Bash-Prompt-HOWTO/bash-prompt-escape-sequences.html
|
||||||
|
if b.env.getShellName() == bash {
|
||||||
|
segmentValue = strings.ReplaceAll(segment.stringValue, "\\", "\\\\")
|
||||||
|
}
|
||||||
|
b.renderSegmentText(segmentValue)
|
||||||
}
|
}
|
||||||
if b.previousActiveSegment != nil && b.previousActiveSegment.Style == Powerline {
|
if b.previousActiveSegment != nil && b.previousActiveSegment.Style == Powerline {
|
||||||
b.writePowerLineSeparator(Transparent, b.previousActiveSegment.background(), true)
|
b.writePowerLineSeparator(Transparent, b.previousActiveSegment.background(), true)
|
||||||
|
|
Loading…
Reference in a new issue