Skip to content

Comments

Retain editor focus after Run In Terminal#3303

Closed
andyw8 wants to merge 1 commit intomainfrom
andyw8/retain-editor-focus
Closed

Retain editor focus after Run In Terminal#3303
andyw8 wants to merge 1 commit intomainfrom
andyw8/retain-editor-focus

Conversation

@andyw8
Copy link
Contributor

@andyw8 andyw8 commented Mar 16, 2025

I discovered that you can trigger a Code Lens with a keybinding, which is useful for Run In Terminal.

But currently the focus stays with the terminal so you need to focus back to the editor after doing so. This PR changes it to switch back automatically.

This does impact the current flow. For example, if someone is used to triggering a breakpoint with binding.b, they will now need to focus on the Terminal panel before doing anything. I expect the majority of uses for Run In Terminal are likely not doing that though, so overall it should be an improvement.

(Note: There is another change needed after this for the keyboard functionality to fully work).

@graphite-app
Copy link

graphite-app bot commented Mar 16, 2025

How to use the Graphite Merge Queue

Add the label graphite-merge to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

@andyw8 andyw8 marked this pull request as ready for review March 20, 2025 15:47
@andyw8 andyw8 requested a review from a team as a code owner March 20, 2025 15:47
@st0012
Copy link
Member

st0012 commented Mar 20, 2025

Do you mind recording demo vids for before/after comparison? I ran this branch but the behaviour seems to be the same (focus moves and stays at terminal).

@andyw8
Copy link
Contributor Author

andyw8 commented Mar 21, 2025

Sure, here's how it is on the current release. Notice that the cursor in the terminal is a solid block after the test finishes since it has focus.

main.mov

And here it is on the branch, where focus returns to the editor window:

branch.mov

@github-actions
Copy link
Contributor

This pull request is being marked as stale because there was no activity in the last 2 months

@github-actions github-actions bot added the Stale label May 21, 2025
@vinistock vinistock added vscode This pull request should be included in the VS Code extension's release notes other Changes that aren't bugfixes, enhancements or breaking changes and removed Stale labels May 21, 2025
@vinistock
Copy link
Member

Just FYI: we're trying to collect feedback about dev's expectations related to this. This change makes the focus more consistent with other explorer actions, but run in terminal has been the most popular actions for a long time and no one has ever brought up that they would rather not focus on the terminal.

That is to say, it's unclear if the majority of devs will prefer this over the current experience and we're trying to assess that.

Copy link
Member

@vinistock vinistock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, in our internal surveys it seems like devs would overwhelmingly prefer the focus to be preserved, so let's move forward with this.

@andyw8
Copy link
Contributor Author

andyw8 commented Jul 21, 2025

Re-opened as #3679

@andyw8 andyw8 closed this Jul 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

other Changes that aren't bugfixes, enhancements or breaking changes vscode This pull request should be included in the VS Code extension's release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants