Skip to content

Commit 8ce8291

Browse files
committed
skip tilde
1 parent dd6492c commit 8ce8291

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

Diff for: internal/shell/bash/action.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"strings"
77

88
"github.com/carapace-sh/carapace/internal/common"
9-
"github.com/carapace-sh/carapace/internal/log"
109
)
1110

1211
var sanitizer = strings.NewReplacer(
@@ -43,7 +42,6 @@ var escapingReplacer = strings.NewReplacer(
4342
`[`, `\[`,
4443
`]`, `\]`,
4544
`*`, `\*`,
46-
`~`, `\~`,
4745
)
4846

4947
var displayReplacer = strings.NewReplacer(
@@ -108,7 +106,7 @@ func ActionRawValues(currentWord string, meta common.Meta, values common.RawValu
108106
vals[index] = sanitizer.Replace(val.Value)
109107
switch {
110108
case strings.HasPrefix(vals[index], "~"): // assume homedir expansion
111-
vals[index] = "~" + escapingReplacer.Replace(strings.TrimPrefix(vals[index], "~"))
109+
vals[index] = escapingReplacer.Replace(vals[index])
112110
case requiresQuoting(vals[index]):
113111
vals[index] = fmt.Sprintf(`"%v"`, escapingQuotedReplacer.Replace(vals[index]))
114112
}

0 commit comments

Comments
 (0)