Skip to content

Commit

Permalink
fix: correct hyperlinks for Git Bash
Browse files Browse the repository at this point in the history
kill it with fire
  • Loading branch information
JanDeDobbeleer committed Jul 23, 2024
1 parent 7563d5f commit eb1cf54
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/prompt/engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func TestPrintPWD(t *testing.T) {
Pwd: `C:\Users\user\Documents\GitHub\oh-my-posh`,
Config: terminal.OSC99,
Shell: shell.BASH,
Expected: "\x1b]9;9;C:\\Users\\user\\Documents\\GitHub\\oh-my-posh\x1b\\",
Expected: "\x1b]9;9;C:/Users/user/Documents/GitHub/oh-my-posh\x1b\\",
},
}

Expand Down
4 changes: 3 additions & 1 deletion src/terminal/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,11 @@ func Pwd(pwdType, userName, hostName, pwd string) string {
}

if strings.HasSuffix(pwd, ":") {
pwd += "\\"
pwd += `/`
}

pwd = strings.ReplaceAll(pwd, `\`, `/`)

switch pwdType {
case OSC7:
return fmt.Sprintf(formats.Osc7, hostName, pwd)
Expand Down

0 comments on commit eb1cf54

Please sign in to comment.