Show terminal size overlay (COLSxROWS) during resize (#2833)#20059
Show terminal size overlay (COLSxROWS) during resize (#2833)#20059sagarbhure-msft wants to merge 5 commits intomicrosoft:mainfrom
Conversation
Display a centered overlay showing columns x rows when the terminal control is resized. The overlay auto-hides after 750ms of inactivity. - Add ResizeOverlay Border element to TermControl.xaml - Add ViewWidth() to ControlCore (matches existing ViewHeight()) - Show overlay in _SwapChainSizeChanged using SafeDispatcherTimer - Use fmt::format for string formatting Closes microsoft#2833
aa7ea3a to
c7a51c9
Compare
Run Invoke-CodeFormat: reorder XAML attributes alphabetically and normalize comment spacing per project style.
|
I just downloaded the build artifacts to give this a try. Feels good! We may also want to show the indicator when the font size results in a change to the virtual size of the canvas; however, we probably do NOT want to do that in the one used for the preview in the Settings page. |
Show the resize overlay when Ctrl+Scroll changes font size and alters the grid dimensions. Extract overlay logic into _ShowResizeOverlay() helper called from both _SwapChainSizeChanged and _coreFontSizeChanged. Skip the overlay when the control is disabled (IsEnabled() == false), which is the case for the Settings page terminal preview.
Thanks for trying out! Overlay now also shows on font-size zoom. Skipped for the Settings preview via !IsEnabled() |
DHowett
left a comment
There was a problem hiding this comment.
I'm more than happy with this. Thank you!
DHowett
left a comment
There was a problem hiding this comment.
Additional issues discovered in use: the dimensions display every time you switch tabs or tear out a tab into a new window (?) possibly related to the font size being refreshed, probably even to the same value as before (not actually triggering a size change)
- Fix Tick handler lambda leak: initialize the timer and register the Tick handler only once on first use, then just restart the timer on subsequent calls (lhecker, DHowett) - Use std::optional<SafeDispatcherTimer> to defer initialization until first use (lhecker) - Remove _ShowResizeOverlay from _coreFontSizeChanged: the viewport dimensions are stale at that point because ControlCore still holds the write lock. The overlay will be shown by _SwapChainSizeChanged which fires after the resize completes with correct values (DHowett)
|
Can I get some eyes on this please @DHowett |
|
Hey... I appreciate what you are doing here, but I get the feeling that you are using some agentic coding workflows. Your commit message asserts that SwapChainSizeChanged is fired for font change events, and so your latest commit confidently removed the font size resize overlay. Now, the thing is. That's how it was before the team noticed that font sizes did not generate a resize event. Now that it's been removed, font size changes don't trigger a notification any longer. It's been undone, while the commit and your comments tell me it's working. At the same time, we still get a resize notification when switching tabs. I implore you to please apply critical thinking and test your changes to make sure they address the individual issues they say they do. Using an LLM here is fine, but you have to check its work, because it is a large-scale lying machine. |
Summary of the Pull Request
Displays a centered overlay showing columns × rows when the terminal control is resized. The overlay auto-hides after 750ms.
References and Relevant Issues
Closes #2833
Detailed Description
When the user resizes the Terminal window, a themed overlay appears at the center showing dimensions in COLS × ROWS format (e.g. 100 × 27). Matches Konsole, iTerm2, and GNOME Terminal.
Changes (5 files, 52 lines):
Design decisions:
Validation Steps Performed
PR Checklist