File tree 1 file changed +12
-1
lines changed
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -158,6 +158,12 @@ export class Commands {
158
158
// when opening a workspace unless explicitly specified.
159
159
const remoteAuthority = `ssh-remote+${ Remote . Prefix } ${ workspaceOwner } --${ workspaceName } `
160
160
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
+
161
167
const output : {
162
168
workspaces : { folderUri : vscode . Uri ; remoteAuthority : string } [ ]
163
169
} = await vscode . commands . executeCommand ( "_workbench.getRecentlyOpened" )
@@ -192,11 +198,16 @@ export class Commands {
192
198
authority : remoteAuthority ,
193
199
path : selected . folderUri . path ,
194
200
} ) ,
201
+ // Open this in a new window!
202
+ newWindow ,
195
203
)
196
204
return
197
205
}
198
206
199
207
// 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
+ } )
201
212
}
202
213
}
You can’t perform that action at this time.
0 commit comments