mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-18 07:47:23 +01:00
Merge pull request #173573 from microsoft/tyriar/173247
Don't focus terminal on run selected text/active file
This commit is contained in:
@@ -651,7 +651,7 @@ export function registerTerminalActions() {
|
|||||||
text = editor.getModel().getValueInRange(selection, endOfLinePreference);
|
text = editor.getModel().getValueInRange(selection, endOfLinePreference);
|
||||||
}
|
}
|
||||||
instance.sendText(text, true, true);
|
instance.sendText(text, true, true);
|
||||||
await focusActiveTerminal(instance, terminalEditorService, terminalGroupService);
|
await revealActiveTerminal(instance, terminalEditorService, terminalGroupService);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
registerAction2(class extends Action2 {
|
registerAction2(class extends Action2 {
|
||||||
@@ -683,7 +683,7 @@ export function registerTerminalActions() {
|
|||||||
if (instance?.xterm?.isStdinDisabled || instance?.shellLaunchConfig.type === 'Task') {
|
if (instance?.xterm?.isStdinDisabled || instance?.shellLaunchConfig.type === 'Task') {
|
||||||
instance = await terminalService.createTerminal();
|
instance = await terminalService.createTerminal();
|
||||||
terminalService.setActiveInstance(instance);
|
terminalService.setActiveInstance(instance);
|
||||||
await focusActiveTerminal(instance, terminalEditorService, terminalGroupService);
|
await revealActiveTerminal(instance, terminalEditorService, terminalGroupService);
|
||||||
}
|
}
|
||||||
|
|
||||||
const isRemote = instance ? instance.isRemote : (workbenchEnvironmentService.remoteAuthority ? true : false);
|
const isRemote = instance ? instance.isRemote : (workbenchEnvironmentService.remoteAuthority ? true : false);
|
||||||
@@ -2748,3 +2748,11 @@ async function focusActiveTerminal(instance: ITerminalInstance, terminalEditorSe
|
|||||||
await terminalGroupService.showPanel(true);
|
await terminalGroupService.showPanel(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function revealActiveTerminal(instance: ITerminalInstance, terminalEditorService: ITerminalEditorService, terminalGroupService: ITerminalGroupService): Promise<void> {
|
||||||
|
if (instance.target === TerminalLocation.Editor) {
|
||||||
|
await terminalEditorService.revealActiveEditor();
|
||||||
|
} else {
|
||||||
|
await terminalGroupService.showPanel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user