Skip to content

Fix terminal not focusing when clicking blank space below inline chat widget - #334804

Merged
Megan Rogge (meganrogge) merged 4 commits into
microsoft:mainfrom
Chethan616:fix/terminal-chat-blank-space-focus
Nov 6, 2026
Merged

Megan Rogge (meganrogge) merged 4 commits into
microsoft:mainfrom
Chethan616:fix/terminal-chat-blank-space-focus

Conversation

@Chethan616

Copy link
Copy Markdown
Contributor

Fixes #333458

What's happening

The .terminal-inline-chat container is positioned absolutely with bottom: 0, while terminalChatWidget.ts also sets an inline top style to anchor it near the cursor. With height: auto and both top and bottom set, the container stretches to fill the whole gap instead of shrink-wrapping to the widget's actual content, leaving an invisible region below the visible widget that still captures clicks meant for the terminal.

Blank space below the terminal inline chat widget

Fix

Make the outer container transparent to pointer events and only re-enable them on the visible .inline-chat box, so clicks in the empty space fall through to the terminal underneath.

Testing

  • Reproduced on Windows: opened terminal inline chat, maximized the panel, clicked below the widget — document.activeElement stayed on <body>, terminal never focused
  • Applied the fix and repeated the same click — document.activeElement became the terminal's xterm-helper-textarea
  • Confirmed the widget's own input is still focusable/clickable after the fix (no regression)

… widget

The terminal-inline-chat container was stretched full height by CSS
top/bottom positioning, leaving empty space below the widget that
swallowed clicks meant for the terminal. Make the container
pointer-events: none and only re-enable them on the visible widget.

Fixes microsoft#333458
Copilot AI balanced review requested due to automatic review settings September 6, 2026 12:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@vs-code-engineering

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

Anthony Kim (@anthonykim1)

Matched files:

  • src/vs/workbench/contrib/terminalContrib/chat/browser/media/terminalChatWidget.css

@Chethan616

Copy link
Copy Markdown
Contributor Author

Hi Megan Rogge (@meganrogge) , just following up on this PR when you have a chance. The fix has been tested on Windows and addresses the terminal focus issue caused by the inline chat container capturing clicks in the blank area. Thanks!

@meganrogge Megan Rogge (meganrogge) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for the fix and the clear explanation!

@meganrogge
Megan Rogge (meganrogge) enabled auto-merge (squash) November 3, 2026 19:24
roblourens
roblourens previously approved these changes Nov 3, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Chethan Krishna (@Chethan616) please fix formatting:
[hygiene --changed-since ccf7045] src/vs/workbench/contrib/terminalContrib/chat/browser/media/terminalChatWidget.css(13,1): Bad whitespace indentation
[hygiene --changed-since ccf7045] src/vs/workbench/contrib/terminalContrib/chat/browser/media/terminalChatWidget.css(14,1): Bad whitespace indentation

Comment continuation lines used plain spaces instead of the
standard tab + asterisk block-comment style, which the
build/hygiene.ts whitespace check does not accept.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
auto-merge was automatically disabled November 5, 2026 09:41

Head branch was pushed to by a user without write access

@Chethan616

Copy link
Copy Markdown
Contributor Author

Hi Dmitriy Vasyura (@dmitrivMS), thanks for catching that. Fixed the indentation on both lines, the comment continuation was using plain spaces instead of the standard tab + asterisk block comment style used elsewhere in the file. Pushed the fix, should be clean now.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are reported for the terminal inline-chat click-handling change.

No open issues 🎉

Review effort: Max

@meganrogge
Megan Rogge (meganrogge) merged commit a51a16a into microsoft:main Nov 6, 2026
63 of 82 checks passed
@vs-code-engineering vs-code-engineering Bot added this to the 1.146.0 milestone Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Terminal doesn't focus if you click the blank space below a copilot terminal widget

6 participants