Skip to content

fix(resizePane): Mark as handled only when resize succeeds#20001

Open
nmurrell07 wants to merge 1 commit intomicrosoft:mainfrom
nmurrell07:fix-resizepane-handled-flag
Open

fix(resizePane): Mark as handled only when resize succeeds#20001
nmurrell07 wants to merge 1 commit intomicrosoft:mainfrom
nmurrell07:fix-resizepane-handled-flag

Conversation

@nmurrell07
Copy link
Copy Markdown

This fix addresses issue #19983 where resizePane actions unconditionally consume keystrokes even when no resize can occur.

The fix follows the same pattern used for moveFocus and swapPane fixes:

  • Changed Tab::ResizePane to return bool indicating success
  • Changed TerminalPage::_ResizePane to return bool from ResizePane
  • Updated _HandleResizePane to set args.Handled() based on whether resize succeeded

This allows the keychord to propagate to the terminal when no resize can occur, matching the behavior of moveFocus and swapPane (GH#6129).

This fix addresses issue microsoft#19983 where resizePane actions unconditionally
consume keystrokes even when no resize can occur.

The fix follows the same pattern used for moveFocus and swapPane fixes:
- Changed Tab::ResizePane to return bool indicating success
- Changed TerminalPage::_ResizePane to return bool from ResizePane
- Updated _HandleResizePane to set args.Handled() based on whether resize succeeded

This allows the keychord to propagate to the terminal when no resize can occur,
matching the behavior of moveFocus and swapPane (GH#6129).
@DHowett
Copy link
Copy Markdown
Member

DHowett commented Mar 20, 2026

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Copy Markdown
Member

@DHowett DHowett left a comment

Choose a reason for hiding this comment

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

looks good - thanks! merge will be blocked until you agree to the CLA of course.

@DHowett DHowett enabled auto-merge (squash) March 20, 2026 21:35
@nmurrell07
Copy link
Copy Markdown
Author

nmurrell07 commented Mar 21, 2026

@microsoft-github-policy-service agree

Comment on lines +2800 to 2801
return tabImpl->ResizePane(direction);
}
Copy link
Copy Markdown
Member

@carlos-zamora carlos-zamora Mar 23, 2026

Choose a reason for hiding this comment

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

Suggested change
return tabImpl->ResizePane(direction);
}
return tabImpl->ResizePane(direction);
}
return false;

CI pipeline is failing because this warning is treated as an error:

##[warning]src\cascadia\TerminalApp\TerminalPage.cpp(2802,0): Warning C4715: 'winrt::TerminalApp::implementation::TerminalPage::_ResizePane': not all control paths return a value

Simple fix. 😊

@DHowett
Copy link
Copy Markdown
Member

DHowett commented Mar 23, 2026

code format failed too -- suggesting the wrong line endings (perhaps on behalf of whatever tool was used to author this code)

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.

3 participants