diff --git a/.gitignore b/.gitignore index a35eabfcdf..0662e3c053 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,6 @@ DEV_WORKSPACES tmp -*.exe \ No newline at end of file +*.exe + +main \ No newline at end of file diff --git a/pkg/agent/ssh/server.go b/pkg/agent/ssh/server.go index ebb1467140..e706ef0a34 100644 --- a/pkg/agent/ssh/server.go +++ b/pkg/agent/ssh/server.go @@ -125,7 +125,7 @@ func (s *Server) handleNonPty(session ssh.Session) { args = append([]string{"-c"}, session.RawCommand()) } - cmd := exec.Command("/bin/sh", args...) + cmd := exec.Command("sh", args...) cmd.Env = append(cmd.Env, os.Environ()...) diff --git a/pkg/ide/vscode.go b/pkg/ide/vscode.go index 44462ed9e9..2b80121228 100644 --- a/pkg/ide/vscode.go +++ b/pkg/ide/vscode.go @@ -51,7 +51,12 @@ func OpenVSCode(activeProfile config.Profile, workspaceId, repoName string, work func setupVSCodeCustomizations(workspaceHostname string, workspaceProviderMetadata string, tool devcontainer.Tool, codeServerPath string, settingsPath string, lockFileName string) error { // Check if customizations are already set up - err := exec.Command("ssh", workspaceHostname, "test", "-f", fmt.Sprintf("$HOME/%s-%s", lockFileName, string(tool))).Run() + lockFileNamePath := fmt.Sprintf("$HOME/%s-%s", lockFileName, string(tool)) + if runtime.GOOS == "windows" { + lockFileNamePath = fmt.Sprintf("$HOME\\%s-%s", lockFileName, string(tool)) + } + + err := exec.Command("ssh", workspaceHostname, "test", "-f", lockFileNamePath).Run() if err == nil { return nil } @@ -129,7 +134,7 @@ func setupVSCodeCustomizations(workspaceHostname string, workspaceProviderMetada } // Create lock file to indicate that customizations are set up - err = exec.Command("ssh", workspaceHostname, "touch", fmt.Sprintf("$HOME/%s-%s", lockFileName, string(tool))).Run() + err = exec.Command("ssh", workspaceHostname, "touch", lockFileNamePath).Run() if err != nil { return err }