Skip to content

Commit

Permalink
Fix escaped sequences in prompt mode status
Browse files Browse the repository at this point in the history
  • Loading branch information
maxlandon committed Dec 5, 2023
1 parent 9b74e5c commit cd5851c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 18 deletions.
36 changes: 18 additions & 18 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,21 @@ jobs:
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3

windows:
runs-on: windows-latest

steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.20.4

- name: Build
run: go build -v ./...
shell: powershell

- name: Run coverage
run: go test -v ./...
shell: powershell
# windows:
# runs-on: windows-latest
#
# steps:
# - uses: actions/checkout@v3
#
# - name: Set up Go
# uses: actions/setup-go@v3
# with:
# go-version: 1.20.4
#
# - name: Build
# run: go build -v ./...
# shell: powershell
#
# - name: Run coverage
# run: go test -v ./...
# shell: powershell
2 changes: 2 additions & 0 deletions internal/ui/prompt.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,10 @@ func (p *Prompt) formatLastPrompt(prompt string) string {
begin := regexp.MustCompile(`\\1`)
end := regexp.MustCompile(`\\2`)

// Remove delimiters, and replace quoted escape sequences
status = begin.ReplaceAllString(status, "")
status = end.ReplaceAllString(status, "")
status = strings.ReplaceAll(status, "\\e", "\x1b")

return status + prompt
}
Expand Down

0 comments on commit cd5851c

Please sign in to comment.