Skip to content

Commit

Permalink
Don't run chat codeblocks in task terminals (microsoft#180552)
Browse files Browse the repository at this point in the history
  • Loading branch information
roblourens committed Apr 21, 2023
1 parent a5669b1 commit 6bef4cd
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,13 @@ export function registerInteractiveSessionCodeBlockActions() {

let terminal = await terminalService.getActiveOrCreateInstance();

// Why does getActiveOrCreateInstance return a disposed terminal?
terminal = terminal.isDisposed ? await terminalService.createTerminal() : terminal;
// Why does getActiveOrCreateInstance return a disposed terminal? #180018
// isFeatureTerminal = debug terminal
const unusableTerminal = terminal.isDisposed || terminal.xterm?.isStdinDisabled || terminal.shellLaunchConfig.type === 'Task' || terminal.shellLaunchConfig.isFeatureTerminal;
terminal = unusableTerminal ? await terminalService.createTerminal() : terminal;

await terminal.focusWhenReady();
terminalService.setActiveInstance(terminal);
await terminal.focusWhenReady(true);
if (terminal.target === TerminalLocation.Editor) {
const existingEditors = editorService.findEditors(terminal.resource);
terminalEditorService.openEditor(terminal, { viewColumn: existingEditors?.[0].groupId });
Expand Down

0 comments on commit 6bef4cd

Please sign in to comment.