diff --git a/package.json b/package.json index ec7455247..425ce6be3 100644 --- a/package.json +++ b/package.json @@ -955,9 +955,10 @@ "default": "editor", "enum": [ "editor", - "terminal" + "terminal", + "none" ], - "description": "Keeping focus when running." + "description": "What to show/focus after running code. Set to 'editor' or 'terminal' to show the terminal. Set to 'none' to not show the terminal." }, "r.alwaysUseActiveTerminal": { "type": "boolean", diff --git a/src/rTerminal.ts b/src/rTerminal.ts index 9c911122c..a8d850f69 100644 --- a/src/rTerminal.ts +++ b/src/rTerminal.ts @@ -265,5 +265,7 @@ export async function runTextInTerm(text: string): Promise { function setFocus(term: vscode.Terminal) { const focus: string = config().get('source.focus'); - term.show(focus !== 'terminal'); + if (focus !== 'none') { + term.show(focus !== 'terminal'); + } }