"Move Tab to New Window" context menu item uses focused tab #20261

Closed
opened 2026-01-31 07:08:24 +00:00 by claunia · 2 comments
Owner

Originally created by @DHowett on GitHub (Jul 20, 2023).

Originally assigned to: @zadjii-msft on GitHub.

Windows Terminal version

1.18

Windows build number

No response

Other Software

No response

Steps to reproduce

Have three tabs.

Focus tab A.

Right-click tab B.

Click "Move to new Window".

Expected Behavior

B moves to a new window.

Actual Behavior

A moves to a new window. lol.

Originally created by @DHowett on GitHub (Jul 20, 2023). Originally assigned to: @zadjii-msft on GitHub. ### Windows Terminal version 1.18 ### Windows build number _No response_ ### Other Software _No response_ ### Steps to reproduce Have three tabs. Focus tab A. Right-click tab B. Click "Move to new Window". ### Expected Behavior B moves to a new window. ### Actual Behavior A moves to a new window. _lol._
claunia added the Issue-BugIn-PRNeeds-Tag-FixProduct-TerminalArea-UserInterface labels 2026-01-31 07:08:24 +00:00
Author
Owner

@DHowett commented on GitHub (Jul 20, 2023):

We have encountered this issue in many different forms, for pretty much every context menu item! We may want to book time to officially and finally fix it, and RCA why we missed it again. 😄

@DHowett commented on GitHub (Jul 20, 2023): We have encountered this issue in many different forms, for pretty much every context menu item! We may want to book time to officially and finally fix it, and RCA why we missed it _again_. :smile:
Author
Owner

@zadjii-msft commented on GitHub (Jul 26, 2023):

I kinda reckon the "change the focused tab ; do something to the focused tab" pattern probably never worked.

@zadjii-msft commented on GitHub (Jul 26, 2023): * introduced in #15376 * `moveTabToNewWindowMenuItem.Click` raises a `tab->_MoveTabToNewWindowRequestedHandlers` * in `TabManagement`, we handle that in a lambda: `newTabImpl->MoveTabToNewWindowRequested(...)` * We handle it JUST like the search action! * `_SetFocusedTab`, then `_MoveTab` * no recent regression in `_SetFocusedTab`: https://github.com/microsoft/terminal/blame/d70794a24607e02313f101d727c01fa1974bdcc6/src/cascadia/TerminalApp/TabManagement.cpp#L740-L757 I kinda reckon the "change the focused tab ; do something to the focused tab" pattern probably never worked.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#20261