File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
src/vs/workbench/contrib/cortexide/browser Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -125,7 +125,10 @@ 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 cwd : URI | string | undefined = ( override_cwd ?? undefined ) ?? this . workspaceContextService . getWorkspace ( ) . folders [ 0 ] ?. uri ;
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 ;
129132
130133 const options : ICreateTerminalOptions = {
131134 cwd,
@@ -216,7 +219,7 @@ export class TerminalToolService extends Disposable implements ITerminalToolServ
216219 throw new Error ( `Read Terminal: Terminal with ID ${ terminalId } does not exist.` ) ;
217220 }
218221
219- // Ensure the xterm.js instance has been created – otherwise we cannot access the buffer.
222+ // Ensure the xterm.js instance has been created - otherwise we cannot access the buffer.
220223 if ( ! terminal . xterm ) {
221224 throw new Error ( 'Read Terminal: The requested terminal has not yet been rendered and therefore has no scrollback buffer available.' ) ;
222225 }
You can’t perform that action at this time.
0 commit comments