Skip to content

Commit bd61073

Browse files
authored
reveal active editor / show panel when appropriate (microsoft#158802)
1 parent dcf0c0a commit bd61073

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/vs/workbench/contrib/terminal/browser/terminalActions.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,7 @@ export function registerTerminalActions() {
545545
const terminalService = accessor.get(ITerminalService);
546546
const terminalGroupService = accessor.get(ITerminalGroupService);
547547
const codeEditorService = accessor.get(ICodeEditorService);
548+
const terminalEditorService = accessor.get(ITerminalEditorService);
548549

549550
const instance = await terminalService.getActiveOrCreateInstance();
550551
const editor = codeEditorService.getActiveCodeEditor();
@@ -560,7 +561,11 @@ export function registerTerminalActions() {
560561
text = editor.getModel().getValueInRange(selection, endOfLinePreference);
561562
}
562563
instance.sendText(text, true);
563-
return terminalGroupService.showPanel();
564+
if (instance.target === TerminalLocation.Editor) {
565+
terminalEditorService.revealActiveEditor();
566+
} else {
567+
terminalGroupService.showPanel();
568+
}
564569
}
565570
});
566571
registerAction2(class extends Action2 {

0 commit comments

Comments
 (0)