Skip to content

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

Open
sagarbhure-msft wants to merge 1 commit intomicrosoft:mainfrom
sagarbhure-msft:feature/resize-overlay
Open

Show terminal size overlay (COLSxROWS) during resize (#2833)#20059
sagarbhure-msft wants to merge 1 commit 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)

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

Closes microsoft#2833
@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
const auto rows = coreImpl->ViewHeight();
if (cols > 0 && rows > 0)
{
ResizeOverlayText().Text(std::to_wstring(cols) + L" \u00D7 " + std::to_wstring(rows));
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.

nit: please prefer fmt::format over string concatenation

fmt::format(FMT_COMPILE(L"{0} \u00D7 {1}"), cols, rows)

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Show terminal size when resizing the window

2 participants