Repository navigation
Fix repeated alt-buffer entry using the stale main viewport size - #20825
Merged
Dustin L. Howett (DHowett) merged 2 commits intoOct 23, 2026
Merged
Dustin L. Howett (DHowett) merged 2 commits into
Dustin L. Howett (DHowett) merged 2 commits into
Conversation
UseAlternateScreenBuffer sized the new alt buffer from _mutableViewport, which still holds the main-buffer size while the alt buffer is active: a resize in alt mode only updates _altBufferSize. A second ?1049h therefore rebuilt the alt buffer at the pre-resize size. Use the existing _GetMutableViewport() helper (added for GH#3493), which returns _altBufferSize while in the alt buffer. Adds a TerminalApiTest regression that resizes in alt mode and re-enters ?1049h.
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Leonard Hecker (lhecker)
approved these changes
Oct 20, 2026
Leonard Hecker (lhecker)
left a comment
Member
There was a problem hiding this comment.
The unit test is a bit verbose because it asserts on things that aren't relevant to what is being tested, but it's okay.
Thank you for the fix!
Member
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). 1 pipeline(s) were filtered out due to trigger conditions. |
Member
|
Huang-404-Q we are unable to merge your submission until you accept the Contributor License Agreement. |
Dustin L. Howett (DHowett)
requested changes
Oct 20, 2026
Dustin L. Howett (DHowett)
left a comment
Member
There was a problem hiding this comment.
plus the CLA.
Comment on lines
+247
to
+250
| // Use the live viewport: while the alt buffer is active, a resize only | ||
| // updates _altBufferSize, so _mutableViewport still holds the stale main | ||
| // size. A repeated ?1049h would otherwise rebuild the alt buffer at it. | ||
| _altBufferSize = _GetMutableViewport().Dimensions(); |
There was a problem hiding this comment.
Suggested change
| // Use the live viewport: while the alt buffer is active, a resize only | |
| // updates _altBufferSize, so _mutableViewport still holds the stale main | |
| // size. A repeated ?1049h would otherwise rebuild the alt buffer at it. | |
| _altBufferSize = _GetMutableViewport().Dimensions(); | |
| // Using the active viewport ensures that re-entering the alt buffer doesn't use the stale main viewport dimensions. | |
| _altBufferSize = _GetMutableViewport().Dimensions(); |
this comment reads like Claudish, and is unpleasant to the eyes
Comment on lines
+277
to
+278
| // A repeated ?1049h must rebuild the alt buffer at the live size, not the | ||
| // stale main-buffer viewport size. |
There was a problem hiding this comment.
Suggested change
| // A repeated ?1049h must rebuild the alt buffer at the live size, not the | |
| // stale main-buffer viewport size. | |
| // Activating the alternate screen buffer a second time must not change its size. |
Use the reviewer's wording for the source and test comments.
Member
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). 1 pipeline(s) were filtered out due to trigger conditions. |
Dustin L. Howett (DHowett)
approved these changes
Oct 23, 2026
Dustin L. Howett (DHowett)
enabled auto-merge (squash)
October 23, 2026 03:18
Dustin L. Howett (DHowett)
merged commit Oct 23, 2026
a4bb475
into
microsoft:main
18 of 20 checks passed
Mike Griese (zadjii-msft)
added a commit
that referenced
this pull request
Nov 24, 2026
commit 6a24d4231116aff834b84ef8f85f124cab7dd6ea Author: Mike Griese <[email protected]> Date: Tue Nov 24 10:10:53 2026 -0600 expander? commit 7b8881cfc51d916b4cda3fc18cb674321df4ae71 Merge: 04871be1b b5818d3d1 Author: Mike Griese <[email protected]> Date: Tue Nov 24 05:48:27 2026 -0600 Merge remote-tracking branch 'origin/main' into dev/migrie/toast-activity-velocity commit 04871be1b024412bc5b140391f4b1ad2ff720854 Author: Mike Griese <[email protected]> Date: Tue Nov 24 05:40:36 2026 -0600 Add velocity for this commit b5818d3d1539193b0dec105c116df120c92e103a Author: Mike Griese <[email protected]> Date: Mon Nov 23 17:40:35 2026 -0600 Don't clobber NewTerminalArgs settings when initializing a tab (#20810) #20328 added a call to `Tab::UpdateSettings` in `_InitializeTab` so that the tab header would pick up the window's `tabWidthMode` (previously done in `Tab::Initialize` via the global settings). HOWEVER, `UpdateSettings` also pushes profile-only settings into every pane, overwriting settings that came from `NewTerminalArgs` (e.g. CLI args like `--suppressApplicationTitle`, `--colorScheme`, etc). Instead, pass the window settings into `Tab::Initialize` and only update the header width there, like it was before #20328. Closes #20749 Related to #20751 commit 0da3e6e86b302f63751dd2ca9b343affbd80ee1a Author: Mike Griese <[email protected]> Date: Mon Nov 23 17:11:23 2026 -0600 Markdown pane: paste, don't sendinput (#20703) When we were pasting input from the markdown pane, we were using a `sendInput` command to send it to the other pane. That would send `\r` and `\n` as literal keypresses. And when those got to PowerShell, that would result in powershell seeing a `ctrl+enter`, and inserting lines _in reverse order_. If we instead use the paste handler, that takes care of all the newlines for us. AND it handles broadcasting too. stick this in a markdown doc at `c:\test.md` `````md hello world ``` write-host $pwd cd d:\dev\private ``` ``` write-host $pwd cd d:\dev\public ``` ````` and you'll need this ```json { "command": { "action": "splitPane", "type": "x-markdown" }, "id": "User.splitPane.markdownPane" }, ``` then open the pane from the command palette, open that doc up. * ✅ it pastes and runs correct in pwsh * ✅ it pastes and runs correct in cmd * ✅ it broadcast Closes: gods I'm sure I've talked about this with Pankaj in the past, cause it was an issue with Terminal Chat too, but I think we banished that issue to the shadow realm. commit 6112babeee12683fde88f47fb8b0028035f450e8 Author: Dustin L. Howett <[email protected]> Date: Mon Nov 23 15:12:41 2026 -0600 chore: update to TAEF 11.0.260925001 (#20946) commit 3b02371f883e6a07bc2d3c3ab52f14386e1ab882 Author: Dustin L. Howett <[email protected]> Date: Mon Nov 23 13:50:43 2026 -0600 Remove the Run-UnitTests workaround for UnitTests_SettingsModel (#20947) commit cf5e6bf22727a251aced8bc30491c87428a4e116 Author: Dustin L. Howett <[email protected]> Date: Fri Nov 20 19:20:36 2026 -0600 Prevent the Kitty/NULL VK tests from failing in non-I/O Window Stations (#20945) commit d61c5f920adbc27ae2ee41bd02dd4d5f846818ed Author: Dustin L. Howett <[email protected]> Date: Fri Nov 20 11:13:55 2026 -0600 ci: add a GitHub Actions-based version of our build system (#20938) Right now, it has no hooks for code signing. That could change. It builds Dev Release in all 3 architectures and produces all the packages. It also adds "audit mode" to the health check (!). The tests are now run in separate groups for UT, FT and Local Tests. This will allow us to re-run only the bit that failed. The build and test passes disable expensive logging, which speeds them up significantly. On failure, the test will always print the assertions that led to it failing, so it will not leave us flying blind. This build produces artifacts named `bin-*` which contain the build tree minus large PDBs and static libraries. They are only _really_ intended for consumption by later phases, and so they have a retention time of 1 day. The other artifacts like MSIX packages/bundles, portable ZIPs and NuGet packages are retained for longer. Having them easily accessible should help people (and us!) test the changes in a pull request more readily. Builds on #20930 and #20927 commit 92f2a771057116d4313a5f1ef7801d9e04902a85 Author: Dawson <[email protected]> Date: Thu Nov 19 20:24:14 2026 -0500 Ignore C0 and DEL while parsing DCS parameters (#20919) The `dcs param` state ignores BEL (`0x07`) and DEL (`0x7F`) and continues collecting parameters. [DEC ANSI parser state diagram](https://vt100.net/emu/dec_ansi_parser) Closes #20916 commit 89f534a40068cd7c274b95b7f3c3bfd980ca5116 Author: Dustin L. Howett <[email protected]> Date: Thu Nov 19 18:44:32 2026 -0600 Prevent a superfluous WM_ACTIVATE; save TSF cost on minimized windows (#20935) We believe that this code, which sent an activation message to the window on every startup, to have existed since Windows 2000. It likely worked around an issue caused by conhost living in csrss. Since we're a more normal application now, let's not do that. This prevents us from initializing TSF for minimized windows (even ones which should be active!) and saves us almost 100MB in commit and reference set costs in aggregate during Windows' performance gate measurements. commit 91223e18286852465e5c6151ba53df121a8106b9 Author: Dustin L. Howett <[email protected]> Date: Thu Nov 19 18:02:21 2026 -0600 TermControl: Remove the "hairpin" paste handler, consolidate string writers (#20155) This pull request rewrites how TermControl takes input from the outside world in a number of ways. First, it introduces a new API called `WriteInputString`, which replaces both `SendInput` and `PasteText`. Those functions all had terrible and confusing names and semantics, but all boiled down to some internal implementation details around what was stripped where and how we added the bracketed paste sequence for clipboard content. (For now, there is a duplicate `WriteInputStringWithoutBroadcast` which skips some of the loopy callback machinery; it is removed in #20165.) Then, it removes the entire `PasteFromClipboardEventArgs` and its "callback" machinery for requesting a paste-if-you-would-just-please-call-me-back from the hosting application. The connection is now 1:1: a control raises `PasteRequested`, and the host calls `WriteInputString(..., Clipboard)` to complete the transaction. This also necessitated changing how we compute whether a paste would have been bracketed for the purpose of displaying warning dialogs and emitting empty paste packets. Now we check the control that originated the event (which required us to change how bubbled events report their sender.) It might seem like I left weird stubs laying around. In the future: 1. `StringSent` can be totally removed, as paste _content_ handling is already part of the app layer and drag/drop handling will be soon. 2. `anyHasBracketedPaste` (and `anyHasUnbracketedPaste`) will grow to check every control in the "broadcast group" so that we warn appropriately when a paste will touch multiple controls in different encodings. These changes allow us to localize paste encoding behavior to the control (rather than e.g. firing `StringSent` with a bracketed paste sequence to be consumed by a control that has bracketed paste turned off) and improve broadcast without weaving new and expensive event handlers up and down through the stack. While doing this, I noticed that TSF composition doesn't get broadcasted... lol. commit 1a44d69fd8e34b71b2141ffc626e5d74eb2f44f8 Author: Dustin L. Howett <[email protected]> Date: Thu Nov 19 17:54:33 2026 -0600 restore renderer to not commit buffer when there's no dirty rects (#20934) A change in #20542 made it so that we would eagerly commit the text buffer to get the scratch row, even if we didn't have a composition _or_ anything to render. This resulted in a WPG Reference Set regression where every instance of conhost jumped uniformly in memory use, by a small amount. Related to MSFT-65296047 commit dc58ee8a5147f07f3dc0e85c3fc78f0c96671c2d Author: Dustin L. Howett <[email protected]> Date: Thu Nov 19 16:35:19 2026 -0600 conhost: Allow DECAC, OSC 4 to change window border and caption color (#20937) Pretty much what it says on the tin! commit b4bca3dfa4f0c2e74dd25957492047a51f9058e9 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed Nov 18 15:49:18 2026 -0600 Bump actions/add-to-project from 2.0.0 to 2.0.1 in the github-actions group (#20932) commit 66cfdd5ecf159cde82f8cb27c2756062da7296a3 Author: Dustin L. Howett <[email protected]> Date: Tue Nov 17 16:54:15 2026 -0600 Add support for producing an unsigned-installable MSIX (#20930) > As of Windows 11, you can install your app via PowerShell without > needing to sign your package. This feature is intended to make it > easier for you to quickly test your app. Don't use this feature to > distribute your app widely. https://learn.microsoft.com/windows/msix/package/unsigned-package By including a special OID in our publisher name, we become installable via `Add-AppxPackage -AllowUnsigned` (on Windows 11, as Admin.) So, we'll do that if you build with `/p:OpenConsoleBuildUnsignedPackage=true`. We'll also do it by default in CI builds to allow them to be tested in a packaged environment. commit 1019918e645c084fd00fc2d749235d0099f79e96 Author: Dustin L. Howett <[email protected]> Date: Tue Nov 17 16:30:29 2026 -0600 build: restore `OpenConsoleCleanPCH` to working order (#20927) This property enables a set of rules that cleans up pch headers and object files after linking. It's also been made to be much more targeted, rather than whacking every wildcard `*.pch` in the world. In a local test, our final build tree is 9GB, and it grows to 11GB at absolute most only while it's building. For obvious reasons, this only works on one-shot straight-through builds and will never be compatible with incremental builds. commit 4447e8ffe708715665585788a6e4d7f7a88f0a75 Author: Leonard Hecker <[email protected]> Date: Mon Nov 16 17:51:48 2026 +0100 Yet another PATHEXT filter change (#20923) Closes MSFT-65207585 commit f6de9e0618015def1c9dda5b82f9d3abf03eb799 Author: Leonard Hecker <[email protected]> Date: Wed Nov 11 19:58:49 2026 +0100 Fix a VT mouse release bug in #20756 (#20914) I broke #20756 with a refactor. This diff makes the issue fairly obvious. Closes #20630 commit 5f7dc283013152f89bfb76950515c33f45157ad7 Author: Leonard Hecker <[email protected]> Date: Mon Nov 9 22:32:21 2026 +0100 Can we have infinite scrollback? (#18290) Mom: We have infinite scrollback at home. Infinite scrollback at home: ...very much finite. How do you define "infinite" scrollback anyway? Does it entail downloading RAM? It's a mystery. So, this PR adds support for 1B rows of scrollback, because that's >600GB of memory, which makes it effectively unusable. But it's enough to have a lot of finity. Thanks to the raised limit, this PR sets the default history size from to 16Ki which is roughly 10MB of memory. The can be cut in half once we remove the charOffsets cache on each ROW. Related to #1410 ## Validation Steps Performed * Set scrollback to 1M lines * Dump 100MB of text and watch the RSS grow * Reflow the window (it lags a little) ✅ * Clear the buffer (it's fast) ✅ commit cbc857bdf7749981890c5b561ee44ea31948bfb1 Author: Leonard Hecker <[email protected]> Date: Sat Nov 7 00:21:25 2026 +0100 Decommit memory on cls (#20889) While the changes are complex, they are straightforward, except for one bit: The complete refactor of `ScrollRows`. The reason it became necessary is that moving the viewport to the top during `ClearScrollback` may wrap the source range across the buffer's end. VT/conhost scrolling keeps src/dst ranges within logical bounds, where choosing the copy direction is sufficient. For instance: Imagine we have physical rows `A B C` and I call `ScrollRows(2, 2, -2)` then this should result in `C, A, C`. However, the old logic would produce `C C C`, because it copies `2 (C) -> 0 (A)` and then `0 (A) -> 1 (B)`. By the time the 2nd copy runs, the contents of row A have already been overwritten by C. This is the classic difference between a `memmove` and a `scroll array`. `ScrollRows` has never been an actual scroll function. The name stems more from `ScrollConsoleScreenBuffer`, which turn refers to historical bit blit scrolling. Part of #18290 ## Validation Steps Performed * `cls` = memory use 📉 commit 188822fa51dba7e11b64801483f4909db5fd020a Author: Dustin L. Howett <[email protected]> Date: Mon Nov 2 12:52:10 2026 -0600 Localization Updates - resize overlay - 23:44:03 (#20869) Follows #20861. Co-authored-by: Console Service Bot <[email protected]> commit f472aa97c143e3491b01e822e5bae585441c5a98 Author: Mike Griese <[email protected]> Date: Mon Nov 2 11:35:54 2026 -0600 Fix the useAcrylicInTabRow flicker (#20881) This PR fixes the flicker in the tab row when you've got: ```jsonc { "showTabsInTitlebar": true, "useAcrylicInTabRow": true, "compatibility.enableUnfocusedAcrylic": true, "profiles": { "defaults": { "useAcrylic": true, "opacity": 80 } } } ``` For historical reference: - #10864 - merged **August 23, 2021.** Added `useAcrylicInTabRow`, with a separate tab-row brush hardcoded to `HostBackdrop`. - #11180 - merged **September 20, 2021.** Added transparent window backgrounds. This removed the XAML opaque backstop and enabled the later in-app acrylic approach. - #15923 - merged **September 7, 2023.** Added `compatibility.enableUnfocusedAcrylic`, defaulting to true, and switched `TermControl` to `Backdrop`. **It did not update the separate tab-row brush in `TerminalPage`**. This is when the bug showed up. We don't need a HWND to bounce foreground off of. We don't need to recycle brushes. We just need to know that we now support both HostBackdrop acrylic, XOR in-app Backdrop acrylic, and make sure to not try to use both at the same time. Closes #14384 Closes #20316 Closes #20293 Closes #19705 I'm out. commit 703ef7f969d90d3f7e132b9a5f51a8815e77d586 Author: Clint Rutkas <[email protected]> Date: Fri Oct 30 19:48:47 2026 +0000 Settings: make clickable SettingsCards support UIA Invoke (#20871) Caught while investigating something else. ButtonBase does not provide UIA access to the `Invoke` pattern. This PR moves SettingsCard to build on `Button` instead so that UIA can `Invoke` it. commit 95142e6ebfcbce21da27c3f7eb5b87e8abdb2555 Author: Clint Rutkas <[email protected]> Date: Thu Oct 29 17:59:52 2026 -0700 Wrap Settings delete confirmation flyouts instead of scrolling horizontally (#20868) We were clipping a flyout at 200% scalling. here is before and after screenshots. This affected a few other spots and we caught those. Closes #20577 commit ff3fb7b4239a4ecb64552b3d7ef0b6e76761249c Author: Leonard Hecker <[email protected]> Date: Fri Oct 30 00:45:03 2026 +0100 Conhost font sizing for AtlasEngine (#19905) This PR does 3 things: * Provide a way to combine AtlasEngine's support for font sizes with GdiEngine's use of cell sizes (it doesn't support font sizes at all) * Fix the DIP roundtrip issues in conhost due to float -> int casts * Fix the roundtrip issues due to desired font -> actual font -> desired font feedback loops; it now uses the desired font permanently for settings, DPI changes, etc Breaking changes: * `GetCurrentConsoleFont(Ex)` now report the desired (configured) font settings instead of the actual ones. This better matches modern behavior with font fallback etc. I expect this to break some applications, although I cannot imagine why it would. * TrueType fonts won't store a width value in the registry anymore Totally works. Just trust me bro. This PR doesn't yet include the logic to hook it up to Windows Terminal. It's just for that new inbox conhost renderer. Huh what? Who said that! ## Validation Steps Performed * Settings store X=0 for TrueType font sizes ⚠️ (intentional!) * Ctrl+Scroll font sizing tracks GdiEngine relatively closely ✅ * Probably? Fixes all of the conhost font size roundtrip issues ✅ commit 3c47a05b4cb53948552abd2026444c5a2f76f552 Author: Dustin L. Howett <[email protected]> Date: Thu Oct 29 13:51:57 2026 -0500 build: move to ESRP 6, which does not use deprecated node 16 (#20867) Build fails otherwise! commit 533408607aa0c9cf1d9bf1f2dda6497bb073f80c Author: Leonard Hecker <[email protected]> Date: Thu Oct 29 19:13:47 2026 +0100 Add support for UTF8 encoded file URIs (#20809) Aside from illegally using `URL_UNESCAPE_AS_UTF8`, this PR fixes: * `get_strong` for the async `_OpenHyperlinkHandler` * `PATHEXT=".exe;;.bat"` would allow any file, because `""` is the suffix of any string * `SEE_MASK_FLAG_NO_UI` + error handling for `ShellExecute` ``"`e]8;;file:///C:/../%E4%B8%AD%E6%96%87.txt`alink`e]8;;`a"`` will now open by clicking on the link (if `中文.txt` exists). If it doesn't exist, you'll now see a nice "The system cannot find the file specified." error dialog. Closes #20803 commit 09beddc62315b7eb9e63949252102c4e9b431929 Author: Nakul <[email protected]> Date: Thu Oct 29 05:26:08 2026 +0530 Allow users to disable the new resize indicator (#20861) Adds a `showResizeOverlay` setting so the size overlay shown while resizing can be turned off. It's on by default, and there's a toggle for it on the Interaction page in the settings UI. Closes #20694 commit f3560938b2924bb6dc1bcaac8738b438ead10523 Author: Leonard Hecker <[email protected]> Date: Wed Oct 28 15:14:11 2026 +0100 Prevent ConPTY from mangling newlines after LNM (#20863) The reason the repro works is because `printf` does line buffering. So, `echo -e '\e[20h\n\e[20lone\ntwo\nthree'` enables LNM and flushes. Then, the next chunk starts with `disableNewlineTranslation = false` from the previous write. Even if this chunk disables LNM, ConPTY still used to translate `one\n` to `one\r\n`. Closes #20845 commit c91793f7dc022f1a10cacdc7a228ddce63942dc8 Author: Leonard Hecker <[email protected]> Date: Tue Oct 27 23:58:39 2026 +0100 Fix a WriteCharsLegacy deadlock (#20862) The line wrapping check was busted. This new code is a 1:1 copy from `AdaptDispatch::_WriteToBuffer`. Closes #20693 commit b69f4c623bf5406774ffe51515dcb1190ca5fb70 Author: Dustin L. Howett <[email protected]> Date: Tue Oct 27 11:33:09 2026 -0500 Localization Updates - Drag/Drop Tabs (#20844) Followup to #20394 Co-authored-by: Console Service Bot <[email protected]> commit a65cafae07502c3ce15f6765867fd05044b41f4d Author: Mike Griese <[email protected]> Date: Mon Oct 26 17:27:51 2026 -0500 Don't repositionCursorWithMouse while in Output (#20852) Welp this is kinda obvious in retrospect. The current check only checks that the cursor is after the last mark's `end`, which really only ensures that it's after a `Prompt`. It doesn't at all check that it's within a `Command`. If you have a bunch of output, well, that's all _after the prompt_. The braindead simple solution is just to make sure we only do the arrow key handling when we're actually in the `Command` state. We can't check that we're inside of the end of the command at this point, because we don't have that mark yet. Fixes #20846 Fixes #17803 ---- * Original implementation: #15758 * Mark-storage rewrite: #16937 * Follow-up fix: #17141 commit 2c65c836feb9bf524f3854ed55b9694d08c3a2e1 Author: Ivan Pešić <[email protected]> Date: Tue Oct 27 02:25:26 2026 +0400 Update sr-Cyrl-RS localization (#20851) Here is an update of the Serbian localization. commit 98c8c795ebc2560af55e72beba3fa5fd31ceef64 Author: Dustin L. Howett <[email protected]> Date: Fri Oct 23 06:25:45 2026 -0500 Reject OSC titles longer than 1000 characters, like xterm (#20839) I know that this seems short, but like. One thousand characters. In a title. Xterm (which I checked at version 398) rejects requests to set a title this long _outright,_ and does not truncate or elide any part of it. Closes #20838 commit a4bb4756fc606006e00ad627657d92934d974d2c Author: Huang-404-Q <[email protected]> Date: Fri Oct 23 11:55:19 2026 +0800 Prevent repeated alt buffer sequences from using the wrong size (#20825) `UseAlternateScreenBuffer` set the size of the new alt buffer from `_mutableViewport` (from the main buffer). Resizing while the alt buffer was open and requesting it again (which is already somewhat strange and should be a no-op...) would use the old size. Closes #20820 commit 21d1f1e61751b4bb760c2fd7b37aef7fd2e95171 Author: Leonard Hecker <[email protected]> Date: Fri Oct 23 05:27:01 2026 +0200 Fix several scrollbar issues in conhost (#20824) - Closes #19585, by always tracking the main buffer for scrollbar state, instead of letting `SIF_DISABLENOSCROLL` track it implicitly - Optimized scrollbar state on startup by setting its visibility eagerly - Fixed a transient full-height thumb on return from the alt buffer And a real zinger (decade old bug, basically): - Fixed a bug where the alt buffer doesn't resize if its size matches the main buffer (technically unrelated to scrollbars) commit 10630264af2c659ebfb25a1455eb5b6fe781d00f Author: Dustin L. Howett <[email protected]> Date: Thu Oct 22 09:07:09 2026 -0500 ci: run the Any CPU, WPF, ConPTY and MSIX bundle builds in CI (#20835) commit 1046205b04e5cc92dbaf9f93982aff6b80c565cc Author: Dustin L. Howett <[email protected]> Date: Tue Oct 20 18:53:23 2026 -0500 Rewrite HwndTerminal to build on ControlInteractivity and -Core (#20812) This pull request replaces all of HwndTerminal, which used to be a thin layer on top of TerminalCore.lib, with a new implementation that relies on the Interactivity and Core layers in TerminalControl.lib. We used to spend a lot of time reimplementing interactivity components for HwndTerminal or--if I'm being honest--letting it rot and never giving it the improvements the rest of the application got. Among those improvements: - Automatic scrolling finally works (as of #20710) - Selection works the same way as it does in Terminal proper (starts on the half-cell, uses an exclusive range) - Consistent double- and triple-click behavior without having to reimplement word- and line-wise expansion - Scroll wheel behavior - Shift+Click to suppress VT mouse mode - Scrolling and focus handling move down into the Win32 message loop from WPF This pull request seeks to get HwndTerminal back to where it was (plus the things we naturally get from switching over). In the future, we can more easily add: - title reporting (surprised we didn't have this) - clickable URLs - automatic copy-to-clipboard - right-click menu support - DTTERM window manipulation - shaders - Ctrl+Scroll zoom Implementation Details ---------------------- The WPF control is backed by a flat "C" API, which takes in a `void*` and does some stuff to it. We call that a `PTERM`. References to "Flat C" in this commit body describe the body of work below WPF. X-macros are used to fill out the definintions of every C API and bridge it to a properly typed C++ member function. Ugh. No more crap where we split the implementation into half C export and half C++ member. ControlCore and ControlInteractivity require something that looks like TerminalSettings. The WPF control only supports the most basic settings, in `struct TerminalTheme`, and so I've added a bridge WinRT type to adapt TerminalTheme to IXxxSettings. Most of the values it returns are our "defaults", and some of them are overridden. Core requires an `ITerminalConnection`, but the WPF API uses a pair of "write output" and "send input" callbacks. Flat C provides an ITerminalConnection that bridges those callbacks. It does not communicate connection state or anything else. Resizing is probably going to be a problem. Core requires a dispatcher queue to ensure that some operations happen on the UI thread. I have stubbed out an implementation of `IDispatcherQueue` that calls a couple function pointers with a context pointer; the WPF code hooks up to that and bridges it into the WPF dispatcher. Yes, the Core's dispatcher queue _is_ the WPF main UI thread. It has to be, otherwise we'll explode the first time we try to update the scroll bar. Prep work was done in #20713. To make the above easier, I removed all use of DispatcherTimer (see #20711). Attempts to use it will almost certainly cause the WPF control to implode. Core needed to be taught a couple tricks to start up targeting an HWND instead of a composition handle. See #20722 for more. Refs #20710 Refs #20711 Refs #20713 Refs #20722 Required #20721 Refs #20745 Related to #6999 commit 9e6cf223ddb7d62eba85254ed88f8e2d663a172e Author: Clint Dovholuk <[email protected]> Date: Mon Oct 19 18:17:23 2026 -0400 Add a setting to disable drag/drop (#20394) adds "interaction" setting to allow enable/disable of tab drag/drop/rearrange/tear Refs #15689 ## Validation Steps Performed - ran as "clint" and verified the interaction setting can be toggled on and drag/drop/tear works, and toggled off where it doesn't (gifs of both at the end) commit 3ba2464e0c7b8a40be6ae5f64bf4927b20bcbd6c Author: Dustin L. Howett <[email protected]> Date: Mon Oct 19 16:44:45 2026 -0500 build: move code format to a GH workflow, emit rich errors (#20822) This allows us to emit GitHub-native error messages which will appear in the Files view. See screenshots below. commit bba4b4b9d8cbc4a787fe7bdeea1d59caf11497a7 Author: Dustin L. Howett <[email protected]> Date: Mon Oct 19 13:58:31 2026 -0500 build: move the code format leg to VS 2026 (#20821) This should resolve the issue where we keep having to locally revert the `->` change. commit 6967ba1c0714a4fe1d10eec3fc062b216feb718e Author: Dustin L. Howett <[email protected]> Date: Mon Oct 19 11:32:56 2026 -0500 Allow the ScopedResourceLoader to load up without resources (#20811) Okay, so this is a very niche case. We want to light up TermControl in places where we cannot be certain there is a resources.pri. In Debug builds, we load up and check that all referenced resources are present. In Release, we don't. This prevents us from failing on startup when resources.pri is unavailable. _However,_ any code that tries to resolve a resource will crash later. This is taken as an acceptable risk, because it reveals programmer error. This will cause issues in the future if we want to add resource uses to the Core or Interactivity layers[^1]. In the future, we should either use MRT core (ew) or switch to MUI (ew) or do something else entirely for resources. [^1]: we have some right now, but they are only actually referenced by the XAML layer commit 6ec7b6561f1de6c8e368eddef4eb31f3e5e7f420 Author: Shrikar <[email protected]> Date: Mon Oct 19 21:31:32 2026 +0530 Don't encode a VK of 65535 when a key is unmapped by the current layout (#20800) Prevents us from incorrectly encoding `65535` into an input record when a character has no virtual key mapping in the active keyboard layout. - `VkKeyScanW` returns a signed `SHORT` `-1` on failure when the character does not exist in the active keyboard layout). - When injected characters without key-down/scan-code information (e.g. via VNC or remote inputs) passed through `SendCharEvent`, this caused .NET `Console.ReadKey()` to throw an unhandled `System.ArgumentOutOfRangeException: Console key values must be between 0 and 255 inclusive.` and crash PowerShell. Closes #20797 commit 9fd41b2baec77d25b8cfb584070d5998eab7df81 Author: PankajBhojwani <[email protected]> Date: Fri Oct 16 16:25:33 2026 -0700 Fix settings search for check box labels, add indexer properties (#20808) We have a bunch of edge cases in our settings that had to have manual accounting for in the settings search index or weren't being handled at all (controls being wrapped in stack panels, settings that shouldn't show up in the defaults profile but should for regular profiles, etc). This PR adds an xml namespace (which gets ignored at compile time) just for the purpose of telling our index generating script how various control elements should be treated. One of those properties is used to indicate which check box contains the label for a stack panel. commit 44b440bf043522ec06014b2cff30d0f52ca30b68 Author: Clint Rutkas <[email protected]> Date: Tue Oct 13 20:42:17 2026 +0000 schema: fix drift between profiles.schema.json and the settings model (#20785) We missed quite a few things. An LLM found them. commit 1e788820e029e161fcb09362b17374d057e35676 Author: Dustin L. Howett <[email protected]> Date: Tue Oct 13 12:59:57 2026 -0500 Fix OS build after ingesting e90f9a534cae (!17124121) (#20801) This also updates the git2git filter. commit e90f9a534cae047fccddacc1ee813a82929662d5 Author: Dustin L. Howett <[email protected]> Date: Mon Oct 12 15:12:55 2026 -0500 Banish the new Serialization slop test to the nega-verse (#20794) commit 0edb684b0cf3d741835520742411db95d3ef9aa2 Author: Clint Rutkas <[email protected]> Date: Mon Oct 12 18:23:46 2026 +0000 Migrate `warning.confirmCloseAllTabs` to `warning.confirmOnClose` (#20783) #20055 only migrated the old `confirmCloseAllTabs` key, but since #17933 we've written `warning.confirmCloseAllTabs`, so on 1.26 users who turned the close warning off get the dialog back. This migrates both names (`warning.confirmOnClose` still wins) and stops a `null` value from throwing and failing the whole settings load. Adds a regression test; SettingsModel tests pass (159/159). commit 73855686529709b4a842767ea056b6e50dfcb3ab Author: Dustin L. Howett <[email protected]> Date: Mon Oct 12 10:47:13 2026 -0500 Goodbye CLAUDE.md (#20786) No longer required. Begone, ad. commit 7d06b26f73ef4bcb78b56647c395251eeee4c2bc Author: Dustin L. Howett <[email protected]> Date: Fri Oct 9 13:01:56 2026 -0500 schema: fix persistedWindowLayout (#20770) So we somewhat whiffed this one. Refs #20765 commit 6676c6f938f7e98ad680f0cecedd3bafb6529734 Author: Windows Console Service Bot <[email protected]> Date: Wed Oct 7 22:46:25 2026 -0500 Localization Updates - experimental badge - 10/07/2026 03:04:58 (#20775) Co-authored-by: Console Service Bot <[email protected]> commit 099afa48ed0ae49e233a663c30a41dee09050990 Author: Dustin L. Howett <[email protected]> Date: Wed Oct 7 18:17:13 2026 -0500 cooked: properly tear down popups when we fail to parse user input (#20779) Throwing an exception all the way out of COOKED_READ_DATA::Read is deleterious for the health of the application. We fail to unbind the waiter and may leave a dangling pointer around for some applications (and for some NPC security researchers to think provides an EoP, but does not.) This also moves us away from std::stoi in the history pop-up path entirely. commit 5951f696540e662844d16d85d9dbb325e2a8d5f3 Author: Leonard Hecker <[email protected]> Date: Thu Oct 8 01:16:58 2026 +0200 Fix several ScrollConsoleScreenBuffer ConPTY issues (#20774) - Fixed #20772 by fully committing to lazy DA1 capabilities path via `VtIo::SetDeviceAttributes`. It accidentally only did so with enabled cursor inheritance before. - Fixed #20773 by fixing the source/destination rectangle alignment in the non-DECCRA path of `ScrollConsoleScreenBuffer`. Also closes MSFT-64450466. As a drive-by: - Fixed the DECCRA path not restoring cursor attributes in conhost. - Reduced memory use in the non-DECCRA path. - Added a `IL/DL` sequence fast-pass for `ScrollConsoleScreenBuffer`. - Fixed a broken bounds checks in `Read/WriteConsoleOutputWImplHelper`. - Fixed the TraceLogging definition for `SMALL_RECT`. commit 767f832d263769c9d2cafd244e7a2292849112cb Author: Dustin L. Howett <[email protected]> Date: Wed Oct 7 18:12:45 2026 -0500 Remove ControlInteractivity and ControlCore from TermControl API (#20745) Consumers have no need to know about these, and can instead deal with a new opaque `IContentHandle`. Exposing them offered too much latitude to do the "wrong thing" with TermControl's constituent types. Even _if_ we were doing something cross-process, the upper layer doesn't need to use our implementation details. In doing this, I've also removed the unused Content::Attached event. commit aba31713b5d1184c441c21912d67f1eb0ee35e17 Author: TheJesper <[email protected]> Date: Thu Oct 8 01:11:16 2026 +0200 Preserve ENHANCED_KEY for direct key events (Alt up, F7 down) (#20619) Our window message intercepts Alt key-up (and F7 key-down) to handle them before XAML messes them up. These events get forwarded through IDirectKeyListener, but the ENHANCED_KEY bit from `lParam` was being lost. Verified manually. Closes #18120 commit d2fac6ef8be1e5a6e6e7da5f0d371d6273d0fc92 Author: Dustin L. Howett <[email protected]> Date: Wed Oct 7 17:32:55 2026 -0500 Go back to using implementation types in TermControl (#20721) This reverts a large part of #10051 and moves us back to using the native `implementation`-namespace types from TermControl to talk to ControlInteractivity and ControlCore. I started down this rabbit hole because I was trying to get rid of InteractivityAutomationPeer, and I learned that we introduced it as a go-between for the process-split TermControl/Interactivity. InteractviityAutomationPeer is not required, and removing it lets us get rid of some other mild annoyances: - We don't need to _push_ the bounds of the control down into Interactivity any longer - Likewise for padding Bounds and padding can simply be read directly from the control. I also undid the move from HANDLE to uint64_t which was only required for projecting HANDLEs. The only thing we risked losing out on was automatic event revokers, but this pull request adds `winrt::auto_revoke` support directly to `til::event`. It is suitably terrifying. It is certainly UB. commit 2d417e4eda7f79bc56fd362cf61813db68a9ddbd Author: Leonard Hecker <[email protected]> Date: Thu Oct 8 00:27:02 2026 +0200 Minor improvements to til::parse_(un)signed (#20778) * Allow an explicit `+` prefix like other parsers * Reject invalid bases * Fix UB during `uint64_t` -> `T` cast in `parse_signed` commit 35f29bd3164410cd6b1e2083df5642a67762633b Author: PankajBhojwani <[email protected]> Date: Tue Oct 6 10:57:21 2026 -0700 Add an experimental badge in the SUI for experimental settings (#20748) For experimental settings, display a bright yellow badge next to it. So, as part of this, removed "experimental" from the descriptions since the badge is indicating that already. Closes #20687 commit b7752edc5252d2a303a5eed6f15ce50862d29e17 Author: Leonard Hecker <[email protected]> Date: Tue Oct 6 19:56:34 2026 +0200 Restore KKP flags when disabling ASB (#20768) `_kittyFlags` represents the current buffer flags. When you enable the ASB, we reset `_kittyFlags` to 0. When you disable the ASB, we restore the flags from the `_kittyMainStack`. Boom, broken. We never pushed anything into the `_kittyMainStack` in the first place. The gets rid of `_kittyFlags`. To make it neat, I also replaced the heap vector with a static array + length. Closes #20763 commit 72e7b0630c9d395a2909de45e3c37f16f68c156b Author: Leonard Hecker <[email protected]> Date: Tue Oct 6 16:31:19 2026 +0200 Avoid loading keyboard layouts for KKP US mappings (#20769) Replaces `LoadKeyboardLayoutW` with a static LUT. No more random US keyboards in your language picker. Closes #20761 commit 805068781c6fed71ef6e2ac85f759e37b954449b Author: PankajBhojwani <[email protected]> Date: Mon Oct 5 16:53:17 2026 -0700 Add automation name for the delete shortcut button (#20767) It didn't have one before, so screen readers were just reading out "button". This commit fixes that, screen readers now read out "delete shortcut button" Closes #20601 commit 159bda66f62e51ef248046901cfa8a2412dcb5ed Author: OmarMashal <[email protected]> Date: Tue Oct 6 02:28:55 2026 +0300 Suppress VT mouse release for Ctrl+click on OSC 8 hyperlinks (#20756) Fixes the unmatched VT mouse release sent when Ctrl+clicking an OSC 8 hyperlink. Closes #20630 Co-authored-by: Leonard Hecker <[email protected]> commit 2b5336c1fca1e53ceeaac09710a13c478938cc8d Author: Windows Console Service Bot <[email protected]> Date: Wed Sep 30 16:53:17 2026 -0500 Localization Updates - main - 09/30/2026 21:12:36 (#20752) Co-authored-by: Console Service Bot <[email protected]> commit e289c45d96657eb4af7058d672206d269f2373b4 Author: Dustin L. Howett <[email protected]> Date: Wed Sep 30 15:16:20 2026 -0500 Revert "Fix PGO tests (#20560)" (#20750) This reverts commit 1507c465248f37e7bfc02682284d28483f17b654. The root cause of the PGO failure is documented in #20749. Also, the PR #20560 didn't actually _fix_ them. :P Note that this DOES NOT FIX the PGO build. commit 4e2b8bd9264642475d1398c11a5fd2aba06f373e Author: Sebastien Tardif <[email protected]> Date: Tue Sep 29 17:14:35 2026 -0700 Only open File Explorer from OpenCWD when CWD is a real directory (#20697) OpenCWD now no-ops unless the terminal working directory is an existing directory, then opens that folder. It no longer passes the raw OSC string to `explorer.exe` as parameters. Refs #12859 (the original action asked to do nothing when no CWD is set) OpenCWD was introduced in #18013. `ControlCore::OpenCWD` is the command-palette action `Terminal.OpenCWD`. It used: ```cpp ShellExecute(nullptr, nullptr, L"explorer", workingDirectory.c_str(), nullptr, SW_SHOW); ``` The working-directory string comes from OSC 7 (`file:` URI, then `PathCreateFromUrlW`) or OSC 9;9. Both only require `til::is_legal_path`, which allows `:` and `/`. So a remote host can set CWD to `https://example.com`, `shell:...`, or `/select,...`. Invoking Open CWD then ran Explorer with that text as `lpParameters`. Duplicate-tab and related paths already call `Utils::IsValidDirectory` before trusting this string (`TerminalPage.cpp`, `TerminalPaneContent.cpp`). Open CWD now does the same, then `ShellExecute`s the directory path as `lpFile` so Explorer switches cannot be supplied as parameters. If the CWD is empty or not a directory, the action does nothing. commit a3c89e64a47e091da5c6fbd1a1c1b5e31c7a96f6 Author: Dustin L. Howett <[email protected]> Date: Tue Sep 29 18:39:10 2026 -0500 Move AutoScroll down into Interactivity with a render timer (#20710) This pull request builds on the render timer infrastructure in #19330 and the pointer ID work in #20017 to move automatic scrolling down into the Interactivity layer. Leonard tells me that this is an acceptable use of the render timer infrastructure because it directly results in a new frame or new content being rendered (therefore, it does not spin the renderer for no reason.) Much of the code is the same. I recommend reviewing with: ``` git diff --color-moved=dimmed-zebra --color-moved-ws=ignore-all-space (git merge-base origin/main origin/dev/duhowett/wpf-1-autoscroll-to-interactivity) origin/dev/duhowett/wpf-1-autoscroll-to-interactivity ``` commit fc218b6fb1edd4a78afb75da64b55eedab2e6fd3 Author: Dustin L. Howett <[email protected]> Date: Tue Sep 29 18:18:19 2026 -0500 version: bump to 1.27 on main (#20744) commit 456c3a8ce8e83c9baf8becee3de08968b1c1a227 Author: PankajBhojwani <[email protected]> Date: Tue Sep 29 15:09:47 2026 -0700 Display reason for launch at login setting being disabled by OS setting (#20743) Closes #20685 commit 8f2412ae3374bc2ae6344faace8084a773936fda Author: OmarMashal <[email protected]> Date: Tue Sep 29 21:46:46 2026 +0300 Always open duplicated tabs next to source tab (#20565) Closes #20355 Co-authored-by: Leonard Hecker <[email protected]> commit f1ddcbe4df3d0cf77c9de981e7ae766295ce584e Author: 盗天叔叔 <[email protected]> Date: Tue Sep 29 22:43:13 2026 +0800 Fix broken links (#20699) commit 0626dc145717313435965eb4f3b0aff5a4cd7df5 Author: Leonard Hecker <[email protected]> Date: Mon Sep 28 17:11:15 2026 +0200 Fix 5s lags when using OSC 52 clipboard copy (#20728) Hilarious repro: `printf "\e]0;A\a\e]52;c;Qg==\a"` This issue is exactly what happens when you Ctrl+X in a clean file in msedit and it freezes Windows Terminal. It's because it puts a "•" in the title and copies the text. It triggers a title and clipboard change in the same frame which causes the UI and VT thread to deadlock trying to get the console lock. commit bb0541e7a972a1f9e39318c1f6b4e70347a86696 Author: Dustin L. Howett <[email protected]> Date: Sat Sep 26 18:52:30 2026 -0500 Move MIDI audio timer off Dispatcher to a threadpool (#20711) The MIDI audio cancellation handler doesn't really need to run on the UI thread, and this breaks our dependency on DispatcherTimer. commit fda72a070905570cd44e022658c7b9d1ee89322a Author: Leonard Hecker <[email protected]> Date: Sat Sep 26 02:59:39 2026 +0200 Fix several Present issues in AtlasEngine (#20723) * D3D uses deferred execution where render commands are collected as descriptors in a ring buffer before they're sent off to the GPU. When you don't call `Flush()` (or `Present()` which implies `Flush()`) it'll fill up 100s of MB of memory rapidly. This PR solves it in two ways: * Call `Flush()` whenever we can't call `Present()` * Make calling `Flush()` unnecessary by checking if we need to render anything in the first place. * This immediately results in an issue: Not rendering means the frame latency waitable object yields immediately (because we can't wait on it twice). The solution is to wait 16ms before trying again. * If the display is off, DWM will not deque frames. `Present1()` will indicate this (`DXGI_STATUS_OCCLUDED`) but it's not a failure so we don't handle it. Because of this we'll fill the queue to its maximum (64 frames). Once the display is on again, DWM will deque at V-Sync rate, but since we render as fast as the frame latency waitable object, also signaled at V-Sync rate, we'll push frames at the same rate they're dequeued, causing a 64-frame latency (~1.1s at 60Hz). `SetMaximumFrameLatency(1)` doesn't change this. The solution is that we don't limit waiting on the frame latency waitable object to just 100ms, but `INFINITE`. * Since that fix causes the renderer to wait potentially forever, a mechanism to cancel waits on shutdown is necessary. This also uncovered a flaw in the current design, wherein it blocks the UI thread for up to 100ms every time you close or move a tab on a low frame rate (or no active) display. Closes #20226 Closes #20342 Closes #20716 ## Validation Steps Performed * Continuously render, scroll up -> no GPU use ✅ commit f823ca2ef67b6b74b7c8ddf07a8e38a49a5f9ff3 Author: Dustin L. Howett <[email protected]> Date: Fri Sep 25 18:33:57 2026 -0500 core, atlas: properly handle no-swapchain-handle situations (#20722) When ControlCore is set up to target an HWND, there will not be a swap chain handle. When there's not going to be a swap chain handle or a listener who cares about it, don't bother with the event registration (save memory on a useless object) and don't bother sending the event. Supersedes #20712 commit 0b94a7ea041a0b67f13ac281a645a82e077e4578 Author: Dustin L. Howett <[email protected]> Date: Tue Sep 22 17:38:33 2026 -0500 Core, Interactivity: allow our creator to provide a DispatcherQueue (#20713) This is in advance of the UWP/WPF unification work, where we need to provide a dispatcher from the WPF side. It should be a no-op today, but we could also move _loading_ the dispatcher up to TermControl (XAML). commit 60fbd9af8007b6d60c3bbfc39880bf330cf74581 Author: Dustin L. Howett <[email protected]> Date: Tue Sep 22 16:46:29 2026 -0500 build: include the attempt number on the log artifact (#20714) This prevents retry builds from failing because `logs-x64-Release` (or whatever) already exists. `build-platform-config` is not published if the prior steps fail, and furthermore its name is a contract with the later stages, so I've left it alone. commit 7c92ecd037476f957809d0813b14d8bc44bb071a Author: Windows Console Service Bot <[email protected]> Date: Thu Sep 17 22:43:32 2026 -0500 Localization Updates - Settings Expanders (#20690) Co-authored-by: Console Service Bot <[email protected]> commit 077f9cf5ecabf1645895702218b0e4e7c19ff22e Author: Dustin L. Howett <[email protected]> Date: Thu Sep 17 19:42:53 2026 -0500 build: add our ServiceTree ID to our loc submissions (#20695) commit 9694946ae22420a30691b7610c31f5723d9a5ff8 Author: Dustin L. Howett <[email protected]> Date: Tue Sep 15 19:45:53 2026 -0500 build: use the latest compiler *of the same version* (#20689) There is a bug in the MSVC Preview compiler v14.52. This fixes our CI failures and the broken exception handler for ConptyConnection. Closes #20677 commit c0c72e95f39ee7fe2c58fc4076e8840680c83029 Author: Carlos Zamora <[email protected]> Date: Tue Sep 15 15:55:42 2026 -0700 Update profile subpages (#20336) ## Summary of the Pull Request Updates the individual profile pages to include: - icons + settings expanders/cards - `SettingsResetButton`: a new "reset value" button - a new "unfocused appearance" subpage with its own preview (similar to default appearance) ## Detailed Description of the Pull Request / Additional comments - `IInheritableViewModel`: interface exposing `HasSetting()`, `ClearSetting()`, and `SettingOverrideSource()` - To help ensure that these are updated properly, a static assert was added that checks the number of profile settings. This is intended to be a tripwire to ensure future changes also update the reset buttons. - `Profiles_UnfocusedAppearance.h/cpp/idl/xaml`: the new unfocused appearance page - added helper functions `FormatAccessibleName()` and `ColorToHexString()` to deduplicate code that creates accessible names for SettingsExpanders across the entire SUI ## Validation Steps Performed - [X] settings search + deep link navigation - [X] "reset value" button - [X] accessibility pass with Narrator ## PR Checklist Related to #17000 --------- Co-authored-by: Dustin L. Howett <[email protected]> commit e4171cc2d8f068ef2a5a5d03801e776c5bdf2575 Author: Dustin L. Howett <[email protected]> Date: Tue Sep 15 17:55:32 2026 -0500 chore: Update to CppWinRT 3.0.260818 (#20679) commit e0a1636880227b8af07dad1f8ea975ae1f523acb Merge: 7ad592cd5 0319ece21 Author: Mike Griese <[email protected]> Date: Mon Sep 14 13:33:21 2026 -0500 Merge remote-tracking branch 'origin/main' into dev/migrie/toast-activity-velocity # Conflicts: # src/cascadia/TerminalApp/Tab.h # src/cascadia/TerminalControl/ControlCore.cpp commit 0319ece2192129e74edf27afb6bf8b25b157d111 Author: Windows Console Service Bot <[email protected]> Date: Mon Sep 14 12:15:33 2026 -0500 Localization Updates - main - Expander Groups, New Window (#20678) Closes #20671 Co-authored-by: Console Service Bot <[email protected]> commit dcfbcdd8639813994734ced60abec37474cb3ec7 Author: Mike Griese <[email protected]> Date: Fri Sep 11 20:48:21 2026 -0500 Add a new window entry to the workspace flyout (#20663) does what it says on the tin. Closes #20638 commit d17c5d91016bacb19cffedb790def0d49210f6ab Author: Dustin L. Howett <[email protected]> Date: Fri Sep 11 20:48:08 2026 -0500 sui: fix the Spacebar on things inside settings cards (#20665) Okay, so, every SettingsCard inherits from ButtonBase. ButtonBase has its own local KeyDown/KeyUp handler, which can prevent the event from being bubbled at all. Moving our key handling to our local KeyDown/KeyUp handler allows us to decide when to involve ButtonBase's handler, rather than allowing it to delegate to us. Incidentally, this is probably why the implementer had to use the PreviewKeyXxx events; it was the only other way to get a "say" before the button handled it itself. Closes #20657 (superseded) commit 58c0db948e1116592d11014027f23800a28ee700 Author: Carlos Zamora <[email protected]> Date: Fri Sep 11 18:47:42 2026 -0700 Add expander groups to settings UI (#20200) ## Summary of the Pull Request Adds expander groups throughout the entire settings UI (except Profiles pages) to group similar settings together. These expanders got an icon to help make them easier to find and navigate. There are also a few other changes that were folded into this PR: - "Appearance" page was renamed to "Personalization" - Move settings from "Rendering" page to "Compatibility" Those were done as a part of this PR for a holistic restructuring. Given that spacing has changed, the content also needs to be reviewed so that it looks right with this new structure (i.e. long help text should be reconsidered to be shorter). ## Validation Steps Performed Scenarios: - ensure all settings are in expanders - [x] Startup - [x] Interaction - [x] Personalization - [x] Compatibility - [x] settings search still works and deep links ## PR Checklist Related to #17000 commit 5520a75c4b34c808db1a2102fcd0dc164dd7f0ef Author: Dustin L. Howett <[email protected]> Date: Fri Sep 11 20:47:20 2026 -0500 build: remove stray dep/gsl include (#20664) commit e7a68df7b908c569f2eae6deab1ad375783c6847 Author: zhangxaochen <[email protected]> Date: Fri Sep 11 18:46:58 2026 -0700 Prevent panes from shrinking below 2x2 cells (#20564) Raise the visible terminal minimum from 1×1 cells to 2×2 cells so a pane or window can no longer reach a 1-column viewport (keyboard, mouse, `split-pane`, `wt --size`, `initialCols`/`initialRows`, or VT resize). This mitigates an issue where we hang when we display a 2-cell char in one cell. Refs: - j4james: 2×2 is the VT theoretical minimum (`DECSTBM` height ≥ 2, `DECSLRM` width ≥ 2). Verification: - Confirmed the hang on unpatched Dev (`WindowsTerminalDev`) and Store 1.24.11911 with `echo 音楽🎵测试` in view, then shrink the left pane to the stop. Closes #19996 Co-authored-by: Leonard Hecker <[email protected]> commit 19843c21778cebd5a726f3335362f1505620a22e Author: Sagar <[email protected]> Date: Sat Sep 12 07:15:40 2026 +0530 Show terminal size overlay during resize (#20059) Displays a centered overlay showing **columns × rows** when the terminal control is resized. The overlay auto-hides after 750ms. Closes #2833 Co-authored-by: sagarbhure-msft <[email protected]> Co-authored-by: Leonard Hecker <[email protected]> commit d3b8ed33e6ad2c4807970fae4fab22c82633fd67 Author: Leonard Hecker <[email protected]> Date: Fri Sep 11 02:24:53 2026 +0200 Introduce an AI Usage Policy (#20654) After quite a lot of deliberation today, I think this is how I would personally define it. I tried to keep it short and open to AI-use, but particularly restrictive to autonomous AI-use (= typically slop). commit 385c0c75f7f42a33c43f2508ecc8b7eb5d4f6a0d Author: Leonard Hecker <[email protected]> Date: Fri Sep 11 02:21:40 2026 +0200 Avoid window events during ASB (#20617) Important context: To make a window smaller programmatically, the win32 console APIs have since forever required you to * narrow the viewport * then narrow the buffer To make the window larger you had to * enlarge the buffer * then enlarge the viewport This is because a viewport had to fit into the buffer and vice versa. ConEmu was very popular in the past and used this to implement proper terminals around conhost. When WSL came along this resulted in a problem: It wants SIGWINCH-style notifications. And there are none on Windows. A long time ago, a hack was introduced that simply raised buffer size events on any viewport size changes. The problem: It was raised for _any_ viewport size changes. And it was also raised for ASB switching. Problema numero due: OpenSSH for WIndows is like WSL, but it has a severe bug: A SIGWINCH during a partial input read will corrupt the read and the other side will read either garbage or duplicate input. Well, we can fix that by just not raising buffer size events. It's very dangerous, because it may easily regress ConEmu (etc.). See: https://github.com/PowerShell/Win32-OpenSSH/issues/2275 Also: Fun fact, we've been ignoring `ENABLE_WINDOW_INPUT` since Windows 1607! No way fixing this breaks anything! /s So, this PR introduces two **regressions**: * `ENABLE_WINDOW_INPUT` is being respected again * `WINDOW_BUFFER_SIZE_EVENT` is not sent anymore when the viewport changes if VT mode disabled Changes: * Reintroduce support for `ENABLE_WINDOW_INPUT` * Coalesce buffer size events * Avoid such events when switching ASB on/off * Ensure we reliably raise the events for viewport size changes This is part of #281. ## Validation Steps Performed * Spawn OpenConsole * Run `ConEmuC64.exe -AUTOATTACH -GHWND=NEW` * Run `wsl -- bash` * Run `while stty size; do read -rt .05 ||:; done` * Narrowing the window reduces the WSL width ✅ * Widening the window increases the WSL width ✅ commit f65148b11ba959d3771b12643bf948b472311370 Author: arista-ms <[email protected]> Date: Thu Sep 10 17:13:50 2026 -0700 Fix indexed icon media resource resolution (#20572) Fixes indexed `.exe`, `.dll`, and `.lnk` profile icons being rejected during media resource validation. Regression from #19143. Restores the indexed icon behavior introduced by #14107 / #1504. ## Detailed Description Media resource validation currently checks the complete icon value, including its `,index` suffix, with `std::filesystem::exists`. For example, it checks for a file literally named `shell32.dll,210`, rejects the resource, and prevents `IconPathConverter` from extracting the requested icon. This change: - recognizes signed icon indexes for `.exe`, `.dll`, and `.lnk` resources; - validates and resolves the binary path without the index; - preserves the original index for `IconPathConverter`; - splits on the final comma so commas in directory and file names remain valid; - leaves non-icon media resources under strict whole-path validation. ## Validation Steps Performed - Built the full Debug x64 solution with the repository's standard `Invoke-OpenConsoleBuild` workflow. - Ran `SettingsModelUnitTests::MediaResourceTests::RealResolverIndexedIconPaths`. - Verified absolute, relative, environment-expanded, positive, negative, zero, malformed, and non-icon indexed paths. - Verified paths with commas in both directory names and file names, with and without an index. - Registered and launched the local Windows Terminal Dev package and visually confirmed an icon loaded from `oicons.dll,24`. Closes #20567 Co-authored-by: Aristide Apodaca Aragon <[email protected]> commit 65a6885cc8408a00d97642b6994958adc6c2c8b9 Author: Yexuan Xiao <[email protected]> Date: Fri Sep 11 07:55:11 2026 +0800 Disable GDI redirection bitmap to reduce memory usage (#20655) Background: https://github.com/microsoft/microsoft-ui-xaml/issues/11523 Disabling the GDI redirection surface saves approximately 6 MB of memory for a 1080p display and 32 MB for a 4K display (when the window fills the entire screen). This PR applies this optimization to the Windows Terminal window. Since the memory is not allocated by the application itself but by the DWM, there is no simple way to accurately measure and test it. I have manually tested all CreateWindowEx calls to ensure they are correct. commit edc36a82842e2fd4971a20b31fbaebd9f6c5caca Author: Carlos Zamora <[email protected]> Date: Thu Sep 10 16:54:12 2026 -0700 Fix query button in SUI search box (#20658) Fixes an issue where the query button in the SUI search box wouldn't do anything. This is because `SettingsSearchBox_QuerySubmitted()` was only doing work if a suggestion was chosen. Rather than creating a new page to just show the search results, I made it just invoke the currently selected item. Unfortunately, that means that we need to keep track of the selected item ourselves, but aside from that, it's a pretty small PR. I added `_NavigateToSearchResult()` to help deduplicate some code. ## Validation Steps Performed ✅ ignore "no results" placeholder ✅ fallback to top result if none are selected commit d605121e14e281a7d06a8d93bf9d3141ead7024a Author: Windows Console Service Bot <[email protected]> Date: Tue Sep 8 15:36:00 2026 -0500 Localization Updates - Expanders, Profiles, Actions, Input Service (#20582) Aggregated localization changes for #20215, #20633, #20199 and #20232. Co-authored-by: Console Service Bot <[email protected]> commit 04f525cb37bfc70e33c9d92ba45875b5a96bd14b Author: Leonard Hecker <[email protected]> Date: Tue Sep 8 21:55:17 2026 +0200 Add a note about HWND_MESSAGE (#20656) Forgot about this tidbit from #17829. commit eacba3e348be877ce98061e5811a6af91fb66cc8 Author: Carlos Zamora <[email protected]> Date: Tue Sep 8 08:09:20 2026 -0700 Convert NTM folder name expander to card (#20646) commit 093e49e29a9f806ff83025c49be5d0c970673b00 Author: Carlos Zamora <[email protected]> Date: Thu Sep 3 13:44:42 2026 -0700 Update styling of Actions page (#20215) ## Summary of the Pull Request Updates the Actions and Edit Action pages according to the mockups in #20036 + some iterations past that. Notable changes: - "Actions" --> "Shortcuts" - `KeyChordVisual`: new control to display the key bindings. Bound to a `KeyChord`. Inspired by PowerToys' implementation - Actions.xaml: - relatively thin entries for each shortcut - Actions can have multiple key chords associated with them. All of these are shown. - Edit button associated with each key chord. Clicking it allows you to immediately modify the key chord without navigating to the sub-page. Tooltip + automation properties constructed to make it more clear what these buttons do. - EditAction.xaml: - each action arg is represented in a settings card for consistent UI - shortcut type is the first/primary setting. Changing this updates the "additional customizations" section at the bottom - "key bindings" section enumerates all associated shortcuts and allows the user to modify them individually - "additional customizations" includes "shortcut name" to allow users to override the command palette representation. This also includes action args UI. ## Validation Steps Performed Scenarios: - Actions page: - [X] key chord visuals are legible - [X] edit button --> edit mode --> show key chord listener (and focus it) - [X] binding to an key chord that is in use shows a warning - [X] clicking on entry navigates to Edit Action page - [X] accessibility testing - Edit Action page: - [X] accessibility testing ## PR Checklist Related to #17000 commit 62711fd73ef9733fa83108bfa7cea22528d2dbb9 Author: Genki <[email protected]> Date: Wed Sep 2 08:35:30 2026 +0900 Report the IME caret rect relative to the client area (#20627) `TsfDataProvider::GetCursorPosition()` tells the IME where the composition is. It built that rectangle from `GetWindowRect()`, so while the window is maximized the rectangle sits above the actual caret by the height of the resize handle. The IME anchors the candidate window to that rectangle, so the candidate window ends up covering the text that is being composed. Use `ClientToScreen` instead of `GetWindowRect`, and use the composition scale rather than the window DPI. Closes #20318 commit b9587a051078952f91576b79630e0772186e5752 Author: Dustin L. Howett <[email protected]> Date: Tue Sep 1 17:07:10 2026 -0500 Add a comment explaining the basics to preschoolers (#20632) commit 86b31d0a3bf273c73b9e2a48c95b9825a7296189 Author: Dustin L. Howett <[email protected]> Date: Tue Sep 1 16:41:19 2026 -0500 Remove the Input Service warning and almost all traces of it (#20633) Closes #8697 commit e9a72b69ce92d8279e5f556de07d139ccb56342e Author: James Holderness <[email protected]> Date: Tue Sep 1 21:22:08 2026 +0100 Preserve the DRCS font when performing a soft reset (#20607) When the terminal performs a soft reset (`DECSTR`), we reinitialize the `TerminalOutput` class to reset the character set mappings, but in the process we lose the DRCS state that tracks whether there is a soft font available. A similar problem occurs when restoring the cursor state with the `DECRC` sequence. This PR updates the `TerminalOutput` class's soft reset and restore implementations to fix these issues. ## References and Relevant Issues The original DRCS support was added in PR #10011. The soft reset of the character sets was changed in PR #16547, but as far as I can tell this would have already been broken in the initial implementation. ## Detailed Description of the Pull Request / Additional comments I realized I could simplify the issue, by first reimplementing the `SoftReset` method as a call to `Restore` with a fresh instance of the class (although initialized with the active GR translation state, since we don't want to lose that either). It then becomes the responsibi…
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
UseAlternateScreenBuffersized the new alt buffer from_mutableViewport, which still holds the main-buffer size while the alt buffer is active: a resize in alt mode only updates_altBufferSize. A second?1049htherefore rebuilt the alt buffer at the pre-resize size.Use the existing
_GetMutableViewport()helper (added for GH#3493), which returns_altBufferSizewhile in the alt buffer.Fixes #20820.
Validation
Added
TerminalApiTest::RepeatedAltBufferEntryKeepsLiveSize: create 100x30, enter alt, resize to 120x40, re-enter?1049h, assert the buffer is 120x40.I could not build or run the test locally: Visual Studio/MSBuild is not installed on this machine. The change is a one-line use of an existing helper; CI should run
Terminal.Core.Unit.Tests.AI assistance
Tool(s) used: Claude Code
How you used it: the assistant read the code, wrote the fix and the test. A human reviewed the diff and takes responsibility for the change.