diff --git a/pkg/cmd/open/open.go b/pkg/cmd/open/open.go index 187b4c29..63b187a5 100644 --- a/pkg/cmd/open/open.go +++ b/pkg/cmd/open/open.go @@ -115,7 +115,7 @@ func runOpenCommand(t *terminal.Terminal, tstore OpenStore, wsIDOrName string, s localIdentifier := workspace.GetLocalIdentifier() if host { - localIdentifier += "-host" + localIdentifier = workspace.GetHostIdentifier() } err = res.Await() diff --git a/pkg/cmd/shell/shell.go b/pkg/cmd/shell/shell.go index 1c22d2e8..965d789e 100644 --- a/pkg/cmd/shell/shell.go +++ b/pkg/cmd/shell/shell.go @@ -97,7 +97,7 @@ func runShellCommand(t *terminal.Terminal, sstore ShellStore, workspaceNameOrID, localIdentifier := workspace.GetLocalIdentifier() if host { - localIdentifier += "-host" + localIdentifier = workspace.GetHostIdentifier() } sshName := string(localIdentifier) diff --git a/pkg/entity/entity.go b/pkg/entity/entity.go index 817b19a5..56acb674 100644 --- a/pkg/entity/entity.go +++ b/pkg/entity/entity.go @@ -450,6 +450,10 @@ func (w Workspace) GetLocalIdentifier() WorkspaceLocalID { return w.createSimpleName() } +func (w Workspace) GetHostIdentifier() WorkspaceLocalID { + return w.createSimpleName() + "-host" +} + func MakeIDSuffix(id string) string { return id[len(id)-4:] }