Python Forum
Automatic Focus On Output To Integrated Terminal of VS-Code
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Automatic Focus On Output To Integrated Terminal of VS-Code
#1
It is seen that on code execution via code runner (Ctrl+Alt+N), shifting of focus from code editor to integrated terminal does take place, provided preserveFocus property of code runner is set to false. This is found to be a helpful feature, eliminating the risk of inadvertent user interference to underlying code file.

Relevant entries in settings.json file are as follows:

For output in terminal pane:
    "code-runner.runInTerminal": true,
    "code-runner.preserveFocus": false,
For output in output pane:
    "code-runner.runInTerminal": false,
    "code-runner.preserveFocus": false,
On the other hand if code is executed without involving code runner, focus continues to stay with the underlying code editor.

As an exception, if code is executed via Ctrl+F5 (i.e. Start Without Debugging), the integrated terminal has focus while displaying the output.

It would be nice if there could be a solution ensuring universal automatic focus on output displayed in integrated terminal, including the following alternatives:

(a) Right click on code editor & selecting "Run Python File In Terminal".
(b) Shift+Enter for "Run Selection/Line In Python Terminal".
© Ctrl+Shift+B for executing the code as default task.
A.D.Tejpal
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  looking for code to do timed prompt on terminal Skaperen 1 1,034 Jul-10-2022, 05:40 AM
Last Post: buran
  Learning Focus MrLupin 2 2,311 May-17-2021, 03:18 PM
Last Post: Naheed
  Python Shell As Preferred Mode For Integrated Terminal In Visual Studio Code adt 4 3,980 Sep-07-2019, 06:00 PM
Last Post: adt
  What to focus on next? WuchaDoin 8 3,820 Sep-22-2018, 03:55 AM
Last Post: Skaperen
  Valve forks WINE for a focus on gaming nilamo 1 2,365 Aug-22-2018, 08:48 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020