Have a way of actually knowing the geometry of the terminal #22370

Closed
opened 2026-01-31 08:11:11 +00:00 by claunia · 3 comments
Owner

Originally created by @steviator on GitHub (Oct 10, 2024).

Description of the new feature/enhancement

A method by which the size of the terminal in rows and columns could be determined after resizing the window or changing font size

Proposed technical implementation details (optional)

In every other terminal emulator that I have ever used going back to Windows 3.1 there has been some method of determining the Window size of the terminal in use, either by reading something like the title-bar, status bar or a pop-up that appears while resizing the window or by directly forcing the window to a desired geometry using escape codes like Unix, or a command like ms-dos MODE.

None of these methods work in Windows Terminal and to make matters worse, the window size remains the same if you change the font size, causing the window geometry to change to unknowable values.

For Microsoft to implement one or more of the many established ways of determining the size of a terminal, this isn't rocket surgery.

Examples:

  • A pop-up that states the window size in rows and columns while resizing
  • Optionally displaying the window size in the title
  • Supporting escape codes to set the window size in rows and columns
  • Supporting the same commands to set the window size as conhost.exe
  • Something new and great dreamed up by the Windows Terminal developers
Originally created by @steviator on GitHub (Oct 10, 2024). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> # Description of the new feature/enhancement A method by which the size of the terminal in rows and columns could be determined after resizing the window or changing font size <!-- A clear and concise description of what the problem is that the new feature would solve. Describe why and how a user would use this new functionality (if applicable). --> # Proposed technical implementation details (optional) In every other terminal emulator that I have ever used going back to Windows 3.1 there has been some method of determining the Window size of the terminal in use, either by reading something like the title-bar, status bar or a pop-up that appears while resizing the window or by directly forcing the window to a desired geometry using escape codes like Unix, or a command like ms-dos MODE. None of these methods work in Windows Terminal and to make matters worse, the window size remains the same if you change the font size, causing the window geometry to change to unknowable values. <!-- A clear and concise description of what you want to happen. --> For Microsoft to implement one or more of the many established ways of determining the size of a terminal, this isn't rocket surgery. Examples: * A pop-up that states the window size in rows and columns while resizing * Optionally displaying the window size in the title * Supporting escape codes to set the window size in rows and columns * Supporting the same commands to set the window size as conhost.exe * Something new and great dreamed up by the Windows Terminal developers
claunia added the Issue-FeatureResolution-Duplicate labels 2026-01-31 08:11:12 +00:00
Author
Owner

@j4james commented on GitHub (Oct 10, 2024):

A method by which the size of the terminal in rows and columns could be determined after resizing the window or changing font size

If you mean programmatically, you can query the size with a CSI 18 t escape sequence.

A pop-up that states the window size in rows and columns while resizing

This feature request is tracked in issue #2833.

Supporting escape codes to set the window size in rows and columns

Support for resizing with a CSI 8 t escape sequence was recently added in PR #17721. That functionality should be working in the nightly build. But note that it's only applicable when you have a single tab with a single pane. Other scenarios are tracked in issue #5094.

Supporting the same commands to set the window size as conhost.exe

That's also tracked in issue #5094.

@j4james commented on GitHub (Oct 10, 2024): > A method by which the size of the terminal in rows and columns could be determined after resizing the window or changing font size If you mean programmatically, you can query the size with a `CSI 18 t` escape sequence. > A pop-up that states the window size in rows and columns while resizing This feature request is tracked in issue #2833. > Supporting escape codes to set the window size in rows and columns Support for resizing with a `CSI 8 t` escape sequence was recently added in PR #17721. That functionality should be working in the nightly build. But note that it's only applicable when you have a single tab with a single pane. Other scenarios are tracked in issue #5094. > Supporting the same commands to set the window size as conhost.exe That's also tracked in issue #5094.
Author
Owner

@carlos-zamora commented on GitHub (Oct 16, 2024):

Thanks for filing! We'll mark this as a /dup of #2833. Thanks for looking into this @j4james 😊

@carlos-zamora commented on GitHub (Oct 16, 2024): Thanks for filing! We'll mark this as a /dup of #2833. Thanks for looking into this @j4james 😊
Author
Owner

@microsoft-github-policy-service[bot] commented on GitHub (Oct 16, 2024):

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@microsoft-github-policy-service[bot] commented on GitHub (Oct 16, 2024): Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report! <!-- Policy app identification https://img.shields.io/static/v1?label=PullRequestIssueManagement. -->
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#22370