File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -158,6 +158,12 @@ export class Commands {
158158 // when opening a workspace unless explicitly specified.
159159 const remoteAuthority = `ssh-remote+${ Remote . Prefix } ${ workspaceOwner } --${ workspaceName } `
160160
161+ let newWindow = true
162+ // Open in the existing window if no workspaces are open.
163+ if ( ! vscode . workspace . workspaceFolders ?. length ) {
164+ newWindow = false
165+ }
166+
161167 const output : {
162168 workspaces : { folderUri : vscode . Uri ; remoteAuthority : string } [ ]
163169 } = await vscode . commands . executeCommand ( "_workbench.getRecentlyOpened" )
@@ -192,11 +198,16 @@ export class Commands {
192198 authority : remoteAuthority ,
193199 path : selected . folderUri . path ,
194200 } ) ,
201+ // Open this in a new window!
202+ newWindow ,
195203 )
196204 return
197205 }
198206
199207 // This opens the workspace without an active folder opened.
200- await vscode . commands . executeCommand ( "vscode.newWindow" , { remoteAuthority : remoteAuthority , reuseWindow : true } )
208+ await vscode . commands . executeCommand ( "vscode.newWindow" , {
209+ remoteAuthority : remoteAuthority ,
210+ reuseWindow : ! newWindow ,
211+ } )
201212 }
202213}
You can’t perform that action at this time.
0 commit comments