Run Selection in VS code or ADS without cursor moving to the terminal afterwards

Viewed 84

I would like that the cursor stays in the script file after I run a code selection with F8. What setting should I change so the cursor does not move to the terminal?

1 Answers

Assuming that the PowerShell extension for Visual Studio Code or Azure Data Studio (ADS) is installed, add the following line to your settings.json file (before the closing }):

  "powershell.integratedConsole.focusConsoleOnExecute": false, 

Alternatively, use the settings GUI (press Ctrl+,):

Settings GUI with relevant setting shown

Note the GUI's convenient search feature: typing powershell focus was sufficient to locate the relevant setting.

Related