From 895efc47d32d6f4060c9c14c8d11ae1d7db40cde Mon Sep 17 00:00:00 2001 From: Tyler Fong Date: Sun, 25 Feb 2024 23:00:37 +0000 Subject: [PATCH] fixed pr changes for host --- pkg/cmd/open/open.go | 2 +- pkg/cmd/shell/shell.go | 2 +- pkg/entity/entity.go | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) 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:] }