Commit Graph

4805 Commits

Author SHA1 Message Date
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
Windows Console Service Bot
c4668d99b7 Localization Updates - fix ja-jp and fr-fr loc bugs - 12/04/2025 00:46:52 (#19616)
Closes #17191
Closes #18795
Closes #17827
2025-12-04 01:18:59 +00:00
Dustin L. Howett
a719970913 Run the LocalTests in CI (#15770)
It was very bad. We had to disable 14 failing tests.
2025-12-03 16:22:50 -06:00
Dustin L. Howett
20998f7628 Move LibraryResourceLoader to PCH (#19184)
It is foundational enough that everyone should have access by now.
2025-12-02 12:33:02 -08:00
Dustin L. Howett
3e29d2a316 Enable DECRQCRA at compile time for all Terminal builds (#19606)
Support for DECRQCRA Request Checksum of Rectangular Area was added in
#14989, but left disabled at build time because it could be considered a
security risk.

In #17895, we unconditionally added a toggle for it to Terminal's
settings UI and settings schema (`compatibility.allowDECRQCRA`). For
users on Stable and Preview, it didn't actually enable anything. Whoops.

Since we have a way to turn it off (and in so doing, mitigate the risk)
in Terminal, it's high time for us to remove the feature gating.

Conhost doesn't support turning it off for now and so conhost can still
have it compiled out, as a treat.
2025-12-02 12:25:07 -08:00
Dustin L. Howett
afb4752102 Tidy up some of our Velocity features (#19605)
A few features were marked "always disabled" and then enabled in dev,
canary and preview. I simplified those to "always enabled" and disabled
in release instead. This required changes to Generate-FeatureStaging to
make it consider `WindowsInbox` a Release branding (which, honestly, it
always should have been.)

- Feature_DynamicSSHProfiles
- Feature_ShellCompletions
- Feature_SaveSnippet
- Feature_QuickFix

Feature_DisableWebSourceIcons was deprecated in #19143, but the XML file
never got the memo.
2025-12-02 12:22:51 -08:00
Carlos Zamora
7f37fdd369 Fix dangling search selection using viewport pos (#19603)
## Summary of the Pull Request
Fixes a bug where the dangling selection from a search would be applied
to the wrong position. Specifically, the issue is that
`SetSelectionAnchor()` and `SetSelectionEnd()` expect viewport positions
whereas the searcher outputs buffer positions.

This PR simply applies the scroll offset to the search result before
calling the functions.

In a separate iteration, I changed the functions to allow for
viewport-relative vs buffer-relative positions. However, that ended up
feeling a bit odd because this is the only scenario where the functions
were receiving buffer-relative positions. I chose this approach instead
because it's smaller/cleaner, even though we convert to
viewport-relative before the call just to change it to buffer-relative
in the function.

Bug introduced in #19550

## Validation Steps Performed
The correct region is selected in the following scenarios:
 no scrollback
 with scrollback, at bottom
 with scrollback, not at bottom (selection isn't scrolled to, but I
think that's ok. Can be fixed easily if requested)
 alt buffer
2025-12-02 11:34:43 -06:00
Dustin L. Howett
f8506f4779 Fix the Windows/razzle build after #19344 (#19590) 2025-11-25 22:36:38 +00:00
penguin-sophist
fb75fb56c0 Fix negative delta scroll (#19573)
This fixes the sign extension from 16 to 32 bit by casting
from the unsigned to the signed type first.

Closes #19391
Closes #19484
2025-11-25 15:46:14 +00:00
Carlos Zamora
38d2fdad5f Replace NullableColorPicker ContentDialog with Flyout (#19572)
## Summary of the Pull Request
Updates the NullableColorPicker to use a flyout instead of a content
dialog. Frankly, it should've been this way from the start.

#19561 is an issue regarding the rectangle on the right side of the
picker. The complaint being that it should be something more useful than
a preview, an idea being that it could be a lightness gradient.
Unfortunately, the WinUI color picker doesn't let you do that. It's just
a plain preview.

That said, there's a lot of customizations that can be added still to
increase value here. To name a few:
- IsColorSliderVisible --> a color slider to adjust the lightness of the
color (as desired in #19561)
- IsHexInputVisible --> an input field to see and adjust the hex value
directly
- IsColorChannelTextInputVisible --> several input fields to adjust
individual RGB channels or switch over to HSV

However, the content dialog doesn't allow for text input due to a WinUI
bug and it's too small to display all of those controls.

Instead, I just discarded the content dialog altogether and opted into a
flyout. This makes it a more consistent experience with the other color
pickers (i.e. tab color, edit color scheme page). This also adds space
for all of the functionality mentioned above (those properties are
enabled by default).

## Validation Steps Performed
 selecting a color still works

Closes #19561
2025-11-24 16:21:49 -08:00
Leonard Hecker
1ca0c76bc7 Fix a WPF<>TSF crash by avoiding TF_TMAE_CONSOLE (#19584)
As explained in detail in the diff.

Closes #19562
2025-11-24 12:01:21 -06:00
Carlos Zamora
ee6060b3a4 Fix search not scrolling to result past view (#19571)
## Summary of the Pull Request
Fixes a bug where search would not scroll to results just below the
viewport.

This was caused by code intended to scroll the search result in such a
way that it isn't covered by the search box. The scroll offset is
calculated in `TermControl::_calculateSearchScrollOffset()` then handed
down in the `SearchRequest` when conducting a search. This would get to
`Terminal::ScrollToSearchHighlight()` where the offset is applied to the
search result's position so that we would scroll to the adjusted
position.

The adjustment was overly aggressive in that it would apply it to both
"start" and "end". In reality, we don't need to apply it to "end"
because it wouldn't be covered by the search box (we only scroll to end
if it's past the end of the current view anyways).

The fix applies the adjustment only to "start" and only does so if it's
actually in the first few rows that would be covered by the search box.

That unveiled another bug where `Terminal::_ScrollToPoints()` would also
be too aggressive about scrolling the "end" into view. In some testing,
it would generally end up scrolling to the end of the buffer. To fix
this cascading bug, I just had `_ScrollToPoints()` just call
`Terminal::_ScrollToPoint()` (singular, not plural) which is
consistently used throughout the Terminal code for selection (so it's
battle tested).

`_ScrollToPoints()` was kept since it's still used for accessibility
when selecting a new region to keep the new selection in view. It's also
just a nice wrapper that ensures a range is visible (or at least as much
as it could be).

## References and Relevant Issues
Scroll offset was added in #17516

## Validation Steps Performed
 search results that would be covered by the search box are still
adjusted
 search results that are past the end of the view become visible
 UIA still selects properly and brings the selection into view

## PR Checklist
Duncan reported this bug internally, but there doesn't seem to be one on
the repo.
2025-11-24 09:35:52 -08:00