Skip to content

Commit 0c6b3c3

Browse files
acolombierpascalbreuninger
authored andcommitted
fix(Zed): remove the double leading slashes on project
1 parent 7c277f1 commit 0c6b3c3

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

pkg/ide/zed/zed.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ import (
1616
func Open(ctx context.Context, values map[string]config.OptionValue, userName, workspaceFolder, workspaceID string, log log.Logger) error {
1717
log.Info("Opening Zed editor...")
1818

19-
sshHost := fmt.Sprintf("%s.devpod/%s", workspaceID, workspaceFolder)
19+
if len(workspaceFolder) == 0 || workspaceFolder[0] != '/' {
20+
workspaceFolder = fmt.Sprintf("/%s", workspaceFolder)
21+
}
22+
23+
sshHost := fmt.Sprintf("%s.devpod%s", workspaceID, workspaceFolder)
2024
openURL := fmt.Sprintf("zed://ssh/%s", sshHost)
2125
err := open.Run(openURL)
2226
if err != nil {

pkg/ide/zed/zed_linux.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ import (
1616
func Open(ctx context.Context, values map[string]config.OptionValue, userName, workspaceFolder, workspaceID string, log log.Logger) error {
1717
log.Info("Opening Zed editor...")
1818

19-
sshHost := fmt.Sprintf("%s.devpod/%s", workspaceID, workspaceFolder)
19+
if len(workspaceFolder) == 0 || workspaceFolder[0] != '/' {
20+
workspaceFolder = fmt.Sprintf("/%s", workspaceFolder)
21+
}
22+
23+
sshHost := fmt.Sprintf("%s.devpod%s", workspaceID, workspaceFolder)
2024
openURL := fmt.Sprintf("zed://ssh/%s", sshHost)
2125
out, err := exec.Command("xdg-open", openURL).CombinedOutput()
2226
if err != nil {

0 commit comments

Comments
 (0)