Skip to content

Fix tunnelProtocol context key always resolving to https on focus#325445

Merged
alexr00 merged 3 commits into
microsoft:mainfrom
UditDewan:fix-tunnel-protocol-context-key
Jul 14, 2026
Merged

Fix tunnelProtocol context key always resolving to https on focus#325445
alexr00 merged 3 commits into
microsoft:mainfrom
UditDewan:fix-tunnel-protocol-context-key

Conversation

@UditDewan

Copy link
Copy Markdown
Contributor

In the Ports view, onFocusChanged sets the tunnelProtocol context key with a ternary whose branches are both TunnelProtocol.Https, so the key reports https for every focused tunnel regardless of its actual protocol:

this.tunnelProtocolContext.set(item.protocol === TunnelProtocol.Https ? TunnelProtocol.Https : TunnelProtocol.Https);

This looks like a typo introduced in a414bf2 when the protocol handling was reworked. The context menu path (onContextMenu) sets the key from node.protocol directly, so right-click menus behave, but anything that reads tunnelProtocol after a plain focus or selection change (keybinding and menu when clauses, the HTTP/HTTPS toggle state in the Change Port Protocol submenu) sees https even for HTTP tunnels.

The fix makes the else branch return TunnelProtocol.Http, which matches the key's declared default and the intent of the original normalization.

Copilot AI review requested due to automatic review settings July 11, 2026 19:59

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.

@alexr00 alexr00 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you for the PR

@alexr00 alexr00 enabled auto-merge (squash) July 13, 2026 10:11
@alexr00 alexr00 merged commit fb5e582 into microsoft:main Jul 14, 2026
29 checks passed
@vs-code-engineering vs-code-engineering Bot added this to the 1.130.0 milestone Jul 14, 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.

4 participants