4816 Commits

Author SHA1 Message Date
Carlos Zamora
27aae1f245 Fix WindowRoot memory leak in SUI (#19826)
## Summary of the Pull Request
Fixes a memory leak for `IHostedInWindow` in the TerminalSettingsEditor.

The memory leak occurs from `MainPage` creating an object that stores
reference to back to `MainPage` as `IHostedInWindow`. With `IconPicker`
specifically, the cycle would look like `MainPage` --> `NewTabMenu` -->
`IconPicker` --> `MainPage`.

I've audited uses of `IHostedInWindow` in the TerminalSettingsEditor and
replaced them as weak references. I also checked areas that
`WindowRoot()` was called and added a null-check for safety.

## Validation Steps Performed
Verified `MainPage` and `NewTabMenu` dtors are called when the settings
UI closes from...
 Launch page (base case - it doesn't have an `IHostedInWindow`)
 New Tab Menu page
2026-02-03 14:25:25 -08:00
Dustin L. Howett
89d82638ab Use the version of clang-format that comes with Visual Studio (#19821)
This pull request also (necessarily) reformats the code to match the
current version.

Visual Studio 2022 17.14 comes with Clang 19's `clang-format`.
2026-02-02 13:45:11 -06:00
Carlos Zamora
a449899789 Add IconPicker to New Tab Menu folders in SUI (#19591)
## Summary of the Pull Request
This PR pulls out the icon picker used in Profiles_Base.xaml to be its
own control. Then it's reused as a way to set an icon on folders in the
new tab menu.

As a part of pulling out the icon picker into its own control, some
minor code-health polish was added (i.e. lazy loading icon types and
built in icons).

The new tab menu didn't have a `NavigateToPageArgs`, so I took the
declaration from #19519 and moved it here. I chose to do that instead of
creating a `NavigateToNewTabMenuArgs` since that's more strict and it
would be removed as a part of #19519 anyways.

Aside from that, the PR is pretty straightforward.

## References and Relevant Issues
Part of #18281

## Validation Steps Performed
- Profile icon picker
   - [x] set none
   - [x] set built-in icon
   - [x] set emoji
   - [x] set file
   - [x] loads icons properly (for all of the scenarios above)
- New tab menu folder icon picker
   - [x] set none
   - [x] set built-in icon
   - [x] set emoji
   - [x] set file
   - [x] loads icons properly (for all of the scenarios above)
2026-02-02 11:35:42 -08:00
Dustin L. Howett
cdf4bd9209 Revert "Disable PGO for nightly builds (#17749)" (#19816)
This reverts commit 408f3e2bfd.

Now that we have #19810, it works again!
2026-01-29 23:01:45 +00:00
Dustin L. Howett
8f3d1d8d01 build: make the PGO build work again; upgrade nuget (#19810)
Two main changes:

- the build was failing for ARM64 because the build agents run out of
memory downloading artifacts; this is a known issue that nobody cares to
fix (and it pertains to using the x64 emulated agent host on native
arm64 machines)
   - deleting the PDBs shrinks the build output by 2500MB :P
- we had to switch to a new type of identity for publishing nuget
packages to our cross-org feed

I've verified that we get counts _and_ can even produce final PGO count
packages for both architectures!
2026-01-29 12:44:36 -08:00
Dustin L. Howett
3ec372c176 vpack: ensure that we put the right version number in (#19793)
I just submitted a vpack to Windows and it turned out to be version
"0.0.5". Whoops.
2026-01-28 12:27:05 -06:00
Leonard Hecker
71409f84f7 Avoid scrolling when the search is open (#19775)
When text scrolls in and out of view, depending on the length
of the scrollback and latency of input, `GetSearchHighlightFocused`
would change which would trigger a `ScrollToSearchHighlight` call.

This PR changes the behavior such that only actively changing the
search mask triggers a search (typing text or pressing enter).

Closes #19754

## Validation Steps Performed
* Brining text in and out of view doesn't scroll 
* Toggling the aA button scrolls results into view 
2026-01-23 18:33:18 -06:00
PankajBhojwani
6723ca2239 Delete the KeyChordViewModel if we leave edit mode with no keys (#19778)
There was an issue where if the user adds a new keybinding and then hits
"cancel changes", the KeyChordViewModel is left in the keybinding list
with an empty value. Nothing gets saved to the json, but visually there
was an empty keychord box left behind. This commit fixes that.

## Validation Steps Performed
Adding a new keybinding and cancelling changes deletes the keybinding.
2026-01-23 18:25:43 -06:00
Vallabh Mahajan
c8549bebed sgr: consider ITU T.416 colors with color space 0 valid (#19768)
This PR fixes an issue where SGR color sequences containing a Color
Space ID of 0 (e.g., \e[38:2:0:r:g:bm) were incorrectly rejected as
invalid.

According to ITU T.416, the Color Space ID parameter is defined, and a
value of 0 is implementation-defined. It is widely accepted by other
terminal emulators (like XTerm) as the default RGB color space. This
change modifies the check to explicitly allow an ID of 0 while still
rejecting other non-standard IDs, ensuring compatibility with tools that
emit fully qualified T.416 sequences.

Closes #19547
2026-01-23 17:21:55 +00:00
William Zhang
8d94edd7b0 Dim the caption buttons for unfocused windows (#19668)
This PR closes #12632 by dimming the caption controls in the titlebar
when unfocused. Leaves them intact when in high contrast mode. The color
used is borrowed from PowerToys' unfocused color.

## Validation Steps Performed
Tested by hovering and unhovering in focused and unfocused states, as
well as in high contrast mode. States are consistent and applied
correctly. I did notice that clicking on the titlebar wouldn't put it
into focus unless I also moved my mouse though, but that is also present
in the release branch.

Closes #12632
2026-01-20 20:18:07 +00:00
Leonard Hecker
e8971c80ae Prevent RPC_E_CANTCALLOUT_ININPUTSYNCCALL during WM_SETTINGCHANGE (#19755)
Closes #19505
2026-01-19 11:56:53 -06:00
Dustin L. Howett
0ee3cfb3fd Protect more places against not having a XamlRoot (#19753)
We're seeing some crashes where we call `GetFocusedElement(null)`.

MSFT-54686865
MSFT-53824167
Possibly also #19751
2026-01-16 22:04:10 +00:00
Leonard Hecker
a528141fe6 Use smart pointers in coroutines (#19752)
After the coroutines resume, `this` may have already been destroyed.
So, this PR adds proper use of `get_weak/strong`.

Closes #19745
2026-01-16 15:43:30 -06:00
Leonard Hecker
c4557594ce Use til::hstring_format wherever possible (#19733)
A follow-up of #19721 which added `til::hstring_format`.
2026-01-16 15:04:49 -06:00
Windows Console Service Bot
04bcba39ae Localization Updates - main - 01/14/2026 03:04:07 (#19739)
Forward, backward, and search result narration.
2026-01-15 09:14:23 -08:00
Leonard Hecker
726c8f0cef Fix preview terminal cursor visibility (#19746)
Closes #19735
2026-01-15 10:58:25 -06:00
Dustin L. Howett
a0c79b59e6 Wrap window shutdown in a top-level exception handler (#19743) 2026-01-15 08:59:02 -06:00
KavishaHaswani
e9a8301e73 Fix initial position parsing from -pos tag (#19409)
## Summary of the Pull Request
Fixes #4247. Improves consistency in -pos tag parsing by supporting
single-value input for both axes.

## References and Relevant Issues
#4247

## Detailed Description of the Pull Request / Additional comments
The change aligns -pos behavior with padding-style logic. Existing
comma-separated behavior remains unchanged.
- A single value like "number" now sets both x and y positions to that
value — similar to how padding behaves.
- A value like "number," (with a trailing comma) continues to set only
x, leaving y unchanged.

## Validation Steps Performed
- Ran all unit and integration tests
- Added unit test to verify single-value and comma-separated inputs

## PR Checklist
- [x] Closes #4247
- [x] Tests added/passed
- [x] Documentation updated
https://github.com/MicrosoftDocs/terminal/pull/890

---------

Co-authored-by: Carlos Zamora <cazamor@microsoft.com>
2026-01-14 16:10:04 -08:00
Carlos Zamora
b668fd5188 Improve screen reader announcements for search box (#19726)
## Summary of the Pull Request
Improves the notification read out by a screen reader when a search is
done in the terminal. This is done across several scenarios:
- previously, the results were only read occasionally. Moving the block
out of `if (results.SearchInvalidated)` fixes that.
- previously, we read "Results found" or "No results found". Now, we
read an accessible version of the written status message.

In order to maintain consistency with the written status message,
`_FormatText()` now takes an `isAccessible` parameter to output a more
accessible version of the text. Specifically...
- `CurrentIndexTooHighStatus` (aka `?`) would not be read, so we replace
it with `TermControl_UnknownSearchResultIndex` (aka `unknown`)
- `TermControl_TooManySearchResults` (aka `999+`) would drop the `+`
when read, so we replace it with `TermControl_TooManySearchResults` (aka
`over 999`)
- `TermControl_NumResults` (aka `{0}/{1}``) would be read as a fraction,
so we replace it with `TermControl_NumResultsAccessible` (aka `{0} of
{1}`).

## Validation Steps Performed
 Announcements are read out when interacting with search box (i.e.
next, prev, regex toggle, etc.)
 "4 of 5" read out by screen reader (or something similar) when search
is performed

Closes #19691
2026-01-13 16:19:16 -08:00
Windows Console Service Bot
dfd11cf0cf Automatic Loc removal after #19613 (01/13/2026 03:06:05) (#19737)
Co-authored-by: Console Service Bot <consvc@microsoft.com>
Co-authored-by: Dustin L. Howett <dustin@howett.net>
2026-01-13 15:26:06 -08:00
Leonard Hecker
58f1f3b312 Remove TF_TMAE_UIELEMENTENABLEDONLY (#19738)
Closes #19670
Closes #19722
2026-01-13 13:59:59 -06:00
Andy
7f91e94f1a Add VSCode Dark Modern and Light Modern color schemes (#19728)
This adds both the Dark Modern and Light Modern color schemes from
VSCode to match issue #19162.

I pulled the colors directly from VSCode's terminalColorRegistry.ts for
accuracy. The existing Dark+ scheme uses the older terminal colors from
before VSCode introduced the Modern variants, so this gives users access
to the newer palette.

The Dark Modern background is #1F1F1F which is the actual color used in
VSCode currently, not #1E1E1E from the legacy theme. Light Modern uses
#FFFFFF background with #3B3B3B foreground text.

Tested locally in Windows Terminal and both schemes render correctly.
2026-01-12 22:28:47 +00:00
Aditya Pandey
691568195b Use theme tabRow color as acrylic tint (#19604) (#19622)
## Summary of the Pull Request
When `useAcrylicInTabRow` is enabled, the theme's `tabRow.background`
color is now used as the acrylic tint instead of being ignored.

## References and Relevant Issues
Fixes #19604

## Detailed Description of the Pull Request / Additional comments
Previously, the code had mutually exclusive branches for handling
`useAcrylicInTabRow` and theme `tabRow.background`. When acrylic was
enabled, the theme color was never evaluated.

This PR extracts the theme's tabRow color first, then uses it as the
acrylic tint if set, falling back to the default if no theme color is
specified.

## Validation Steps Performed
Tested with `useAcrylicInTabRow: true` and custom `tabRow.background` -
acrylic now shows the theme color as tint

## PR Checklist
Closes #19604
2026-01-12 22:26:54 +00:00
Vamsi Krishna Kanjeevaram
673d4eb497 Updated strings of "Move tab" commands to include "left" and "right" (#19708)
## Summary of the Pull Request
* As per the discussions in
[#19228](https://github.com/microsoft/terminal/issues/19228), updated
the command palette strings.
* Similar change is done for the strings used in Terminal settings
editor as well.

## PR Checklist
Closes #19228
2026-01-12 11:24:57 -08:00
Windows Console Service Bot
5c3e712040 Localization Updates for #19712 (#19716) 2026-01-12 12:24:45 -06:00
Dustin L. Howett
ec76951258 Clean up a bunch of unused localizations (#19613)
Well, they might be unused. A weird hacked-together PowerShell script I
wrote told me.
2026-01-12 10:22:22 -08:00
Leonard Hecker
c0debf8e26 Improve sixel performance (#19639)
Together with #19640 this bumps the performance on my HW by around 60%.
You can now stream 4K images at >60 FPS on a high-end CPU.

## Validation Steps Performed
* Used imagemagick to dump large images 
2026-01-12 14:05:33 +01:00
Dustin L. Howett
64caebecd3 build: fix the target names after the slnx switch (#19724)
It looks like the targets are named after their project _files_ rather
than their names now.
2026-01-08 23:26:14 +00:00
Leonard Hecker
3c2eb594a5 Set the vcpkg toolset to v143 (#19720)
This fixes building with the latest VS2026,
but it's probably a good idea regardless.
2026-01-07 20:27:18 -06:00
Leonard Hecker
d05dd85275 Fix a freeze when pasting lots of text (#19721)
WinUI doesn't react well to lots of text,
so this PR caps the max. amount shown.

Related to #9232
2026-01-07 18:03:49 -06:00
Carlos Zamora
3c1bfcb264 Add tooltips to SUI NavItems and color schemes (#19714)
## Summary of the Pull Request
There's a few places where the text gets (or can get) truncated. This
adds a tooltip to alleviate that issue. Areas in question are the nav
view items in the settings UI and the color schemes in the combo box for
profile > appearance.

## Validation Steps Performed
Tooltips appear for...
 nav items added in XAML file (i.e. global setting pages)
 nav items added dynamically (i.e. profile pages)
 color schemes in combo box

## PR Checklist
Closes #19698
Closes #19688

Sibling to PR #19715
2026-01-07 09:52:47 -08:00
Carlos Zamora
baab0eae05 Add AutoProp.Name to font features/axes controls (#19712)
## Summary of the Pull Request
Explicitly adds the Name automation property to the list view items (via
grid in data template), number boxes, and delete buttons for font
features and axes.

## Validation Steps Performed
Narrator can read out...
 list view items
 number boxes
 delete button
Also validated using accessibility insights

Closes #19695
Closes #19689
2026-01-07 00:11:02 +00:00
Leonard Hecker
8f418d10a6 Clean up SCREEN_INFORMATION even further (#19648)
A continuation of #19645. Maintainer modifications were disabled,
unfortunately.
2025-12-19 16:08:03 -06:00
Leonard Hecker
a79078924a Close the TermControl when closing a TerminalPaneContent (#19657)
This fixes an issue where calling close on a tab/pane won't
raise a StateChange notification on the connection.
2025-12-17 18:19:15 +00:00
Leonard Hecker
f321c30cc1 Use Char[] for Connection stdin (#19655)
This makes it possible to pass through non-null-terminated strings.
This is needed for the tmux control mode which passes string slices.
2025-12-17 17:25:26 +00:00
Leonard Hecker
aefacd6a12 Clean up til::event (#19654)
Dedupe the two structs by using a type alias.
Also cleans up the implicit bool operator, template args, etc.
2025-12-17 17:57:04 +01:00
Leonard Hecker
2f8c51e23d Standardize on Tab::Close for closing tabs (#19656)
This makes it possible to subscribe to `Close` events.
2025-12-17 17:53:41 +01:00
Leonard Hecker
a331c42d3c Prevent redundant SetWindowAssociatedProcesses calls (#19658)
This is just an idea. Tmux tabs don't have any associated processes,
so switching between them would raise debug logs all the time.
Not really an issue per se, so I'd be happy to just close this PR.
2025-12-17 17:50:32 +01:00
Leonard Hecker
5f6b814057 Improve performance of til::equals (#19653)
As explained in the added comment. Perf 📈.
2025-12-17 17:49:01 +01:00
Leonard Hecker
e707c100e7 Fix cursor blinking before being focused (#19652)
This affects the tmux control mode as it creates
many panes at once, without any involvement of WinUI.
2025-12-17 17:48:47 +01:00
Windows Console Service Bot
46ce47c095 Localization Updates - main - 12/10/2025 03:05:03 (#19638)
Co-authored-by: Console Service Bot <consvc@microsoft.com>
2025-12-16 16:34:12 -06:00
Suriya R V
fecd9087eb Refactor SCREEN_INFORMATION to use in-class initializers (#19645)
Related to #962
2025-12-16 14:41:07 +01:00
Serhii Pustovit
20cfb157f7 Added new localization - Ukrainian (#19554)
## Summary of the Pull Request

Added new localization for terminal and related code - Ukrainian.

## Detailed Description of the Pull Request / Additional comments

Based on `en-US` localization for terminal. Preserved formatting and
generic code style.

## Validation Steps Performed

## PR Checklist
- [x] Closes #19530
2025-12-11 23:57:52 +00:00
Carlos Zamora
96d35daeec Remove 'New' Badge from Extensions page (#19637)
It's no longer "new".
2025-12-10 12:05:49 -08:00
PankajBhojwani
297703d783 Allow editing actions in the settings UI (#18917)
The actions page now has a list of all the commands (default, user,
fragments etc) and clicking a command from that page brings you to an
"Edit action" page where you can fully view and edit both the action
type and any additional arguments.

## Detailed Description of the Pull Request / Additional comments
Actions View Model
* Added several new view models
* `CommandViewModel` (view model for a `Command`), a list of these is
created and managed by `ActionsViewModel`
* `ActionArgsViewModel` (view model for an `ActionArgs`), created and
managed by `CommandViewModel`
* `ArgWrapper` (view model for each individual argument inside an
`ActionArgs`), created and managed by `ActionArgsViewModel`

Actions page
* No longer a list of only keybindings, instead it is a list of every
command Terminal knows about

EditAction page
* New page that you get to by clicking a command from the Actions page
* Bound to a `CommandViewModel`
* Allows editing the type of shortcut action and the command name
* Depending on the shortcut action, displays a list of additional
arguments allowed for the command with the appropriate templating (bool
arguments are switches, flags are checkboxes etc)

Closes #19019
2025-12-09 15:42:54 -08:00
Dustin L. Howett
45c5370271 When the renderer fails, try to fall back to D2D + WARP; retry changes (#19636)
This commit also ups the number of render failures that are permissible
to 6 (one try plus 5 retries), and moves us to use an exponential
backoff rather than a simple geometric one.

It also suppresses the dialog box in case of present failures for Stable
users. I feel like the warning dialog should be used for something that
the user can actually do something about...

Closes #15601
Closes #18198
2025-12-09 22:52:27 +00:00
SEt
8bb831f628 Gracefully handle unavailable TSF from SYSTEM account (#19635)
When run from SYSTEM account TSF seems to be unavailable. The only
missing step to handle that is check during initialization.

Not sure if fail after partial success in `Implementation::Initialize`
should also be gracefully handled.

Closes #19634
2025-12-09 22:46:27 +00:00
Leonard Hecker
224ac9de47 Stop leaking CPR sequences (#19620)
Due to the `IsVtInputEnabled` early return, we'd skip
the `_captureNextCursorPositionReport` by accident.

Closes #19575
Closes #19609
2025-12-05 21:24:06 +00:00
Dustin L. Howett
7a7cdec91f Disallow fragments from containing UNC media paths (#19615)
Fragments are not allowed to declare web-source icons; this is equally
true for UNC paths in the local network (or WebDAV paths!)
2025-12-05 12:41:03 -08:00
Dustin L. Howett
c7c742c326 Typo fix: StarTimer->StartTimer (though it was funny) (#19617) 2025-12-04 15:28:17 -08:00