fix: prevent Terminal view from stealing focus after CLI command execution#195
Merged
Merged
Conversation
…ution Use IWorkbenchPage.VIEW_VISIBLE instead of the default VIEW_ACTIVATE when showing the Terminal view, so it does not steal focus from the Chat view after approving a terminal command in agent mode. Fixes microsoft#188
Contributor
There was a problem hiding this comment.
Pull request overview
This PR prevents the Eclipse Terminal view from taking focus during Copilot agent terminal command execution by switching Terminal view display calls to non-activating visibility mode.
Changes:
- Uses
IWorkbenchPage.VIEW_VISIBLEinstead of the default activatingshowView()behavior in both terminal implementations. - Applies the focus-preserving behavior to both modern Terminal and legacy TM Terminal integrations.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
com.microsoft.copilot.eclipse.ui.terminal/src/com/microsoft/copilot/eclipse/ui/terminal/RunInTerminalTool.java |
Updates modern Terminal view display calls to avoid activating the view. |
com.microsoft.copilot.eclipse.ui.terminal.tm/src/com/microsoft/copilot/eclipse/ui/terminal/tm/RunInTerminalTool.java |
Applies the same non-activating Terminal view behavior for legacy TM Terminal. |
Contributor
Author
|
@microsoft-github-policy-service agree |
jdneo
reviewed
May 15, 2026
jdneo
left a comment
Member
There was a problem hiding this comment.
Thank you for the contribution. Overall looks good to me, just one minor renaming issue.
…erminal The function no longer activates/focuses the view, so the old name was misleading. revealTerminal better reflects the updated behavior.
Contributor
Author
|
@jdneo Done, renamed to revealTerminal() in both implementations:) |
jdneo
approved these changes
May 15, 2026
jdneo
left a comment
Member
There was a problem hiding this comment.
LGTM. Thank you for your contribution.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
page.showView()was called with the defaultVIEW_ACTIVATEmode, which brought the Terminal view to the front and stole focus from the Chat viewgetTerminalControl()andbringTerminalViewAndCopilotConsoleToFront()in bothRunInTerminalToolimplementations to useIWorkbenchPage.VIEW_VISIBLEinstead, so the Terminal view is shown without stealing focusTest plan
echo hello world)