Commit Graph

4633 Commits

Author SHA1 Message Date
Dustin L. Howett
e1cbaa5d83 Fix build after backport of 1ca0c76bc7
(cherry picked from commit 6115cf31f5)
v1.23.13503.0
2025-12-16 18:32:46 -06:00
Dustin L. Howett
d4b1b675c6 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

(cherry picked from commit 45c5370271)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgiXh2I
Service-Version: 1.23
2025-12-16 18:15:36 -06:00
Anastasia Smigaliova
21fc05c844 Fix cursor being hidden when pressing modifier keys (#19473)
Closes #19445

(cherry picked from commit b357de9897)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgirMu0
Service-Version: 1.23
2025-12-16 18:14:44 -06:00
Samuel D. Leslie
a129767fe1 Minor fixes to the settings schema (#19387)
## Summary of the Pull Request
Fixes a couple of minor issues in the settings schema which can result
in erroneous settings validation failures.

## References and Relevant Issues
None

## Detailed Description of the Pull Request / Additional comments
- `answerbackMessage`
  Permit `null` type (corresponds to the default value).
- `compatibility.input.forceVT`
  Add missing setting (previously was `experimental.input.forceVT`).
- `rendering.graphicsAPI`
  Add missing `automatic` enumeration value.
- Mark several settings as deprecated using the same format and direct
the user to the updated settings to use.

## Validation Steps Performed
Tested updated schema against configuration with above settings present.

## PR Checklist
- [X] Schema updated (if necessary)

---------

Co-authored-by: Carlos Zamora <carlos.zamora@microsoft.com>
(cherry picked from commit fc2d107897)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgirMyY
Service-Version: 1.23
2025-12-16 18:14:43 -06:00
Dustin L. Howett
15bc02cb45 env: don't explode when GetShortPathNameW fails (#19284)
It fails inside app containers (!) such as the one used by LocalTests.

(cherry picked from commit 91c9a14a71)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgirMsA
Service-Version: 1.23
2025-12-16 18:14:42 -06:00
SEt
b4cf05a02c 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

(cherry picked from commit 8bb831f628)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgiXm18
Service-Version: 1.23
2025-12-09 17:04:26 -06:00
Windows Console Service Bot
b8f270a4f7 Localization Updates - fix ja-jp and fr-fr loc bugs - 12/04/2025 00:46:52 (#19616)
Closes #17191
Closes #18795
Closes #17827

(cherry picked from commit c4668d99b7)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgiGa_s
Service-Version: 1.23
2025-12-09 11:28:50 -06:00
Dustin L. Howett
7381196865 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.

(cherry picked from commit 3e29d2a316)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgiA9Jg
Service-Version: 1.23
2025-12-09 11:26:24 -06:00
Leonard Hecker
f8efd14e81 Fix a WPF<>TSF crash by avoiding TF_TMAE_CONSOLE (#19584)
As explained in detail in the diff.

Closes #19562

(cherry picked from commit 1ca0c76bc7)
Service-Card-Id: PVTI_lADOAF3p4s4Axadtzghp8jw
Service-Version: 1.23
2025-11-24 12:50:21 -06:00
Windows Console Service Bot
51f412f7c2 Localization Updates - main - 11/07/2025 03:05:02 (#19532)
It said the equivalent of "Nickname" rather than "aliased".

Co-authored-by: Console Service Bot <consvc@microsoft.com>
(cherry picked from commit 965a121a38)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzghDyBE
Service-Version: 1.23
2025-11-24 12:50:02 -06:00
Leonard Hecker
221c04f0ac Allow creating new windows on another virtual desktop (#19458)
Whoops. Closes #18652

<DHowett> I chatted with Leonard to figure out why I kept
misunderstanding this PR. The key is that **this function should not
always return an existing window.** It's supposed to find an existing
window on the current virtual desktop, not literally any window
anywhere.

(cherry picked from commit 5ae95d7df0)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgYvdmA
Service-Version: 1.23
2025-11-24 12:50:01 -06:00
Dustin L. Howett
93335d045c Make sure UIHelpers' resources are included in the final PRI file (#19461)
OCWildcardResource requires the inclusion of a magic MSBuild target that
we wrote. We forgot to include it here. Oops.

Closes #19444

(cherry picked from commit 0e3d136dad)
Service-Card-Id: PVTI_lADOAF3p4s4Axadtzgf7udI
Service-Version: 1.23
2025-11-24 12:50:00 -06:00
Windows Console Service Bot
821eb1b645 Localization Updates - main - 10/15/2025 02:48:19 (#19451)
Closes #18849
Closes #19412

Co-authored-by: Console Service Bot <consvc@microsoft.com>
(cherry picked from commit 7f6ab5520e)
Service-Card-Id: PVTI_lADOAF3p4s4Axadtzgf5KOw
Service-Version: 1.23
2025-11-24 12:49:58 -06:00
Carlos Zamora
2aeeef72f9 Fix unfocusedBackground being used as active tab color (#19424)
Turns out that the `"TabViewItemHeaderBackground"` resource should be
set to the _selected_ color instead of the _deselected_ color.

In 1.22, (pre-#18109) we actually didn't set this resource. But we do
actually need it for high contrast mode! (verified)

 High contrast mode looks right
 "Snazzy" theme from bug report looks right

 Closes #19343

(cherry picked from commit b62cad640b)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgfrGvM
Service-Version: 1.23
2025-11-24 12:48:15 -06:00
Dustin L. Howett
96f13a15de Use the actual process image instead of module filename to dedup session (#19415)
Apparently, `GetModuleFileNameW` returns exactly the path (or prefix, in
case of a DLL) passed to `CreateProcess` casing and all. Since we were
using it to generate the uniquing hash for Portable and Unpackaged
instances, this meant that `C:\Terminal\wt` and `C:\TeRmInAl\wt` were
considered different instances. Whoops.

Using `QueryFullProcessImageNameW` instead results in canonicalization.
Maybe the kernel does it. I don't know. What I do know is that it works
more correctly.

(`Query...` goes through the kernel, while `GetModule...` goes through
the loader. Interesting!)

Closes #19253

(cherry picked from commit 9d7ea77cc8)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgfkTus
Service-Version: 1.23
v1.23.12811.0
2025-10-08 17:53:51 -05:00
PankajBhojwani
5fa2718b2f Only do "keys" fixups for non-nested, non-iterable commands (#19408)
## Summary of the Pull Request
When we introduced action IDs, we separated "commands" from
"keybindings", and introduced fixup logic to rewrite the legacy-style
command blocks into the new version. However we don't do any ID logic
for nested and iterable commands, so make sure we don't inform the
loader for fixups in those cases.

## Validation Steps Performed
We no longer repeatedly attempt to fixup the settings file when we see a
`"keys"` entry in a nested/iterable command block

## PR Checklist
- [x] Closes #18736

(cherry picked from commit 04676bd31a)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgfjxUM
Service-Version: 1.23
2025-10-08 17:53:50 -05:00
Dustin L. Howett
e1f785cedd Remove the leading fire from the taskbar progress handler (#19403)
If the progress state hasn't been set for more than 200ms, we shouldn't
even bother flickering the old state.

This prevents applications from making the tab (and the taskbar icon)
flicker.

We were reviewing #19394 and decided that the _original_ behavior before
Leonard's throttling fix was somewhat unfortunate as well. An
application that sets an indeterminate state for 10ms and then clears it
shouldn't be able to make any part of the application flicker, fast _or_
slow.

Removing the leading fire time from the throttled function ensures that
it will only fire once every 200ms, and only with the state most
recently set. It will not debounce (so setting the progress every 150ms
will not prevent it from updating.)

Closes #19394

(cherry picked from commit 998ab586e1)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgfZOsM PVTI_lADOAF3p4s4Axadtzgfb1Nw
Service-Version: 1.23
2025-10-08 17:53:48 -05:00
Dustin L. Howett
b4270e545d Avoid reentrancy issues when dropping AppHost, even harder (#19395)
The previous fix in #19296 moved the _destruction_ of AppHost into the
tail end after we manipulate the `_windows` vector; however, it kept the
part which calls into XAML (`Close`) before the `erase`. I suspect that
we still had some reentrancy issues, where we cached an iterator before
the list was modified by another window close event.

That is:

```mermaid
sequenceDiagram
		Emperor->>Emperor: Close Window
		Emperor->>+AppHost: Close (a)
		AppHost->>XAML: Close
		XAML-->>Emperor: pump loop
		Emperor->>Emperor: Close Window
		Emperor->>+AppHost: Close (b)
		AppHost->>XAML: Close
		XAML-->>Emperor: pump loop
		AppHost->>-Emperor: Closed
		Emperor->>Emperor: erase(b)
		AppHost->>-Emperor: Closed
		Emperor->>Emperor: erase(a)
```

Moving the `Close()` to after the `erase` ensures that there are no
cached iterators that survive beyond XAML pumping the message loop.

Fixes 8d41ace3

(cherry picked from commit 5976de1600)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgfScoo
Service-Version: 1.23
2025-10-08 17:53:47 -05:00
Dustin L. Howett
a4c512f016 build: separate vpack creation from vpack publication (#19380)
This will allow us to publish vpacks without making the build fail
waiting for us to *merge* those vpacks into Windows. It also gives us
better control over when and where the vpack update gets merged.

(cherry picked from commit 6b428577b9)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgfLAk0
Service-Version: 1.23
v1.23.12681.0
2025-09-25 13:36:59 -05:00
Dustin L. Howett
77a1f5a9e7 VsDev: reject VS instances which do not actually contain devshell/devcmd (#19352)
Closes #19169

(cherry picked from commit 1926c4601c)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgdI3eE
Service-Version: 1.23
2025-09-16 18:22:57 -05:00
Leonard Hecker
f486a5f7d4 Fix behavior of split-pane for existing windows (#19347)
Closes #18815

## Validation Steps Performed
* `wt -w 0 sp` splits the current tab 

(cherry picked from commit 0aee174e68)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgZrR-E
Service-Version: 1.23
2025-09-16 14:38:01 -05:00
John Cavanaugh
6dde7d3b78 Fix terminal profile schema to allow null in keybinding id (#19332)
Fixes the terminal profile jsonschema to allow for null in the id. This
is to match the current implementation when disabling a built in default
keybind.

(cherry picked from commit eb16eb26ab)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgemwL4
Service-Version: 1.23
2025-09-16 14:38:00 -05:00
Leonard Hecker
f18abeb62e Extend lead/trail edge support for throttled_func (#19210)
You can now create throttled functions which trigger both on the leading
and trailing edge. This was then also ported to `ThrottledFunc` for
`DispatcherQueue`s and used for title/taskbar updates.

Closes #19188

* In CMD run:
  ```batch
  FOR /L %N IN () DO @echo %time%
  ```
* Doesn't hang the UI 

SERVICE NOTES
This replays part of #19192 to make it compatible with throttled_func.

(cherry picked from commit dbf740cf2c)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgdI2TQ PVTI_lADOAF3p4s4AxadtzgdSMv0
Service-Version: 1.23
2025-09-16 14:36:44 -05:00
Myungchul Keum
f1dad37670 Adjust "Dimidium" color scheme (#19303)
- Add Selection BG color
- Make Bright white brighter

## Summary of the Pull Request
Final tune for Dimidium color scheme before its release.

## References and Relevant Issues
#18563

## Detailed Description of the Pull Request / Additional comments
I made little change to Dimidium color scheme.

<img width="640" height="174" alt="cmp-lightness1c"
src="https://github.com/user-attachments/assets/2e4aa6ca-5864-4901-b323-2e2bb2bf00e8"
/>

![preview-terminal](https://github.com/user-attachments/assets/8a53c54d-942a-44a2-9ee7-9ff8a6d2dfab)

<img width="584" height="207" alt="image"
src="https://github.com/user-attachments/assets/b70b0759-7961-4f8f-aaa7-762fc48e425b"
/>

- Adjusted "Bright white" slightly brighter, hoping it can be
distinguished better from "White".
- Defined "Selection Background" color.

This will be the final tune for Dimidum color scheme.

(cherry picked from commit 8011f3e28c)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgeMuoU
Service-Version: 1.23
2025-09-05 14:10:24 -05:00
Leonard Hecker
5d97c3ae36 Avoid reentrancy issues when dropping AppHost (#19296)
tl;dr: ~Apphost() may pump the message loop.
That's no bueno. See comments in the diff.

Additionally, this PR enables `_assertIsMainThread` in
release to trace down mysterious crashes in those builds.

**BACKPORT NOTES**
I returned the `_assertIsMainThread` check to debug-only to remove the
assertion risk from production builds.

(cherry picked from commit 8d41ace320)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgebmmE
Service-Version: 1.23
2025-09-05 14:09:57 -05:00
Myungchul Keum
be596f16a3 Add CAM16 based color scheme "Dimidium" (#18563)
Okay, here is a challenge for the default color scheme.

This PR adds the [Dimidium] color scheme.

Refs #17818
Refs #18502

I adjusted colors using CAM16. I prioritized lightness so that all
colors (especially blue) has appropriate contrast with the background.

[Brief information about the Dimidium color scheme](https://github.com/dofuuz/dimidium/blob/main/README.md)

[Detailed explanation on crafting the color scheme with CAM16](https://dofuuz.github.io/color/2024/03/17/dimidium-terminal-color-scheme.html)

[Dimidium]: https://github.com/dofuuz/dimidium

(cherry picked from commit b6b8caba1e)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgebmKA
Service-Version: 1.23
2025-09-05 14:09:05 -05:00
Leonard Hecker
829176363c Fix CoreWindow being destroyed after handoff (#19298)
As per: https://github.com/microsoft/terminal/discussions/19280#discussioncomment-14237148

## Validation Steps Performed
* Launch wtd via handoff (spawn cmd, etc.)
* Shift+Click the tab bar + button to create a new window
* Close the initial window
* UI doesn't lock up 

(cherry picked from commit 7849b00cbd)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgeLN9w
Service-Version: 1.23
2025-09-05 13:58:36 -05:00
Dustin L. Howett
5438177a49 sb: add appId to the StoreBroker blobs (new AERO requirement) (#19290)
> _I am altering the deal. Pray I do not alter it further._
> -the AERO team, maybe

(cherry picked from commit bd14f69080)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgeF9fU
Service-Version: 1.23
2025-09-05 13:57:56 -05:00
Adaline Valentina Simonian
55cb7049ed fix: don't render bidi isolates LRI, RLI, FSI, PDI (#18942)
Skips rendering LRI, RLI, FSI, and PDI "glyphs" in the terminal.

Does not implement BIDI/RTL; that is out of scope, see #538. This is
just a hotfix to stop spamming the console with undesired character
printouts. Once BIDI support is implemented, this change will (maybe?)
no longer be necessary.

Fixes #16574.

(cherry picked from commit 59590fc665)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgeAsaA
Service-Version: 1.23
2025-09-05 13:57:55 -05:00
abutcher-gh
8701c4ffa0 TerminalControl: Support MinGW path translation style (C:\ -> C:/) (#18759)
## Summary of the Pull Request

Support drag-n-drop path translation in the style used by MinGW
programs. In particular for usage with shells like `ash` from busybox
(https://frippery.org/busybox/).

## Detailed Description of the Pull Request / Additional comments

Provides a new option "mingw" for "pathTranslationStyle".
Shown as "MinGW" with translation documented as `(C:\ -> C:/)` in the
UI.
As per the other modes, this translates `\` to `/` but stops there.
There is no prefix/drive translation.

## Validation Steps Performed

Run using `busybox ash` shell. Dragged directories and files from both
local disks and network shares onto terminal. All were appropriately
single quoted and had their backslashes replaced with forward slashes.
They were directly usable by the `ash` shell.

Language files containing the other options have been updated to include
the new one.

## PR Checklist
- [ ] Closes #xxx
- [ ] Tests added/passed
- [x] Documentation updated
   - [Docs PR #849](https://github.com/MicrosoftDocs/terminal/pull/849)
- [ ] Schema updated (if necessary)

Co-authored-by: Adam Butcher <adam@jessamine.uk>
(cherry picked from commit 6682bed311)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgeAsM0
Service-Version: 1.23
2025-09-05 13:57:53 -05:00
Dustin L. Howett
29dc1fdd9c build: remove the forced vpack submission; let us do it on our own time (#19271)
(cherry picked from commit 4f391c5e42)
Service-Card-Id: PVTI_lADOAF3p4s4Axadtzgd_3-M
Service-Version: 1.23
v1.23.12371.0
2025-08-25 16:42:58 -05:00
Carlos Zamora
ca70e49cdf Add telemetry for settings UI traffic (#19156)
Adds a telemetry provider to the Terminal.Settings.Editor project as
well as new telemetry events to track traffic through the settings UI.
Specifically, the following events were added:
- `NavigatedToPage`: Event emitted when the user navigates to a page in
the settings UI
- Has a `PageId` parameter that includes the identifier of the page that
was navigated to
- (conditionally added when PageId = `page.editColorScheme`)
`SchemeName` parameter tracks the name of the color scheme that's being
edited
   - conditionally added when PageId = `page.extensions`:
- `ExtensionPackageCount`: The number of extension packages displayed
- `ProfilesModifiedCount`: The number of profiles modified by enabled
extensions
- `ProfilesAddedCount`: The number of profiles added by enabled
extensions
- `ColorSchemesAddedCount`: The number of color schemes added by enabled
extensions
   - conditionally added when PageId = `page.extensions.extensionView`:
- `FragmentSource`: The source of the fragment included in this
extension package
- `FragmentCount`: The number of fragments included in this extension
package
      - `Enabled`: The enabled status of the extension
- (conditionally added when PageID = `page.newTabMenu`) if the page is
representing a folder view
   - conditionally added when PageID = `page.profile.*`:
- `IsProfileDefaults`: if the modified profile is the profile.defaults
object
      - `ProfileGuid`: the guid of the profile that was navigated to
      - `ProfileSource`: the source of the profile that was navigated to
- conditionally added when PageID = `page.profile` (aka the base profile
page):
         - `Orphaned`: tracks if the profile was orphaned
         - `Hidden`: tracks if the profile is hidden
- (conditionally added when PageID = `page.profile.appearance`)
`HasBackgroundImage`: `if the profile has a background image defined`
- (conditionally added when PageID = `page.profile.appearance`)
`HasUnfocusedAppearance`: `if the profile has an unfocused appearance
defined`
- `AddNewProfile`: Event emitted when the user adds a new profile
`IsExtensionView` parameter tracks if the page is representing a view of
an extension
- Has a `Type` parameter that represents the type of the creation method
(i.e. empty profile, duplicate)
- `ResetApplicationState`: Event emitted when the user resets their
application state (via the UI)
- `ResetToDefaultSettings`: Event emitted when the user resets their
settings to their default value (via the UI)
- `OpenJson`: Event emitted when the user clicks the Open JSON button in
the settings UI
- Has a `SettingsTarget` parameter that represents the target settings
file (i.e. settings.json vs defaults.json)
- `CreateUnfocusedAppearance`: Event emitted when the user creates an
unfocused appearance for a profile
- `IsProfileDefaults`: if the modified profile is the profile.defaults
object
   - `ProfileGuid`: the guid of the profile that was navigated to
   - `ProfileSource`: the source of the profile that was navigated to
- `DeleteProfile`: Event emitted when the user deletes a profile
- also includes `ProfileGuid`, `ProfileSource`, `Orphaned` from the
`NavigatedToPage` section above

The page ids can be reused later as a serialized reference to the page.
We already use the one for the extensions page for the "new" badge.

(cherry picked from commit 7578209be5)
Service-Card-Id: PVTI_lADOAF3p4s4Axadtzgc2p-8
Service-Version: 1.23
2025-08-25 11:23:24 -05:00
James Pack
ee9198c9a3 Ensure items is not null before checking its size so we dont crash (#19026)
Prevents a crash when no storage items are returned from a dropped path.

Terminal no longer crashes when a relative path is dragged and dropped
into the tool.

Closes #19015

(cherry picked from commit 7a9fb76955)
Service-Card-Id: PVTI_lADOAF3p4s4Axadtzgd5l6I
Service-Version: 1.23
2025-08-21 17:45:35 -05:00
Leonard Hecker
eae5fbd83d Implement custom text context menus to fix crashes (#18854)
This works around a bug in WinUI where it creates a single context
menu/flyout for text elements per thread, not per `XamlRoot`, similar to
many other areas. Since the `XamlRoot` cannot change after creation,
this means that once you've opened the flyout, you're locked into that
window (= XAML root) forever. You can't open the flyout in another
window and once you've closed that window, you can't open it anywhere at
all.

Closes #18599

* Flies out right click in the
  * About dialog 
  * Search dialog 
  * Word delimiters setting 
  * Launch size setting 
* Across two windows 

(cherry picked from commit 076746a7a6)
Service-Card-Id: PVTI_lADOAF3p4s4Axadtzgd5l-U
Service-Version: 1.23
2025-08-21 17:45:34 -05:00
Carlos Zamora
59ff525128 Fix names and types of a few telemetry events (#19257)
Fixes a few issues with some telemetry events:
- The macro is organized as such: `TraceLoggingX(value, argName,
[argDescription])`. A few args had a description set on the spot where
the name should be. I added a name for a few of these.
- `TraceLoggingBool` --> `TraceLoggingInt32` for `themeChoice` (we
shouldn't be casting the evaluated int as a bool; it loses some of the
data we care about)
- improves the description for `themeChoice` to include information
about the legacy values

Checked through all our telemetry events and all of the args have a
proper name set. We tend to use `TraceLoggingValue` too which
automatically figures out the type that's being used, so that's also
handled.

(cherry picked from commit 7055b99acc)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgdzQck
Service-Version: 1.23
2025-08-21 17:44:00 -05:00
Dustin L. Howett
ea8753f4ee Switch to the @Local view on TerminalDependencies (#19243)
Due to an unexpected decision on behalf of the Azure Artifacts folks,
the default view for a feed with upstream sources reports all packages,
even if they are not actually populated into the feed.

This results in (uncontrolled) 401 errors whenever a new package appears
upstream, because the feed tells our users and our build system that it
is available, but fails when the download actually begins because it is
not allowed to "write" the upstream version to the feed.

(cherry picked from commit abaa9488d9)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgdnCVw
Service-Version: 1.23
2025-08-21 17:43:59 -05:00
Leonard Hecker
829688d06a Fix a output marks performance regression (#19242)
An alternative approach for #18291. Improves perf by ~7%.

(cherry picked from commit 6b19d21845)
Service-Card-Id: PVTI_lADOAF3p4s4Axadtzgdm49M
Service-Version: 1.23
2025-08-21 17:43:23 -05:00
Dustin L. Howett
a916704a6f Use a new API to propagate foreground state to child processes (#19192)
Windows 11 uses some additional signals to determine what the user cares
about and give it a bit of a QoS boost. One of those signals is whether
it is associated with a window that is in the foreground or which has
input focus.

Association today takes two forms:
- Process has a window which is in the foreground or which has input
  focus
- Process has a *parent* that meets the above criterion.

Console applications that are spawned "inside" terminal by handoff do
not fall into either bucket. They don't have a window. Their parent is
`dllhost` or `explorer`, who is definitely not in focus.

We are piloting a new API that allows us to associate those processes
with Terminal's window.

When Terminal is in focus, it will attach every process from the active
tab to its QoS group. This means that whatever is running in that tab
is put into the "foreground" bucket, and everything running in other
background tabs is not.

When Terminal is out of focus, it attaches every process to its QoS
group. This ensures that they all go into the "background" bucket
together, following the window.

(cherry picked from commit 0d23624fa9)
Service-Card-Id: PVTI_lADOAF3p4s4Axadtzgdh6-Q
Service-Version: 1.23
2025-08-21 17:43:21 -05:00
Dustin L. Howett
9449d0b29e Fix hot reload for icon, bell, close on exit; regressed in #16172 (#19217)
In #16172, we removed the propagation of the profile down into the
Terminal Pane Content.

It was holding on to the profile from the _old_ settings model (😱).

This also broke background image hot reload.

(cherry picked from commit 666a75bc70)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgdVVHA
Service-Version: 1.23
2025-08-06 13:40:12 -05:00
Leonard Hecker
34cd29a0ce Fix WSL PATH corruption & potential use-after-free (#19211)
Closes #19152

## Validation Steps Performed
* Set `PATH` on a linux profile
* `PATH` isn't messed up inside WSL 

(cherry picked from commit 0a6394270e)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgdR6bA
Service-Version: 1.23
2025-08-06 13:40:05 -05:00
MQY
4995af3dc1 Prevent cursor repositioning during mouse selection (#19182)
- Modify the cursor repositioning logic to check if a selection is in
progress
- Only reposition the cursor when the mouse is used for positioning, not
during selection operations

Closes #19181

(cherry picked from commit 88ab154f22)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgdSbu4
Service-Version: 1.23
2025-08-06 13:40:04 -05:00
Leonard Hecker
ed022e89db Fix another VT input double-encoding issue (#19083)
Closes #17264
Closes https://github.com/microsoft/edit/issues/182

Long shot, but probably also...
Closes #18579
Closes #19082

(cherry picked from commit 97f0a06fbe)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgdOWF0
Service-Version: 1.23
2025-08-01 17:43:43 -05:00
Dustin L. Howett
df34f34691 Fix overeager pre-delayed-EOL wrapping in AdaptDispatch (#18899)
AdaptDispatch has a TODO item indicating that we should *not* consider a
row wrapped until we write into the cell beyond it. We actually do have
that logic (it even refers to it!), but we still set the wrap flag when
we fill the final column.

We never removed it because it broke the old VT rendering-based ConPTY
implementation.

Now that VtEngine is gone, so can be this code and this strange
workaround for a problem nobody was quite sure what was.

This will fix, hopefully, the last of our exact line length write wrap
issues. tmux users can finally rejoice.

Closes #8976
Closes #15602

(cherry picked from commit 14993db1cb)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgaWx6A
Service-Version: 1.23
2025-08-01 17:43:42 -05:00
Leonard Hecker
9357281507 Fix use-after-free when disabling the ASB (#19186)
Closes #17515

## Validation Steps Performed
* Disable the ASB while there's a pending cooked read
* Type some text
* No crash 

(cherry picked from commit dfcc8f3c62)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgdFoBM
Service-Version: 1.23
v1.23.12102.0
2025-07-29 14:05:50 -05:00
Quaylyn Rimer
edcd042913 Fix scrollbar marks not appearing until scroll or resize (#19185)
This PR resolves an issue where scrollbar marks created by shell
integration sequences (OSC 133 FTCS, OSC 1337 iTerm2, and OSC 9;12
ConEmu sequences) were not visible on the scrollbar until the user
manually scrolled.

The problem was that while marks were being created in the buffer
correctly, the UI wasn't being notified to refresh the scrollbar
display. The fix adds a new NotifyShellIntegrationMark() method to the
ITerminalApi interface that calls _NotifyScrollEvent() to trigger
scrollbar refresh, and updates all shell integration sequence handlers
in AdaptDispatch to call this notification method after creating marks.
This ensures scrollbar marks appear immediately when shell integration
sequences are processed, bringing feature parity between auto-detected
and shell-integration-based marks.

Closes #19104

(cherry picked from commit e818dafa6d)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgdFukU
Service-Version: 1.23
2025-07-29 12:55:20 -05:00
Weichen Li
99c6de5bbe Fix WSLENV environment variable duplication in ConptyConnection (#19167)
This PR fixes issue #7130 where WT_SESSION and WT_PROFILE_ID environment
variables were being duplicated in the WSLENV environment variable when
multiple terminal sessions were created.

The previous implementation always appended WT_SESSION:WT_PROFILE_ID: to
WSLENV without checking if these variables already existed, causing
duplication.

Closes #7130

Co-authored-by: Leonard Hecker <lhecker@microsoft.com>
(cherry picked from commit 7d6e0c8b8e)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgdDF2w
Service-Version: 1.23
2025-07-29 12:55:18 -05:00
Carlos Zamora
7c593c5aac Add telemetry for new tab menu traffic (#19142)
## Summary of the Pull Request
Adds new telemetry events to track traffic through the new tab menu.
Specifically, the following events are added:
- `NewTabMenuDefaultButtonClicked`: Event emitted when the default
button from the new tab split button is invoked
- `NewTabMenuOpened`: Event emitted when the new tab menu is opened
- `NewTabMenuClosed`: Event emitted when the new tab menu is closed
- `NewTabMenuItemClicked`: Event emitted when an item from the new tab
menu is invoked
- Has an `ItemType` parameter that can be set to `Settings`,
`CommandPalette`, `About, `Profile`, `Action`
- Has a `TabCount` parameter that keeps tracked of the number of tabs in
the window before changing the state
- `NewTabMenuCreatedNewTerminalSession`: Event emitted when a new
terminal was created via the new tab menu
- Has a `SessionType` parameter that can be set to `ElevatedWindow`,
`Window`, `Pane`, `Tab`
- Instead of `TabCount`, has a `NewTabCount` that keeps track of the
_new_ number of tabs after the session has been created
- `NewTabMenuItemElevateSubmenuItemClicked`: Event emitted when the
elevate submenu item from the new tab menu is invoked

## Validation Steps Performed
Used TVPP to see events generated from interacting with the new tab
menu.

(cherry picked from commit 8c20d2052d)
Service-Card-Id: PVTI_lADOAF3p4s4Axadtzgc0Dws
Service-Version: 1.23
2025-07-29 12:55:16 -05:00
Dustin L. Howett
8673cd2abb Re-enable web-source icons in Stable and Preview builds (#19137)
Disables a controversial part of #19044.

Refs #19075

(cherry picked from commit 7b841628df)
Service-Card-Id: PVTI_lADOAF3p4s4Axadtzgcqq7A
Service-Version: 1.23
2025-07-29 12:55:14 -05:00
Leonard Hecker
72cad7f3e2 Improve TSF color filtering logic (re: QQPinyin) (#19117)
If an IME provider sets both `crText` and `crBk` we should respect this,
but the previous logic would incorrectly assert for `crLine !=
TF_CT_NONE`.

## Validation Steps Performed
 I'm not aware which TSF even sets these colors in a
way that's compatible with us in the first place...

(cherry picked from commit f2b30b4e1e)
Service-Card-Id: PVTI_lADOAF3p4s4Axadtzgck4T0
Service-Version: 1.23
2025-07-29 12:55:12 -05:00
Dustin L. Howett
110e100384 version: fix the LCID in our VERSIONINFO, add descriptions to each file (#19114)
Closes #19106

(cherry picked from commit f14718f738)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgcbOIk
Service-Version: 1.23
2025-07-29 12:55:10 -05:00