Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Python › Terminal: Focus After Launch" is confusing #24396

Open
injust opened this issue Nov 5, 2024 · 2 comments
Open

"Python › Terminal: Focus After Launch" is confusing #24396

injust opened this issue Nov 5, 2024 · 2 comments
Labels
feature-request Request for new features or functionality triage-needed Needs assignment to the proper sub-team

Comments

@injust
Copy link

injust commented Nov 5, 2024

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 Terminal has been run.

The naming and description are both confusing:

  1. What's the difference between "after launch" and "after run"? It's focusing the terminal as soon as the command is run, not afterward.
  2. This isn't specific to Terminal: Run Selected Text In Active Terminal at all.

Steps to reproduce:

  1. Create and save a Python file that sleeps, and another that takes user input
  2. Enable "Python › Terminal: Focus After Launch" (python.terminal.focusAfterLaunch) and/or "Terminal › Integrated: Focus After Run" (terminal.integrated.focusAfterRun)
  3. Run the "Python: Run Python File" command
@injust injust added the feature-request Request for new features or functionality label Nov 5, 2024
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Nov 5, 2024
@injust
Copy link
Author

injust commented Nov 5, 2024

This is the cause of #24382. "Python › Terminal: Focus After Launch" seems to focus the terminal, even if the "Python: Run Python File" command failed.

@injust
Copy link
Author

injust commented Nov 5, 2024

It feels to me that "Terminal › Integrated: Focus After Run" needs to be reworked and "Python › Terminal: Focus After Launch" should be torn out completely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

1 participant