-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
Behaviour
With the default settings, running a Python file (using the "Python: Run File in Terminal" command) does not focus the terminal. This is fine.
I want to focus the terminal as soon as the Python file starts running (a reasonable use case for scripts that accept user input), so I enable "Python › Terminal: Focus After Launch" (python.terminal.focusAfterLaunch). The description makes sense to me:
When launching a python terminal, whether to focus the cursor on the terminal.
But the title is "Focus After Launch", and that is what it literally does: It launches the Python process, waits for it to exit (?!), and then focuses the terminal. Unless there's a valid use case that I'm missing, this setting should instead focus the terminal upon launch, not after.
Turns out there is a setting to do what I want (focus the terminal upon launch): "Terminal › Integrated: Focus After Run" (terminal.integrated.focusAfterRun).
Controls whether the terminal, accessible buffer, or neither will be focused after
Terminal: Run Selected Text In Active Terminalhas been run.
The naming and description are both confusing:
- What's the difference between "after launch" and "after run"? It's focusing the terminal as soon as the command is run, not afterward.
- This isn't specific to
Terminal: Run Selected Text In Active Terminalat all.
Steps to reproduce:
- Create and save a Python file that sleeps, and another that takes user input
- Enable "Python › Terminal: Focus After Launch" (
python.terminal.focusAfterLaunch) and/or "Terminal › Integrated: Focus After Run" (terminal.integrated.focusAfterRun) - Run the "Python: Run Python File" command