File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
src/vs/workbench/contrib/cortexide/browser Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -125,10 +125,18 @@ export class TerminalToolService extends Disposable implements ITerminalToolServ
125125 private async _createTerminal ( props : { cwd : string | null , config : ICreateTerminalOptions [ 'config' ] , hidden ?: boolean } ) {
126126 const { cwd : override_cwd , config, hidden } = props ;
127127
128- const workspace = this . workspaceContextService . getWorkspace ( ) ;
129- const [ firstFolder ] = workspace . folders ;
130- const workspaceFolderUri = firstFolder ? firstFolder . uri : undefined ;
131- const cwd : URI | string | undefined = override_cwd !== null ? override_cwd : workspaceFolderUri ;
128+ let cwd : URI | string | undefined ;
129+ if ( override_cwd !== null ) {
130+ cwd = override_cwd ;
131+ } else {
132+ const workspace = this . workspaceContextService . getWorkspace ( ) ;
133+ if ( workspace . folders . length > 0 ) {
134+ const firstFolder = workspace . folders [ 0 ] ;
135+ if ( firstFolder ) {
136+ cwd = firstFolder . uri ;
137+ }
138+ }
139+ }
132140
133141 const options : ICreateTerminalOptions = {
134142 cwd,
You can’t perform that action at this time.
0 commit comments