Skip to content

Show terminal size overlay (COLSxROWS) during resize (#2833)#20059

Open
sagarbhure-msft wants to merge 3 commits intomicrosoft:mainfrom
sagarbhure-msft:feature/resize-overlay
Open

Show terminal size overlay (COLSxROWS) during resize (#2833)#20059
sagarbhure-msft wants to merge 3 commits intomicrosoft:mainfrom
sagarbhure-msft:feature/resize-overlay

Conversation

@sagarbhure-msft
Copy link
Copy Markdown
Contributor

@sagarbhure-msft sagarbhure-msft commented Apr 3, 2026

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):

  • TermControl.xaml Centered ResizeOverlay Border with themed TextBlock
  • TermControl.cpp Show overlay in _SwapChainSizeChanged, auto-hide via SafeDispatcherTimer
  • ControlCore.cpp/h Added ViewWidth() (mirrors existing ViewHeight())

Design decisions:

  • Center placement (standard for modern terminals)
  • 750ms auto-hide
  • Themed with SystemControlBackgroundAltHighBrush + SystemAccentColor border

Validation Steps Performed

  • Resized window → overlay shows correct COLSxROWS
  • Auto-hides after ~750ms
  • Works with split panes
  • Themed correctly in light/dark modes
sdf

PR Checklist

  • Closes #xxx
  • Tests added/passed
  • Documentation updated
    • If checked, please file a pull request on our docs repo and link it here: #xxx
  • Schema updated (if necessary)

@microsoft-github-policy-service microsoft-github-policy-service bot added Issue-Task It's a feature request, but it doesn't really need a major design. Area-UserInterface Issues pertaining to the user interface of the Console or Terminal Product-Terminal The new Windows Terminal. labels Apr 3, 2026
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
Run Invoke-CodeFormat: reorder XAML attributes alphabetically
and normalize comment spacing per project style.
@DHowett
Copy link
Copy Markdown
Member

DHowett commented Apr 13, 2026

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-UserInterface Issues pertaining to the user interface of the Console or Terminal Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal. zBugBash-Consider

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Show terminal size when resizing the window

3 participants