Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,12 @@ export class Commands {
// when opening a workspace unless explicitly specified.
const remoteAuthority = `ssh-remote+${Remote.Prefix}${workspaceOwner}--${workspaceName}`

let newWindow = true
// Open in the existing window if no workspaces are open.
if (!vscode.workspace.workspaceFolders?.length) {
newWindow = false
}

const output: {
workspaces: { folderUri: vscode.Uri; remoteAuthority: string }[]
} = await vscode.commands.executeCommand("_workbench.getRecentlyOpened")
Expand Down Expand Up @@ -192,11 +198,16 @@ export class Commands {
authority: remoteAuthority,
path: selected.folderUri.path,
}),
// Open this in a new window!
newWindow,
)
return
}

// This opens the workspace without an active folder opened.
await vscode.commands.executeCommand("vscode.newWindow", { remoteAuthority: remoteAuthority, reuseWindow: true })
await vscode.commands.executeCommand("vscode.newWindow", {
remoteAuthority: remoteAuthority,
reuseWindow: !newWindow,
})
}
}