Adds logic to display a warning popup if the settings.json is marked as
read-only and we try to write to the settings.json file. Previously,
this scenario would crash, which definitely isn't right. However, a
simple fix of "not-crashing" wouldn't feel right either.
This leverages the existing infrastructure to display a warning dialog
when we failed to write to the settings file. The main annoyance here is
that that popup dialog is located in `TerminalWindow` and is normally
triggered from a failed `SettingsLoadEventArgs`. To get around this,
`CascadiaSettings::WriteSettingsToDisk()` now returns a boolean to
signal if the write was successful; whereas if it fails, a warning is
added to the settings object. If we fail to write to disk, the function
will return false and we'll raise an event with the settings' warnings
to `TerminalPage` which passes it along to `TerminalWindow`.
Additionally, this uses `IVectorView<SettingsLoadWarnings>` as opposed
to `IVector<SettingsLoadWarnings>` throughout the relevant code. It's
more correct as the list of warnings shouldn't be mutable and the
warnings from the `CascadiaSettings` object are retrieved in that
format.
- ✅ Using SUI, save settings when the settings.json is set to read-only
Closes#18913
(cherry picked from commit 218c9fbe3e)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgb3QSg
Service-Version: 1.22
Adds branding and distribution metadata to the following telemetry
events:
- ActionDispatched (branding only)
- JsonSettingsChanged
- UISettingsChanged
- SessionBecameInteractive
Also removes the settings logger output from the debugger and some
leftover debugging functions.
Adds a label to the XSettingsChanged settings value to make it easier to
read on the backend.
(cherry picked from commit b50eaa19e0)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgaj8x8
Service-Version: 1.22
Some applications that make use of the `OSC 52` clipboard sequence will
only do so if they can be certain that the terminal actually has that
functionality. Indicating our support for `OSC 52` in the `DA1` report
will give them an easy way to detect that.
`OSC 52` support was added to Windows Terminal in issue #5823, and to
ConHost in issue #18949.
Support for writing to the clipboard is indicated in the primary device
attributes report by the extension parameter `52`. This is obviously not
a standard DEC extension, but it's one that's been agreed upon by a
number of modern terminals. The extension is only reported when writing
to the clipboard is actually permitted (Windows Terminal has an option
to disable that).
I've updated the Device Attributes unit test to check that we're
reporting extension `52` when clipboard access is enabled, and not
reporting it when disabled.
- [x] Closes#19017
- [x] Tests added/passed
(cherry picked from commit 00ee88400a)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgbpe4k
Service-Version: 1.22
Right now, image validation accepts web-sourced icons (boo) and rejects
images whose paths begin with `\\?\`. In addition, it will warn the user
for things out of their control like images set by fragments.
This pull request adds a filesystem path validator (which accepts images
with fully-qualified paths and UNC paths), makes the URI validator
reject any web-origin URIs (only `file` and `ms-*` are allowable), and
suppresses warnings for any images that were not _directly_ set by the
user.
Since we want to avoid using fragment images that fail validation, we no
longer `Clear` each image property but rather set it to the blank or
fallback value.
This does **not** actually add support for images at absolute paths
beginning with `\\?\`. Such images are still rejected by `Image` and the
other XAML fixtures we use for images. It's better than a warning,
though.
Closes#18703Closes#14143
Refs #18710
Refs #5204
Related to #18922 (http-origin icons will be blank everywhere and not
just the jump list ;))
(cherry picked from commit f28bb42979)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgbjZlQ
Service-Version: 1.22
* Make PowerShell profile generation try to find `pwsh.exe` before
falling back to legacy powershell
* Make profiles generated on an `arm64` host work properly
## Validation Steps Performed
* Local build ran
* Verified the new `arm64` profile works
* Verified `pwsh.exe` is used if present
* Verified `powershell.exe` is used if `pwsh` is not present in path
* Verified we don't attempt to create `arm64` host cmd/pwsh profiles if
VS is not >= 17.4
(cherry picked from commit bb62ce9345)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgbeRwk
Service-Version: 1.22
I can't explain this, but VS 17.14 ships with VisualCpp.Tools.Core
version 14.44.35208 but the files say 14.44.35207.
(cherry picked from commit 9dbcf4b9dd)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgbDfzQ
Service-Version: 1.22
Looks like there's a new VS version on the build agents. This just goes
through and fixes any issues they found.
There's still a COMPILER CRASH though.
(cherry picked from commit 2d64a3a4ab)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgakG1w
Service-Version: 1.22
win10-* is no longer a valid rid
https://learn.microsoft.com/en-us/dotnet/core/compatibility/sdk/8.0/rid-graph
This package would fail to install the dependencies to the correct
location in .net 8 and later by default. win-x64 is a valid runtime id
in prior .net versions so I think this should be back compat.
Without this the package fails to do its job on newer builds unless `
<UseRidGraph>true</UseRidGraph>` and the user sets `win10-x64` as their
RID in their project file.
(cherry picked from commit c6e7f3244b)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgap6WE
Service-Version: 1.22
They're much prettier, but some users may not be 100% happy.
(cherry picked from commit 696dac2c6a)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgaWoFg
Service-Version: 1.22
We never hooked up this callback!
This allows a CLI application to emit text directly to the clipboard.
(cherry picked from commit c64a9d2a32)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgaWn6g
Service-Version: 1.22
Fixes a bug where `Monarch::_peasants` would not be updated when the
last window was closed and `compatibility.allowHeadless` was enabled.
## Detailed Description of the Pull Request / Additional comments
The bug was originally caused by `Monarch::_peasants` still holding on
to a reference to itself in the list. Normally, a `Peasant` was removed
from the list via the `WindowManager::SignalClose()` (aka
`Monarch::SignalClose()`) function. However,
`AppHost::_CloseRequested()` would omit that call when the last window
was closing.
Normally, that makes sense. It's the last window, so let's call
`AppHost::_quit()` --> `WindowManager::QuitAll()` -->
`Monarch::QuitAll()`, where we just call `Peasant::Quit()` on all the
peasants and the monarch and we call it a day. Everything should be
cleaned up and if we need a new session, we'll create a new `Monarch`
anyways.
Problem is, when `compatibility.allowHeadless` is enabled, the
`WindowEmperor` doesn't actually close! We want the `WindowEmperor` to
stick around because that's the "headless" part we're allowing. See
`WindowEmperor::_decrementWindowCount()`:
bbd6427b08/src/cascadia/WindowsTerminal/WindowEmperor.cpp (L296-L308)
The fix here was to avoid the `QuitAll()` code path mentioned above if
`compatibility.allowHeadless` is enabled. Just treat this as a normal
teardown otherwise so that the `WindowEmperor` creates a new `Monarch`
when we need it.
## Validation Steps Performed
✅ The scenario from the bug works:
- enable `compatibility.allowHeadless`
- set `windowingBehavior` to `useExisting`
- Open Terminal
- Close the only open window
- Attempting to open Terminal again should open a new window
✅ when all windows are closed, we still have the background process
Closes#18827
The conhost v2 rewrite from a decade ago introduced a race condition:
Previously, we would acquire and hold the global console lock while
servicing
a console API call. If the call cannot be completed a wait task is
enqueued,
while the lock is held. The v2 rewrite then split the project up into a
"server" and "host" component (which remain to this day). The "host"
would
hold the console lock, while the "server" was responsible for enqueueing
wait
tasks _outside of the console lock_. Without any form of
synchronization,
any operations on the waiter list would then of course introduce a race
condition. In conhost this primarily meant keyboard/mouse input, because
that
runs on the separate Win32 window thread. For Windows Terminal it
primarily
meant the VT input thread.
I do not know why this issue is so extremely noticeable specifically
when we
respond to DSC CPR requests, but I'm also not surprised: I suspect that
the
overall performance issues that conhost had for a long time, meant that
most
things it did were slower than allocating the wait task.
Now that both conhost and Windows Terminal became orders of magnitudes
faster
over the last few years, it probably just so happens that the DSC CPR
request
takes almost exactly as many cycles to complete as allocating the wait
task
does, hence perfectly reproducing the race condition.
There's also a slight chance that this is actually a regression from my
ConPTY
rewrite #17510, but I fail to see what that would be. Regardless of
that,
I'm 100% certain though, that this is a bug that has existed in v0.1.
Closes#18117Closes#18800
## Validation Steps Performed
* See repro in #18800. In other words:
* Continuously emit DSC CPR sequences
* ...read the response from stdin
* ...and print the response to stdout
* Doesn't deadlock randomly anymore ✅
* Feature & Unit tests ✅
(cherry picked from commit 2992421761)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgUXwj0 PVTI_lADOAF3p4s4AmhmQzgZiUlw
Service-Version: 1.22
There were two bugs:
* Ever since the conhost v1 -> v2 rewrite the `readDataDirect.cpp`
implementation incorrectly passed `false` as the wait flag.
The unintentional mistake is obvious in hindsight as the
check for `CONSOLE_STATUS_WAIT` makes no sense in this case.
* The ConPTY integration into `InputBuffer` was done incorrectly,
as it would unconditionally wake up the readers/waiters without
checking if the buffer is now actually non-empty.
Closes#15859
## Validation Steps Performed
Test code:
```cpp
#include <Windows.h>
#include <stdio.h>
int main() {
HANDLE in = GetStdHandle(STD_INPUT_HANDLE);
INPUT_RECORD buf[128];
DWORD read;
SetConsoleMode(
in,
ENABLE_PROCESSED_INPUT | ENABLE_VIRTUAL_TERMINAL_INPUT
);
for (int i = 0; ReadConsoleInputW(in, buf, 128, &read); ++i) {
printf("%d read=%lu\n", i, read);
}
return 0;
}
```
Run it under Windows Terminal and type any input. >50% of all
inputs will result in `read=0`. This is fixed after this PR.
(cherry picked from commit 5c55144c28)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgaHLrQ
Service-Version: 1.22
This fixes two issues in the WPF terminal control:
- The emoji picker and other IME candidate windows didn't show up in the
right place
- Submitting an emoji via the emoji picker would result in two win32
input mode events with a VK of 65535 and the surrogate pair halves.
I am not sure I did the right thing with the thread TSF handle...
(cherry picked from commit 06f736bebe)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgZ-Sw4
Service-Version: 1.22
According to the documentation, the final character of an SGR mouse
report is meant to be `M` for a button press and `m` for a button
release. However it isn't clear what the final character should be for
motion events, and we were using an `m` if there weren't any buttons
held down at the time, while all other terminals used an `M`, regardless
of the button state.
This PR updates our implementation to match what everyone else is doing,
since our interpretation of the spec was causing problems for some apps.
I've manually tested the new behavior in Vttest, and confirmed that our
mouse reports now match Xterm more closely, and I've tested with v0.42.0
of Zellij, which was previous glitching badly in Windows Terminal, but
now works correctly.
I've also updated our unit tests for the SGR mouse mode to reflect the
correct report format.
Closes#18712
(cherry picked from commit 865f5e5239)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgZ9_E0
Service-Version: 1.22
This PR fixes two cases where image content wasn't correctly erased when
overwritten.
1. When legacy console APIs fill an area of the buffer using a starting
coordinate and a length, the affected area could potentially wrap over
multiple rows, but we were only erasing the overwritten image content on
the first affected row.
2. When copying an area of the buffer with text content over another
area that contained image content, the image in the target area would
sometimes not be erased, because we ignored the `_eraseCells` return
value which indicated that the image slice needed to be removed.
## References and Relevant Issues
The original code was from the Sixel implementation in PR #17421.
## Validation Steps Performed
I've manually verified that these two cases are now working as expected.
## PR Checklist
- [x] Closes#18568
(cherry picked from commit 08e76da3a1)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgZ3XUA
Service-Version: 1.22
This requires us to delay-sign the assembly with a public key (the snk
file), and then later submit it for strong naming. This is separate from
code signing, and has to take place before it.
The snk file does not contain any private key material.
This cannot merge until we are approved to use this new signing "key
code".
(cherry picked from commit 0568173aba)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgZuEzY
Service-Version: 1.22
I've been doing this manually. It is time for me to do it not-manually.
(cherry picked from commit 21f3179326)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgZwVgk
Service-Version: 1.22
This required removing connections during the build to `nuget.org` and
`powershellgallery.com`.
The NuGet Tool task was downloading nuget from `nuget.org`
unconditionally.
The `AzureFileCopy` task was downloading `Az.Accounts` from
`powershellgallery.com` unconditionally.
Both of these tasks have better options nowadays.
Tested and passed in OneBranch on 2025-04-01.
(cherry picked from commit 22c509f426)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgZ0dVU
Service-Version: 1.22
When Sixel images are rendered, they're automatically scaled to match
the 10x20 cell size of the original hardware terminals. If this requires
the image to be scaled down, the default GDI stretching mode can produce
ugly visual artefacts, particularly for color images. This PR changes
the stretching mode to `COLORONCOLOR`, which looks considerably better,
but without impacting performance.
The initial Sixel implementation was added in PR #17421.
## Validation Steps Performed
I've tested with a number of different images using a small font size to
trigger the downscaling, and I think the results are generally better,
although simple black on white images are still better with the default
mode (i.e. `BLACKONWHITE`), which is understandable.
I've also checked the performance with a variation of the [sixel-bench]
test, and confirmed that the new mode is no worse than the default.
[sixel-bench]: https://github.com/jerch/sixel-bench
(cherry picked from commit b243fb6189)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgZ0dHI
Service-Version: 1.22
We used to cherry-pick every commit that had even one card in "To Cherry
Pick", even if it was also referenced by a card in "Rejected" or even
"To Consider".
Now we will warn and skip those commits.
I took this opportunity to add a bit of an object model for servicing
cards as well as prettify the output.
That allowed us to add a list of cards that were ignored due to having
no commits, and display little icons for each type of card.
(cherry picked from commit 8e94983170)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgZtprA
Service-Version: 1.22
Reading through our existing patterns for integer parsing, I noticed
that we'd be better off returning them as optionals.
This also allowed me to improve the implementation to support integers
all the way up to their absolute maximum/minimum.
Furthermore, I noticed that `prefix_split` was unsound:
If the last needle character was the last character in the remaining
text, the remaining text would be updated to an empty string view.
The caller would then have no idea if there's 1 more token left
or if the string is truly empty.
To solve this, this PR introduces an iterator class. This will allow
it to be used in our VT parser code.
(cherry picked from commit fa8273065f)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgZtkTk
Service-Version: 1.22
The "open JSON" button in the settings UI wasn't working when invoked
via accessibility tools (specifically Narrator in scan mode and Voice
Access). For some reason, in those scenarios, neither the `Tapped` or
`KeyDown` event were hit!
This PR adds the logic to open the json file via the `ItemInvoked` event
instead. The `Tapped` and `KeyDown` handlers were removed to prevent a
redundant `OpenJson` event being raised.
Additionally, `SelectsOnInvoked` was set to `False` on the "open JSON"
nav item. This prevents the selection pill from moving to the nav item,
which feels more correct.
The following scenarios are confirmed to open the JSON
✅ Mouse click
✅ Keyboard (Spacebar and Enter)
✅ Voice Access
✅ Narrator in scan mode
For all of these (except Voice Access), I've confirmed that holding the
Alt button while invoking the JSON button opens defaults.json.
Closes#18770Closes#12003
(cherry picked from commit a8a47b9367)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgZrDt4
Service-Version: 1.22
This pull request adds support for resetting the various color table
entries and xterm resource values back to their defaults.
Building on the default color table James introduced in #17879, it was
relatively straightforward to add support for resetting specific
entries.
This implementation cleaves tightly to observed behavior in xterm(379)
rather than observed behavior in libvte(0.70.6). They differ in the
following ways:
- xterm rejects any OSC [110..119] with any number of parameters; libvte
accepts it but only resets the first color.
- When passed a list of color indices to reset in 104, xterm resets any
colors up until the first one which fails to parse as an integer and
does _not_ reset the rest; libvte resets all parseable color indices.
I was unable to verify how these reset commands interact with colors set
via `DECAC Assign Color` so I went with the implementation that made the
most sense:
- Resetting the background color with `110` also restores the background
color alias entry to its pre-`DECAC` value; this results in the
perceived background color returning to e.g. index 0 in conhost and the
`background` color in Terminal.
- _ibid._ for the foreground color
Refs #18695
Refs #17879Closes#3719
(cherry picked from commit 5f311506dc)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgZOWsU
Service-Version: 1.22
This PR adds a new policy definition to the ADMX templates for settings
the default Terminal application in Windows.
> [!Note]
> This PR does not change any code of Windows, Console Host or Windows
Terminal. It only adds the definition for a new policy to the templates.
I got the registry values form the documentation and by testing the
values.
The policy is only available as user policy because the registry values
have to be in HKCU.
The Policy is implemented as preference (not inside the Policy key) and
therefore keeps it's value on removing (not configured) it. You can see
this in `gpedit.msc` on the policy symbol and the hint in the
description.
Closes#18302
Refs #18303
(cherry picked from commit 68d9e0d038)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgZlw44
Service-Version: 1.22
Use DECSC/DECRC and XTPUSHSGR/XTPOPSGR while redrawing
popups, since they're drawn using the current popup colors.
I wish we could just use the reverse video rendition...
Closes#18742
## Validation Steps Performed
* Run `color 3f` and then press F7
* Works fine in conhost (VtPipeTerm) ✅
* Works as expected (black background) in VS Code ✅
(cherry picked from commit 8b01f546cb)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgZd3bw
Service-Version: 1.22
Add additional information to 2 error scenarios when launching a
different profile in the `ConptyConnection.cpp` file.
- Requires Elevation
- File Not Found
Created a profile that required elevation and verified the error
message. Created profile that passed a made up command and verified the
error message.
Closes#7186
(cherry picked from commit f7e853cd9f)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgZlxJc
Service-Version: 1.22
We can't do the `pos.x != 0` check. Instead, I replaced it with
a CR check to avoid redundant CRs during CRLF translation.
Closes#18735
## Validation Steps Performed
* Run the repro in the linked issue
(cherry picked from commit 354e05d713)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgZRM3c
Service-Version: 1.22
When we overwrite the attributes during the fill,
we must retain the lead/trail byte attributes.
Closes#18746
## Validation Steps Performed
* Added a unit test ✅
(cherry picked from commit 90c312f7da)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgZX2Dk
Service-Version: 1.22
This ensures that the vertical scrollbar will not cover the description text.
Closes#18545
(cherry picked from commit f83b98e100)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgZX-v8
Service-Version: 1.22
This pull request brings us up to fmt 11.1.4 and enables `FMT_PEDANTIC`.
`FMT_PEDANTIC` turns on `/W3`, which is required by our local feudal
lords who will automatically file bugs on us if we don't build with
enough warnings enabled.
(cherry picked from commit f34dbbf3ac)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgYvOpA
Service-Version: 1.22
Before we had a Settings UI, we added support for a setting called
`startOnUserLogin`. It was a boolean, and on startup we would try to
yeet the value of that setting into the Windows API responsible for
registering us as a startup task.
Unfortunately, we failed to take into account a few things.
- Startup tasks can be independently controlled by the user in Windows
Settings or by an enterprise using enterprise policy
- This control is not limited to *disabling* the task; it also supports
enabling it!
Users could enable our startup task outside the settings file and we
would never know it. We would load up, see that `startOnUserLogin` was
`false`, and go disable the task again. 🤦
Conversely, if the user disables our task outside the app _we can never
enable it from inside the app._ If an enterprise has configured it
either direction, we can't change it either.
The best way forward is to remove it from our settings model and only
ever interact with the Windows API.
This pull request replaces `startOnUserLogin` with a rich settings
experience that will reflect the current and final state of the task as
configured through Windows. Terminal will enable it if it can and
display a message if it can't.
My first attempt at this PR (which you can read in the commit history)
made us try harder to sync the state between the settings model and the
OS; we would propagate the disabled state back to the user setting when
the task was disabled in the OS or if we failed to enable it when the
user asked for it. That was fragile and didn't support reporting the
state in the settings UI, and it seems like it would be confusing for a
setting to silently turn itself back off anyway...
Closes#12564
(cherry picked from commit a46fac25d3)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgYvOug
Service-Version: 1.22
It turns out that we *can* support language overrides--fairly easily, in
fact!--by simply changing the default Language qualifier.
I elected not to change how packaged language override works until we
are certain this works properly everywhere. Consider it a healthy
distrust of the Windows App Platform.
Closes#18419Closes#18336Closes#17619
(cherry picked from commit 7d8f7eb429)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgYVTtg
Service-Version: 1.22
It has a Component Governance alert (and no license), plus we aren't using it.
(cherry picked from commit f023b3bfd2)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgYf3c0
Service-Version: 1.22
After taking in 1.22, our CodeQL process caught a few locations where we
weren't following the right guidance:
- Performing integer comparisons of different sizes which could lead to
an infinite loop if the larger integer goes out of range of the smaller
integer
- Not checking HResult of a called method
Co-authored-by: aphistra <102989060+aphistra@users.noreply.github.com>
(cherry picked from commit 6e89242373)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgWmd4s
Service-Version: 1.22
I found multiple issues while investigating this:
* Render thread shutdown is racy, because it doesn't actually stop the
render thread.
* Lifetime management in `ControlCore` failed to account for the
circular dependency of render thread --> renderer --> render data -->
terminal --> renderer --> render thread. Fixed by reordering the
`ControlCore` members to ensure their correct destruction.
* Ensured that the connection setter calls close on the previous
connection.
(Hopefully) Closes#18598
## Validation Steps Performed
* Can't repro the original failure ❌
* Opening and closing tabs as fast as possible doesn't crash anymore ✅
* Detaching and reattaching a tab producing continuous output ✅
(cherry picked from commit 70f85a4a35)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgXhFbo
Service-Version: 1.22
Since `WaitForDA1` would wait until `_deviceAttributes` is non-zero,
we must ensure it's actually non-zero at the end of this handler,
even if there are no parameters.
## Validation Steps Performed
* Mod the Terminal DA1 to be `\x1b[?6c`. No hang ✅
* Mod the Terminal DA1 to be `\x1b[?61c`. No hang ✅
(cherry picked from commit 32ae00f71a)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgYO0bA
Service-Version: 1.22
I've received a dump from an affected user, and it showed that the
layout event in TerminalPage was raised synchronously. This meant that
during page initialization, the handoff listener was started while still
being stuck inside the handoff listener. This resulted in a deadlock.
This PR fixes the issue by not holding the lock across handoff callback
calls.
Closes#18634
## Validation Steps Performed
* Can't repro ❌
(cherry picked from commit 2693210ead)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgYLZvQ
Service-Version: 1.22
During startup we relinquish ownership of the console lock to wait for
the DA1 response of the hosting terminal. The problem occurs if the
hosting terminal disconnects during that time. The broken pipe will
cause `VtIo` to send out `CTRL_CLOSE_EVENT` messages, but those won't
achieve anything, because the first and only client hasn't even finished
connecting yet. What we need to do instead is to return an error code.
In order to not use a bunch of booleans to control this behavior, I gave
`VtIo` a state enum. This however required restructuring the calling
code in order to not have a dozen states.
## Validation Steps Performed
* Launch cmd.exe with ConPTY
* ...but leave the stdin pipe unbound (which will hang the DA1 request)
* Immediately kill the ConPTY session
* cmd.exe exits after clicking away the error message ✅
(cherry picked from commit 733a5e7bec)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgXjzIk
Service-Version: 1.22
Campbell has been the default color scheme for a long time now,
but it has quite some issues with hue and chroma.
This PR introduces a new scheme which was created using the Oklab
color space to find colors with maximal distance to each other
and well distributed and consistent hue and chroma.
Because of this, I've named the scheme after the creator of Oklab.
Closes#17818
(cherry picked from commit e60acbc12a)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgW-IDA
Service-Version: 1.22
Fixes an issue where pressing `CTRL` + `Insert` does not copy text
selected in the Command Palette. Instead, it closes it, and any text
selected in the pane is copied to the clipboard.
Since `Insert` is a virtual key, I address the issue by adding a
conditional check for `CTRL` with either `Insert` or `C` (previously, it
only checked for `CTRL` with `C`) for the copy action in the Command
Palette.
## Validation Steps Performed
I followed the reproduction steps and verified that the actual behaviour
matched the expected behaviour. All existing tests passed, but no new
test was added.
Closes#9520
(cherry picked from commit 2e92a15464)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgW9xcY
Service-Version: 1.22
This update fixes a hinting issue in Arabic glyphs.
See microsoft/cascadia-code#746 for more details.
(cherry picked from commit bf074f3e40)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgW99S0
Service-Version: 1.22
When file/folder is dropped to the terminal, its path is translated and
quoted with a pair of single quotes if necessary.
However, the terminal control does not escape single quotes (allowed in
the Win32 subsystem) that need escapes when translated.
On the translation styles other than `"none"` (note: all other
translation styles are currently intended for the POSIX shell), it
causes incorrect path to be pasted when the path contains one or more
single quotes (see #18006 for an example).
With this commit, the terminal control escapes a single quote with a
valid escape sequence `'\''` (finish quote, print a single quote then
begin quote again) when the path translation is required.
* Changed escape sequence from `'"'"'` to much shorter `'\''`.
* Reflected comments by the reviewer.
* Overhaul after addition of multiple path translation styles (not just
WSL but Cygwin and MSYS).
* More clarification both in the code and in the commit message.
* Minor clarification both in the code and in the commit message.
* #18006
* #16214
* #18195
This is a follow-up of #16214 and #18195, fixing #18006.
Closes#18006
Supersedes 7878728752
(cherry picked from commit ae90d52bb1)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgVEvdU
Service-Version: 1.22
`pathTranslationStyle` has four options:
- `none`: Do no translation
- `wsl`: Translate `C:\` to `/mnt/c` and `\\wsl$\Foo\bar` to `/bar`
- `cygwin`: Translate `C:\` to `/cygdrive/c`
- `msys2`: Translate `C:\` to `/c`
It is intended as a broadly-supported replacement for us checking the
source every time the user drops a path.
We no longer need to push the source name all the way down to the
control.
I am hesitant to commit to using other folks' product names in our
settings model,
however, these are almost certainly more recognizable than whatever
other weird
names we could come up with.
The Git Bash fragment extension profile could conceivably use
`pathTranslationStyle`
`msys2` to make sure drag/dropped paths look right.
(cherry picked from commit 068906714f)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgW9l6A
Service-Version: 1.22
This pull request introduces a new profile setting,
`compatibility.allowOSC52`, which defaults to `true`. When disabled, it
will not allow applications to write to the clipboard.
Security-minded folks may choose to disable it.
(cherry picked from commit 33556fb631)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgWpodA
Service-Version: 1.22
Adds a global Compatibility page to the settings UI. This page exposes
several existing settings and introduces a few new settings:
- compatibility.allowHeadless
- compatibility.isolatedMode
- compatibility.textMeasurement
- debugFeatures
This also adds a Terminal subpage for profiles in the settings UI. This
page includes:
- suppressApplicationTitle
- compatibility.input.forceVT
- compatibility.allowDECRQCRA
- answerbackMessage
Several smaller changes were accomplished as a part of this PR:
- `experimental.input.forceVT` was renamed to
`compatibility.input.forceVT`
- introduced the `compatibility.allowDECRQCRA` setting
- updated the schema for these new settings and
`compatibility.allowHeadless` (which was missing)
- add `Feature_DebugModeUI` feature flag to control if debug features
should be shown in the SUI
Verified accessible via Accessibility Insights
A part of #10000Closes#16672
(cherry picked from commit 18d86bca09)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgW9kBM
Service-Version: 1.22
As it turns out, you cannot use `<uap17:UpdateWhileInUse>`
(or any other newer namespace) unless you declare a corresponding
`MaxVersionTested` in your package manifest.
It does not appear that there's a reason for this, it just is.
`MaxVersionTested` is not to be confused with the `maxversiontested`,
which is something else entirely, but I updated it for safe measure.
Since `maxversiontested` is not a "max", but rather a list
of tested versions, it gets appended to the end of the list.
Closes#18119
(cherry picked from commit 32eeefd89e)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgVXHVQ
Service-Version: 1.22
* This fixes a regression in 391abafc, which caused attached clients
to receive CTRL_CLOSE_EVENTs, etc., in oldest-to-newest order,
while historically the opposite is expected.
* It also changes the behavior of `ProcessCtrlEvents` to dispatch
these events no matter whether a client is already dead.
This restores the Windows XP to Windows 8.1 behavior.
Both of these fixes would address the issue on their own.
Closes#15373
## Validation Steps Performed
* CloseTest from our repository shows newest-to-oldest order again.
* node gets killed when run under npm and closing the tab.
(cherry picked from commit 09d8ac44ad)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgVBZ1o
Service-Version: 1.22
This reverts commit 5fdfd51209,
because 3 people complained about this change VS 1 person
requesting the change to be made in the first place.
Closes#18138Reopens#17797 for discussion
(cherry picked from commit 220c7cd92e)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgUeWb8
Service-Version: 1.22
Apparently, we were using the package containing the CRT _source code_
to determine the version of the tools.
Also apparently, VS does not guarantee that that package has the same
version as the tools package.
We should use the version of the tools package instead.
(cherry picked from commit 8e4da6e938)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgWyLAQ
Service-Version: 1.22
As explained in the comment on `_getViewportCursorPosition`, printing
to stdout after initiating a cooked stdin reads is a race condition
between the application and the terminal. But we can significantly
reduce the likelihood of this being obvious with this change.
Related to #18265
Possibly related to #18081
## Validation Steps Performed
Execute the following Go code and start typing:
```go
package main
import (
"fmt"
"time"
)
func main() {
go func() {
time.Sleep(50 * time.Millisecond)
fmt.Printf("Here is a prompt! >")
}()
var text string
fmt.Scanln(&text)
}
```
Without this change the prompt will disappear,
and with this change in place, it'll work as expected. ✅
(cherry picked from commit 1040035b55)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgWppag
Service-Version: 1.22
Reroutes the `closeWindow` action to use the `CloseWindow()` method like
the window's X button does. This includes logic to display the
confirmation dialog.
Also removes `CloseRequested` as it was only used by this action
handler. We already have `CloseWindowRequested` so we're just using that
instead.
## Validation Steps Performed
✅ `closeWindow` action while multiple tabs opened brings up the
confirmation dialog
Closes#17613
(cherry picked from commit fb7b0e1218)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgWkUeU
Service-Version: 1.22
CodeQL is raising errors when building Visual Studio since they have a
dependency on Windows Terminal for our integrated terminal. The issue
raised by CodeQL refers to a non-constant string format, but in this
case the string comes from a resource file and should be considered
constant.
(cherry picked from commit 25392ea604)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgWYgYU
Service-Version: 1.22
Adds a description and keyword for the `SessionBecameInteractive` event
Follow-up from #17682
(cherry picked from commit 3772fc3fc5)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmszgWWlDk
Service-Version: 1.21
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgWWlDg
Service-Version: 1.22
Oops, it didn't support more than 100 items!
(cherry picked from commit 3e6690290f)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgWLtrU
Service-Version: 1.22
This is in support of some identity changes we need to make.
(cherry picked from commit a3a4464667)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgWLo5Y
Service-Version: 1.22
This increases the console IO buffer size to retain at least 128KiB as
this matches the default buffer size of `cat`. This avoids allocator
churn due to constantly freeing and reallocating buffers. In the future
this should ideally use a better suited, cheap allocator.
Closes#18286
(cherry picked from commit aa5459df4a)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgWLtjY
Service-Version: 1.22
CodeQL is raising errors when building Visual Studio since we have a
dependency on Windows Terminal for our integrated terminal. The issue
raised is not applicable to this case and therefore requires a
suppression comment to ignore the raised error.
(cherry picked from commit 19460f98e0)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgVqzyA
Service-Version: 1.22
The current `FindWindowOfActiveTSF` implementation can
result in infinite recursion which we must guard again.
This change is not tested as I don't know how to trigger
the issue to begin with (a missing CoreInput thread).
(cherry picked from commit 924310481a)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgVIDNA
Service-Version: 1.22
When file/folder is dropped to the terminal, its path is translated and
quoted with a pair of single quotes if necessary.
However, the terminal control does not escape single quotes (allowed in
the Win32 subsystem) that need escapes when translated.
On the translation styles other than `"none"` (note: all other
translation styles are currently intended for the POSIX shell), it
causes incorrect path to be pasted when the path contains one or more
single quotes (see #18006 for an example).
With this commit, the terminal control escapes a single quote with a
valid escape sequence `'\''` (finish quote, print a single quote then
begin quote again) when the path translation is required.
* Changed escape sequence from `'"'"'` to much shorter `'\''`.
* Reflected comments by the reviewer.
* Overhaul after addition of multiple path translation styles (not just
WSL but Cygwin and MSYS).
* More clarification both in the code and in the commit message.
* Minor clarification both in the code and in the commit message.
* #18006
* #16214
* #18195
This is a follow-up of #16214 and #18195, fixing #18006.
Closes#18006
(cherry picked from commit ae90d52bb1)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgVEvdU
Service-Version: 1.22
microsoft/vcpkg-tool#1474 now validates that the target triplet is
valid. Unfortunately, `ARM64` is not valid... despite VS defaulting to
it.
VS 17.12 moved to the newer version of the vcpkg tool.
Given that we still want to build on VS 17.12, this commit adds a local
workaround.
See DD-2302065 for the internal tracking bug.
See microsoft/vcpkg#42182 for the upstream fix.
(cherry picked from commit 6047f37e84)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgVEH-w
Service-Version: 1.22
This slightly modifies the builtin glyph width and corner radius to
more closely match Cascadia Mono. Previously, at low DPI (100% scale),
the corner radius was barely noticeable which looked kind of bad.
(cherry picked from commit a8e83c1c0f)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgU6YuY
Service-Version: 1.22
## Summary of the Pull Request
Adds a "Move tab" submenu to the tab's context menu. This submenu includes "move tab to new window", "move left", and "move right".
The new "move left/right" items are disabled if the tab can't be moved in a certain direction.'
Closes#17900
(cherry picked from commit d8089e903e)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgU6Yu8
Service-Version: 1.22
The original intent with dynamic profiles was that they could be
uninstalled but that Terminal would remember your settings in case they
ever came back.
After we implemented dynamic profile _deletion_, however, we
accidentally made it so that saving your settings after a dynamic
profile disappeared scoured it from the planet _forever_ (since we
remembered that we generated it, but now it was no longer in the
settings file).
This pull request implements:
- Tracking for orphaned dynamic profiles
Closes#14061Closes#11510
Refs #13916
Refs #9997
Modified for 1.22. I am not including any of the UI affordances.
(cherry picked from commit 90866c7c93)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgU1-p4
Service-Version: 1.22
"HighContrast" is not a possible requested theme. So `_UpdateBackgroundForMica()` would force the settings UI to be light or dark. To fix this, we just check if we're in high contrast mode and, if so, we don't bother setting the requested theme.
(cherry picked from commit d04381ec05)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgUZ6Mc
Service-Version: 1.22
Turns out that having the styles for the KeyChordText and ParsedCommandLineText be empty for high contrast mode caused the issue. Since we're already using theme resources for the colors, we automatically adjust properly to whatever the high contrast theme is (Thanks XAML!).
Bonus points:
- we didn't need the theme dictionaries anymore, so I just moved them to the ResourceDictionary directly
- ParsedCommandLineTextBlockStyle isn't used. So I removed it altogether.
Validated command palette with multiple high contrast themes. See PR thread for demo.
Closes#17914
(cherry picked from commit e83434ff7e)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgUZ6Mo
Service-Version: 1.22
This adds a basic policy check for DisabledProfileSources, so that
organizations can easily disable certain profiles like the Azure one.
Closes#17964
## Validation Steps Performed
* Add a policy to disable Azure under HKCU. Disabled ✅
* Add a policy to disable nothing under HKLM. Enabled ✅
(...because it overrides the HKCU setting.)
(cherry picked from commit 3a06826915)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgT6i0c
Service-Version: 1.22
The settings UI and settings model allow you to set the icon to "none"
to hide the icon (you can actually see this effect in the settings UI
when changing the value of the profile icon). However, during settings
validation, "none" is considered a file path, which is then failed to be
parsed, resulting in the icon being marked as invalid and immediately
clearing the value.
This PR fixes this issue by considering "none" to be an accepted value
during validation.
Related to #15843Closes#17943
## Validation Steps Performed
When an icon is set to "none", ...
✅ no more warning
✅ the icon is hidden
(cherry picked from commit 36f064cfc8)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgTyV8E
Service-Version: 1.22
This fixes a lot of subtle issues:
* Avoid emitting another de-/iconify VT sequence when
we encounter a (de)iconify VT sequence during parsing.
* Avoid emitting a de-/iconify VT sequence when
a focus event is received on the signal pipe.
* Avoid emitting such sequences on startup.
* Avoid emitting multiple such sequences
when rapidly un-/focusing the window.
It's also a minor cleanup, because the `GA_ROOTOWNER` is not security
relevant. It was added because there was concern that someone can just
spawn a ConPTY session, tell it that it's focused, and spawn a child
which is now focused. But why would someone do that, when the console
IOCTLs to do so are not just publicly available but also documented?
I also disabled the IME window.
## Validation Steps Performed
* First:
```cpp
int main() {
for (bool show = false;; show = !show) {
printf(show ? "Show in 3s...\n" : "Hide in 3s...\n");
Sleep(3000);
ShowWindow(GetConsoleWindow(), show ? SW_SHOW : SW_HIDE);
}
}
```
* PowerShell 5's `Get-Credential` gains focus ✅
* `sleep 5; Get-Credential` and focus another app. WT should start
blinking in the taskbar. Restore it. The popup has focus ✅
* Run `:hardcopy` in vim: Window is shown centered at (0,0) ✖️
But that's okay because it does that already anyway ✅
* `Connect-AzAccount` doesn't crash PowerShell ✅
(cherry picked from commit 4386bf07fd)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgTs61k
Service-Version: 1.22
This adds a "defaultInputScope" setting, hooks it up to our TSF,
and exposes it as a setting in the UI under the startup page.
In order to stay close with the other language setting, I moved that
one from the appearance to the startup page as well.
20 out of the 26 files in this PR are boilerplate unfortunately.
Closes#17816
## Validation Steps Performed
* Install and use the Chinese IME
* Launch WT
* Chinese input ✅
* Change setting to `alphanumericHalfWidth`
* Restart WT
* English input ✅
(cherry picked from commit fc606d2bae)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgTTKAI
Service-Version: 1.22
## Summary of the Pull Request
This improves our `RIS` (hard reset) implementation, so it now also
resets any changes that are made to the color table and color aliases,
which is one of the things it's supposed to be doing.
## References and Relevant Issues
This is also a small step towards implementing the `OSC` sequences that
reset individual color table entries (issue #3719).
## Detailed Description of the Pull Request / Additional comments
The way this works is by having a second copy of the color table and
alias indices to hold the default values in the `RenderSettings` class.
This default set is initially populated at startup with the user's
chosen color scheme, but can also potentially be updated if the user
changes their settings while a session is already in progress.
When we receive an `RIS` request, we just copy the default values back
over the active settings, and refresh the renderer.
## Validation Steps Performed
I've manually tested both OpenConsole and Windows Terminal by changing
my color scheme programmatically, and then confirming that the original
colors are restored when an `RIS` sequence is received.
I've also added some basic unit tests that check both the color aliases
and color table are restored by `RIS`.
## PR Checklist
- [x] Tests added/passed
(cherry picked from commit 5e8e10fdc0)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgTTOyY
Service-Version: 1.22
`AutoSuggestBox` has a `SuggestionChosen` event and any reasonable
person would assume that this means one of the items was chosen.
But with WinUI it's raised whenever a suggestion is merely highlighted.
`QuerySubmitted` is the right event instead. Clearly that naming is
a lot better than `SuggestionChosen`, since the property to get the
chosen item is called `ChosenSuggestion`.
WinUI, like the unrelenting wilderness of a world indifferent to human
suffering, stands as a testament to the futility of human aspiration.
Closes#17916
## Validation Steps Performed
* Type "Casc"
* Move up/down with the arrow keys
* Neither the filtered list nor the text updates ✅
* Press Enter on an item
* Text updates ✅
(cherry picked from commit bcac9993cb)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgTW9-o
Service-Version: 1.22
Adds a theme resource for the color of the reset button in the settings UI.
Closes#17902
(cherry picked from commit 0bd19e9cfc)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgTTb0w
Service-Version: 1.22
Without a VT "renderer" there's no implicit output anymore when
calling `ClearPseudoConsole`. The fix is trivial, but it works
slightly different from before: Previously, we would preserve
the line the cursor is on, while this PR doesn't do that.
I felt like there's not much merit in preserving the line,
because it may be a multi-line prompt which won't work with that.
Closes#17867
## Validation Steps Performed
Bind 3 different actions to the 3 variants of "Clear buffer"
and test them. They work. ✅
(cherry picked from commit 4259ce535f)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgS3NbU
Service-Version: 1.22
* Don't reset the position entirely when changing the needle
* Don't change the scroll position when output arrives
* Don't interfere with the search when output arrives constantly
Closes#17301
## Validation Steps Performed
* In pwsh, run `10000..20000 | % { sleep 0.25; $_ }`
* You can search for e.g. `1004` and it'll find 10 results. ✅
* You can scroll up and down past it and it won't snap back
when new output arrives. ✅
* `while ($true) { Write-Host -NoNewline "`e[Ha"; sleep 0.0001; }`
* You can cycle between the hits effortlessly. ✅ (This tests that
the constantly reset `OutputIdle` event won't interfere.)
* On input change, the focused result is near the previous one. ✅
(cherry picked from commit d9131c6889)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgS3elo PVTI_lADOAF3p4s4AmhmQzgTEciM
Service-Version: 1.22
Because `_layoutLine` would never return `column == columnLimit` for
control character visualizers, we'd get a deadlock in `_redisplay`,
as it tries to fill the line until it's full, but never achieve it.
Closes#17893
## Validation Steps Performed
* Press Ctrl-A to insert "^A"
* Press Home to get to the start of the prompt
* Press and hold "A" until the line wraps
* The line wraps and there's no deadlock ✅
(cherry picked from commit 0ce654eaf6)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgTEJwI
Service-Version: 1.22
## Summary of the Pull Request
The sixel parser has an internal buffer that holds the indexed-color
representation of the image, prior to it being translated to RGB. This
buffer only retains the section of the image that is within the visible
viewport, so we're continually erasing segments from the top of it when
the image is large enough to trigger a scroll.
But there is a problem that arises if the window or font is resized so
that the buffer needs to reflow, because that can result in the image
being pushed entirely offscreen. At that point the segment we're trying
to erase is actually larger than the buffer itself, which can end up
causing the terminal to crash
To fix this, we just need to check for an oversized erase attempt and
simply clear the buffer instead.
## Validation Steps Performed
I could easily reproduce this crash in Windows Terminal by resizing the
font while viewing an animated gif with img2sixel. With this PR applied
the crash no longer occurs.
## PR Checklist
- [x] Closes#17947
(cherry picked from commit fc586e2662)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgTTKv4
Service-Version: 1.22
This just adds a quick registry check for `EnableHexNumpad`.
Depends on #17774Closes#17762 (again)
## Validation Steps Performed
* Alt + NumpadAdd + 221E doesn't do anything ✅
* Set the `EnableHexNumpad` registry key
* Restart
* Alt + NumpadAdd + 221E inserts ∞ ✅
(cherry picked from commit b520da26d4)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgTQseA
Service-Version: 1.22
## Summary of the Pull Request
Fixes some issues with truncated text in the settings UI when 200% text
scaling is applied.
For #17897, a minimum height was applied instead of a plain "height".
This ensures that the desired height is applied in general, but under
200% text scaling, we are allowed to grow past that, thus preventing the
truncation of the text.
For #17898, flyouts have a scroll viewer inside them by default. We
actually don't want the scroll viewer because that means the text will
appear "truncated" when in reality, the user is expected to notice the
small scrollbar and scroll horizontally (why that's the default, I will
never know). This PR introduces a new style that can be applied to these
flyouts to cause text wrapping instead of horizontal scrolling. Looked
through the app for any instances where this happens.
For #12006, simply changing the column width from a static value to
"auto" fixes the issue. Frankly, we care more about the text appearing
as a whole (and as whole words). The name of the actions wrap properly
anyways.
Closes#17897Closes#17898Closes#12006
(cherry picked from commit a7e47b711a)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgTEfj8
Service-Version: 1.22
The underlying issue is that the "Pane" is used both as a model and as
a UI element and so a pane loses its content as soon as it is closed,
but the tree only gets reordered after the animation has finished.
This PR is truly just a hotfix, because it doesn't solve this issue,
it only adds checks to the function that crashes.
Closes#17869Closes#17871
## Validation Steps Performed
* `Split pane` a few times
* Run the "Close all other panes" action
* Doesn't crash ✅
(cherry picked from commit bc6f3e2275)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgS3Ndk PVTI_lADOAF3p4s4AmhmQzgTEJYM
Service-Version: 1.22
PackageES is deprecated by known scourge-on-earth OneBranch, and is now
the cause of some non-compliance.
I got permission from them to open-source it, so that's coming next.
For now, we can just depend on a package based on our code based on
theirs.
Tested and working for C++ (DLL, EXE), C#, NuGet and MSIX.
(cherry picked from commit 4aa1624cd2)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgTD8is
Service-Version: 1.22
whoops. This should have been in preview after I sorted out #17366
----
I did this one on GH so let's hope CI works
(cherry picked from commit c699a468c9)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgS66Co
Service-Version: 1.22
Added tab color indicator for the tab switch menu. Tab color indicators
have the same color as the background color of the tabs. If a tab has
the default background color, the indicator is not shown in the tab
switch menu.
Closes#17465
(cherry picked from commit 544452dad4)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgS0CZA
Service-Version: 1.22
By translating the clip rectangle into a source-relative coordinate
space we can calculate the intersection that must be copied
much much more easily. I should've done that from the start.
Closes#17801
## Validation Steps Performed
* Test code provided in #17801
(cherry picked from commit d2c3cfd164)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgSa7nQ
Service-Version: 1.22
## Summary of the Pull Request
When an app makes a VT request that returns a `DCS` response, and it
hasn't also enabled VT input mode, the new passthrough implementation
loses that response. All the app receives is an `Alt`+`\` key press
triggered by the `ST` terminator. This PR fixes that issue.
## References and Relevant Issues
This is one of the unresolved issues tracked in #17643.
## Detailed Description of the Pull Request / Additional comments
The way `DCS` sequences are handled in the input state machine engine is
by returning a nullptr from `ActionDcsDispatch`, which tells the state
machine to ignore that content. But the sequence is still buffered, and
when the `ST` terminator is eventually received, that buffer is flushed,
which passes the whole thing through to the app.
Originally this only worked when VT input mode was enabled, otherwise
the `ST` sequence is converted into a key press, and the buffered `DCS`
content is lost. The way it works now is we set a flag when the `DCS`
introducer is received, and if that flag is set when the `ST` arrives,
we know to trigger a flush rather a key press.
## Validation Steps Performed
I've tested a `DA3` request from the cmd shell (i.e. `echo ^[[=c`), and
confirmed that now works as expected. I've also hacked Windows Terminal
to disable win32-input mode, so I could check how it works with conpty
clients generating standard VT input, and confirmed that an `Alt`+`\`
keypress is still translated correctly.
(cherry picked from commit 6e5827add5)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgSwKBc
Service-Version: 1.22
Under ConPTY we don't load any user settings. `SetUpConsole` notes:
> If we are [ConPTY], we don't want to load any user settings,
> because that could result in some strange rendering results [...]
This enables deduplication by default, which I figured wouldn't cause
any regressions since it's a user-controllable setting anyway, while
it's clearly something the average user wants enabled, for the same
reason that PSReadLine has HistoryNoDuplicates enabled by default.
Closes#17797
## Validation Steps Performed
* Launch conhost, enter 2 commands, press F7, select the older one,
press Enter, press F7. 2 entries ✅
* Launch WT, enter 2 commands, press F7, select the older one,
press Enter, press F7. 2 entries ✅
(cherry picked from commit 5fdfd51209)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgSN1FQ
Service-Version: 1.22
`GetChar` checks if the vkey is VK_ESCAPE. `CharToKeyEvents` however
tries really hard to figure out the vkeys of all characters.
To avoid these issues all we need to do is to simply use the existing
`WriteString` function we already use for all other VT responses.
If it's good for conhost responses, it's good for ConPTY responses.
Additionally, this removes another `IsVtInputEnabled` which was
redundant with `WriteString` which worked exactly the same internally.
Closes#17813Closes#17851
Probably also related to #17823
* Wrote a small app to send and receive a DA1 request. It works ✅
* WSL already worked to begin with (and still works now) ✅
* No double-encoding of mouse input events ✅
(cherry picked from commit 7b50f12a78)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgSa4RU PVTI_lADOAF3p4s4AmhmQzgStRA0
Service-Version: 1.22
Worked with @ekoschik on this one.
## Bug the first: the MSAL window `ixptools` spawns
> The auth prompt in pwsh.exe is disabling the terminal window while its
opened and re-enabling it when the window closes. BUT it is enabling
Terminal after dismissing itself, instead of before, which means
terminal is disabled when activated.
>
> Terminal wants focus on the ISLAND window (a grandchild; island is
parented to bridge, which is parented to terminal’s TLW). When it is
activated, it gets a `WM_SETFOCUS` (in response to DefWindowProc
`WM_ACTIVATE`). From `WM_SETFOCUS` it calls `SetFocus` on the bridge
window, and similarly the bridge calls `SetFocus` on the island.
>
> If the TLW is disabled, these `SetFocus` calls fail (see [this
check](#internal-link-redacted) in `SetFocus`). In the case above, this
leaves Terminal’s TLW as focus, and it doesn’t handle keyboard input.
Note that the window IS foreground/active, but because focus is not on
the island it doesn’t see the keyboard input. Another thing to note is
that clicking on the space to the right of the tabs does NOT revive
keyboard input, but clicking on the tabs or main area does.
> **I recommend having the TLW handle WM_ENABLE and call SetFocus on the
island window.**
And guess what, that works!
## Bug the second: When sublime text is the git `EDITOR`, it doesn't
toss focus back to the Terminal
> In this case, Sublime is calling SFW on the pseudo console window. I
don’t have its code, but it is presumably doing something like
SetForegroundWindow(GetConsoleWindow()). This queues an event to the
pseudo window, and when that event is processed the pseudo window
becomes the active and focus window on the queue (which is shared with
Terminal).
>
> The sublime window dismisses itself and does the above SFW call.
Dismissing immediately activates the Terminal TLW, which does the
triple-focus dance (TLW sets focus on itself, then bridge, then island).
This completes but is overwritten immediately when the pseudo window
activates itself. Note that the pseudo window is active at this point
(not the terminal window).
> **I recommend having the Pseudo console window handle WM_ACTIVATE by
calling SetFocus on the island window (and not passing the message to
DefWindowProc).**
And guess what, that works!
----
Closes#15956 (I did test this)
This might be related to #13388, we'll have folks try canary and check
(cherry picked from commit 17a55da0f9)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgSwIkE
Service-Version: 1.22
Spacing marks are called so, because they have a positive advance
width, unlike their non-spacing neighbors (as the name indicates).
After this we stop assigning such gc=Mc codepoints a zero width.
Closes#17810
(cherry picked from commit 0cb3426281)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgSg1L4
Service-Version: 1.22
## Summary of the Pull Request
Add action IDs to the default commands for color selection
## Validation Steps Performed
Color selection commands now show up in the command palette
## PR Checklist
- [x] Closes#17819
- [ ] Tests added/passed
- [ ] Documentation updated
- If checked, please file a pull request on [our docs
repo](https://github.com/MicrosoftDocs/terminal) and link it here: #xxx
- [ ] Schema updated (if necessary)
(cherry picked from commit 1482fd4ecd)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgSawsY PVTI_lADOAF3p4s4AmhmQzgSwIVc
Service-Version: 1.22
## Summary of the Pull Request
When a VT title sequence sets the title to a blank string, that is meant
to trigger a reset to the default starting value. This used to work in
the past because the blank value was dealt with by conhost, so Windows
Terminal never received a blank title, but that's no longer the case
with the new VT passthrough. This PR fixes the issue by getting Windows
Terminal to handle the blank title strings itself.
## References and Relevant Issues
VT passthrough was introduced in PR #17510.
## Validation Steps Performed
I've manually verified that the `OSC 0`, `OSC 2`, and `DECSWT` sequences
now correctly reset the title when passed a blank title string.
## PR Checklist
- [x] Closes#17800
(cherry picked from commit 1f71568c2a)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgSNvr0 PVTI_lADOAF3p4s4AmhmQzgSOFrc
Service-Version: 1.22
"description":"When set to true, the terminal will focus the pane on mouse hover.",
"type":"boolean"
},
"compatibility.allowHeadless":{
"default":false,
"description":"When set to true, Windows Terminal will run in the background. This allows globalSummon and quakeMode actions to work even when no windows are open.",
"type":"boolean"
},
"compatibility.isolatedMode":{
"default":false,
"description":"When set to true, Terminal windows will not be able to interact with each other (including global hotkeys, tab drag/drop, running commandlines in existing windows, etc.). This is a compatibility escape hatch for users who are running into certain windowing issues.",
"type":"boolean"
},
"compatibility.textMeasurement":{
"default":"graphemes",
"description":"This changes the way incoming text is grouped into cells. The \"graphemes\" option is the most modern and Unicode-correct way to do so, while \"wcswidth\" is a common approach on UNIX, and \"console\" replicates the way it used to work on Windows.",
"enum":[
"graphemes",
"wcswidth",
"console"
]
},
"copyFormatting":{
"default":true,
"description":"When set to `true`, the color and font formatting of selected text is also copied to your clipboard. When set to `false`, only plain text is copied to your clipboard. An array of specific formats can also be used. Supported array values include `html` and `rtf`. Plain text is always copied.",
@@ -2458,11 +2473,6 @@
"minimum":1,
"type":"integer"
},
"startOnUserLogin":{
"default":false,
"description":"When set to true, this enables the launch of Terminal at startup. Setting this to false will disable the startup task entry. If the Terminal startup task entry is disabled either by org policy or by user action this setting will have no effect.",
"type":"boolean"
},
"firstWindowPreference":{
"default":"defaultProfile",
"description":"Defines what behavior the terminal takes when it starts. \"defaultProfile\" will have the terminal launch with one tab of the default profile, and \"persistedWindowLayout\" will cause the terminal to save its layout on close and reload it on open.",
@@ -2699,6 +2709,16 @@
"description":"When set to true, when opening a new tab or pane it will get reloaded environment variables.",
"type":"boolean"
},
"compatibility.allowDECRQCRA":{
"default":false,
"description":"When set to true, the terminal will support the DECRQCRA (Request Checksum of Rectangular Area) escape sequence.",
"type":"boolean"
},
"compatibility.allowOSC52":{
"default":true,
"description":"When set to true, VT applications will be allowed to set the contents of the local clipboard using OSC 52 (Manipulate Selection Data).",
"type":"boolean"
},
"unfocusedAppearance":{
"$ref":"#/$defs/AppearanceConfig",
"description":"Sets the appearance of the terminal when it is unfocused.",
@@ -3079,6 +3099,17 @@
"default":false,
"description":"When set to true, the window will have an acrylic material background. When set to false, the window will have a plain, untextured background.",
"type":"boolean"
},
"pathTranslationStyle":{
"default":"none",
"description":"Controls how file paths are transformed when they are dragged and dropped on the terminal. Possible values are \"none\", \"wsl\", \"cygwin\" and \"msys2\".",
<string id="SUPPORTED_WindowsTerminal_1_21">At least Windows Terminal 1.21</string>
<string id="SUPPORTED_DefaultTerminalApplication">At least Windows 11 22H2 or Windows 10 22H2 (Build 19045.3031, KB5026435) with Windows Terminal 1.17</string>
<string id="DisabledProfileSourcesText">Profiles will not be generated from any sources listed here. Source names can be arbitrary strings. Potential candidates can be found as the "source" property on profile definitions in Windows Terminal's settings.json file.
Common sources are:
- Windows.Terminal.Azure
- Windows.Terminal.PowershellCore
- Windows.Terminal.Wsl
For instance, setting this policy to Windows.Terminal.Wsl will disable the builtin WSL integration of Windows Terminal.
Note: Existing profiles will disappear from Windows Terminal after adding their source to this policy.</string>
<string id="DefaultTerminalApplicationText">Select the default terminal application used in Windows.
If you select Windows Terminal Preview and it is not installed the system will fallback to the legacy Windows Console Host. (Please note that the settings interfaces showing "Let windows decide" in this case as configuration.)</string>
<string id="TermAppAutomatic">Automatic selection (Windows Terminal, if available)</string>
<value>Terminál Windows s náhledem připravovaných funkcí</value>
@@ -164,11 +164,11 @@
<comment>This is a menu item that will be displayed in the Windows File Explorer that launches the Canary version of Windows Terminal. Please mark one of the characters to be an accelerator key.</comment>
<comment>This is a menu item that will be displayed in the Windows File Explorer that launches the Preview version of Windows Terminal. Please mark one of the characters to be an accelerator key.</comment>
<comment>This is a menu item that will be displayed in the Windows File Explorer that launches the non-preview version of Windows Terminal. Please mark one of the characters to be an accelerator key.</comment>
<value>Terminál Windows s náhledem připravovaných funkcí</value>
@@ -164,11 +164,11 @@
<comment>This is a menu item that will be displayed in the Windows File Explorer that launches the Canary version of Windows Terminal. Please mark one of the characters to be an accelerator key.</comment>
<comment>This is a menu item that will be displayed in the Windows File Explorer that launches the Preview version of Windows Terminal. Please mark one of the characters to be an accelerator key.</comment>
<comment>This is a menu item that will be displayed in the Windows File Explorer that launches the non-preview version of Windows Terminal. Please mark one of the characters to be an accelerator key.</comment>
<value>O sistema não pode encontrar o arquivo especificado.</value>
</data>
</root>
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.