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 354e05d7139d00ae4c6d7ca84caa074bfd030131)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgZRM3Y
Service-Version: 1.23
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 90c312f7da9499cf97c4f0575db4e69ff8352ee9)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgZX2Dc
Service-Version: 1.23
This ensures that the vertical scrollbar will not cover the description text.
Closes#18545
(cherry picked from commit f83b98e100ff9ba8dc244d820ab79604f20ed373)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgZX-v4
Service-Version: 1.23
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 f34dbbf3ac1c4bd646732aa7b694553e4db97d64)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgYvOo8
Service-Version: 1.23
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 a46fac25d3264fdb29dd2b70ec33f3b5e4f3540f)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgYvOuc
Service-Version: 1.23
It has a Component Governance alert (and no license), plus we aren't using it.
(cherry picked from commit f023b3bfd2a578615d2d94d8991fc274076c665e)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgYf3cs
Service-Version: 1.23
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 70f85a4a35ea4b050d5d8bd9a2f3f7f177f990ed)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgYdERw
Service-Version: 1.23
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 6e8924237351d57eccf7af6726ab1746f1404401)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgYdEEE
Service-Version: 1.23
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 7d8f7eb42994829e9f6f7a9d1d2a572b4b13e4ef)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgYVTtY
Service-Version: 1.23
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 32ae00f71a10b727c355c49699a1b78dfd9e26cf)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgYO0a4
Service-Version: 1.23
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 2693210ead2bf8aaccac6b67074c55ece9e20cf2)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgYKe9E PVTI_lADOAF3p4s4AxadtzgYLZvY
Service-Version: 1.23
This can be considered "part 1" of fixing #18599: It prevents crashes
(due to unhandled exceptions) by ensuring we only create 1 content
dialog across all windows at a time. Sounds bad, but I tried it and it's
not actually _that_ bad in practice (it's still really gross though).
The bad news is that I don't have a "part 2", because I can't figure out
what's going on:
* Create 2 windows
* Open the About dialog in window 1
and right click the text
* Close the About dialog
* Open the About dialog in window 2
and right click the text
* WinUI will simply toss the focus to window 1
It appears as if context menus are permanently associated with the first
window that uses them. It has nothing to do with whether a ContentDialog
instance is reused (I tested that).
## Validation Steps Performed
* Open 2 windows with 2 tabs each
* Attempt to close window 1, dialog appears ✅
* Attempt to close window 2, dialog moves to window 2 ✅
(cherry picked from commit 3760caed97fa9140a40777a8fbc1c95785e6d2ab)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgXyCU0
Service-Version: 1.23
The logic didn't work when persistence was enabled and you had 2 windows
and closed the 2nd one, or when dragging the last tab out of the only
window.
## Validation Steps Performed
* 2 windows, close the 2nd one, app doesn't exit ✅
* 1 window, 1 tab, drag the tab out of the window, app doesn't exit ✅
(cherry picked from commit 96d1407c5928330dc4cf4b3411d5bcd84341b310)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgXxggc
Service-Version: 1.23
Does what it says on the tin.
Closes#18525
## Validation Steps Performed
* Enable persistence
* Close the last window
* Persisted ✅
(cherry picked from commit e1be2f4c73b8a8d55e07a9499a72d7b943ac3fe7)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgXpj9o
Service-Version: 1.23
I don't actually know why this is happening, because it doesn't
happen with startup actions specified in the settings file.
In any case, it's fixed with more delays.
Closes#18572
## Validation Steps Performed
* Create a tab with 2 panes
* Tear it off into a new window
* New window has 1 tab with 2 panes ✅
(cherry picked from commit e1b28e72b39bf1adae9e02b550c4810a5f4e221c)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgXTsJY PVTI_lADOAF3p4s4AxadtzgXsQ6w
Service-Version: 1.23
Missed a few `_getTerminalPosition()` on the first run. Disabled
rounding for pointer movements and mouse wheel events (which are used
for hyperlink hover detection and vt mouse mode). The only time we round
now is...
- `SetEndSelectionPoint()` --> because we're updating a selection
- `ControlCore->LeftClickOnTerminal()` --> where all paths are used for
selection*
*the only path that doesn't is `RepositionCursorWithMouse` being
enabled, which also makes sense based on clicking around Notepad with a
large font size.
## References and Relevant Issues
Follow-up for #18486Closes#18595
## Validation Steps Performed
In large font size, play around with midnight commander and hover over
hyperlink edges.
(cherry picked from commit e5b972a828cf8749a55a9822b95eea39e4fdd389)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgXgv1c
Service-Version: 1.23
* `_ApplyLanguageSettingChange` calls `PrimaryLanguageOverride`
(the WinRT API function) and we would call it every time a new
window is created. Now it's only called on settings load.
* `_RegisterTabEvents` would listen for "Content" changes which can
be null. `IVector::Append` throws if a null object is given.
In our case, it's null if the content got erased with nothing.
Additionally, this fixes a bug where we wouldn't call
`_ProcessLazySettingsChanges` on startup. This is important if the
settings file was changed while Windows Terminal wasn't running.
Lastly, there's a lifetime fix in this PR, which is a one-line change
and I didn't want to make a separate PR for that.
(cherry picked from commit ff9664d2d45349193ac2a17ffedf9d26128f8699)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgXsQ60
Service-Version: 1.23
When the server handle gets closed on conhost (= terminal is gone),
and e.g. PowerShell is used, we would previously log 6 error messages.
This PR reduces it to zero, by removing the 3 biggest offenders.
(cherry picked from commit 0df82681fe057d292f64c424d493e05cb1bfe121)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgXsQ64
Service-Version: 1.23
## Summary of the Pull Request
There's already logic to tab to a hyperlink when we're in mark mode. We
do this by looking at the automatically detected hyperlinks and finding
the next one of interest. This adds an extra step afterwards to find any
embedded hyperlinks and tab to them too.
Since embedded hyperlinks are stored as text attributes, we need to
iterate through the buffer to find the hyperlink and it's buffer
boundaries. This PR tries to reduce the workload of that by first
finding the automatically detected hyperlinks (since that's a fairly
quick process), then using the reduced search area to find the embedded
hyperlink (if one exists).
## Validation Steps Performed
In PowerShell, add an embedded hyperlink as such:
```powershell
${ESC}=[char]27
Write-Host "${ESC}]8;;https://github.com/microsoft/terminal${ESC}\This is a link!${ESC}]8;;${ESC}\"
```
Enter mark mode (ctrl+shift+m) then shift+tab to it.
✅ The "This is a link!" is selected
✅ Verified that this works when searching forwards and backwards
Closes#18310Closes#15194
Follow-up from #13405
OSC 8 support added in #7251
(cherry picked from commit 35bd60782fec6486e6f7fd10ffa4d9c5de70790d)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgXBDb8
Service-Version: 1.23
WinUI asynchronously updates its tab view items, so it may happen that
we're given a `TabViewItem` that still contains a `TabBase` which has
actually already been removed. Regressed in #15924.
Closes#18581
## Validation Steps Performed
* Close tabs rapidly with middle click
* No crash ✅
(cherry picked from commit 62e7f4bfade3b5dc655f1c8d8c0ceb49d89faf24)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgXpjpM PVTI_lADOAF3p4s4AxadtzgXsRQM
Service-Version: 1.23
This is a theoretical fix for #18584 as I cannot reproduce the issue
anymore. It did happen briefly on one of my devices though, and at the
time I observed that it would persist a window with no startup actions.
(cherry picked from commit 265d8415094f41e161c2287aa80876b82d809c0c)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgXpj1U
Service-Version: 1.23
Found this one completely randomly.
## Validation Steps Performed
* Open 2 windows with 1 tab each
* Click the X button on the tab in the 1st window
* OpenConsole/etc. is cleaned up ✅
---------
Co-authored-by: Dustin L. Howett <duhowett@microsoft.com>
(cherry picked from commit c7f0d0addb38f04b846f15fd27131155692082e6)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgXpjzk
Service-Version: 1.23
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 733a5e7becd86400323c0536a86d88021b3748fb)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgXjzIg
Service-Version: 1.23
Fixes an issue on Windows 10 where icon on selected color chips would be
missing in the NullableColorPicker.
Fixes (or at least significantly improves the experience) text being
truncated for the special colors in the NullableColorPicker. This was
done by removing the word "Use" from the labels and adding a visual
state trigger to change the layout of the chips and buttons when the
window becomes narrow.
Related to #18318
(cherry picked from commit 7423dd3b2a8726631f1c4c0a0c7b5f9fcd7def08)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgXARtg
Service-Version: 1.23
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 e60acbc12a14861a97a1db42d6b1dba8818d441d)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgW-IC0
Service-Version: 1.23
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 2e92a15464929401bf10f94d7ca5ebce62dc0a11)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgW9xcU
Service-Version: 1.23
## Summary of the Pull Request
Fixes a bug where VT mouse mode would round to the nearest cell when
clicking the mouse button.
The fix is to round to the nearest cell only when we're selecting text.
The other scenarios affected are:
- clicking on a hyperlink
- vt mouse mode
- where the context menu is anchored
Really the most notable ones were the first two. So now, we use the
position of the cell we clicked on. We only round for selection.
## References and Relevant Issues
Follow-up to #18106
## Detailed Description of the Pull Request / Additional comments
## Validation Steps Performed
Opened Midnight Commander in Ubuntu and clicked between the two panes.
- Before: threshold was too early to switch between panes
- After: threshold is clearly separated between the outline of the two
panes
---------
Co-authored-by: Dustin L. Howett <duhowett@microsoft.com>
This PR allows users to enable the tab bar in fullscreen mode.
A new setting; "showTabsFullscreen"; has been added which accepts a
boolean value. When `true`, then the tab bar will remain visible when
the terminal app is fullscreen. If the value is `false` (default), then
the tab bar is hidden in fullscreen.
When the tab bar is visible in fullscreen, the min/max/close controls
are hidden to maintain the expected behaviour of a fullscreen app.
## Validation Steps Performed
All unit tests are passing.
Manually verified that when the "launchMode" setting is "fullscreen" and
the "showTabsFullscreen" setting is `true`, the tab bar is visible on
launch.
Manually verified that changing the setting at runtime causes the tab
bar to be shown/hidden immediately (if the terminal is currently
fullscreen).
Manually verified that the new "showTabsFullscreen" setting is honoured
regardless of whether "showTabsInTitlebar" is set to `true` or `false`.
Closes#11130
Selection is generally stored as an inclusive start and end. This PR
makes the end exclusive which now allows degenerate selections, namely
in mark mode. This also modifies mouse selection to round to the nearest
cell boundary (see #5099) and improves word boundaries to be a bit more
modern and make sense for degenerate selections (similar to #15787).
Closes#5099Closes#13447Closes#17892
## Detailed Description of the Pull Request / Additional comments
- Buffer, Viewport, and Point
- Introduced a few new functions here to find word boundaries, delimiter
class runs, and glyph boundaries.
- 📝These new functions should be able to replace a few other functions
(i.e. `GetWordStart` --> `GetWordStart2`). That migration is going to be
a part of #4423 to reduce the risk of breaking UIA.
- Viewport: added a few functions to handle navigating the _exclusive_
bounds (namely allowing RightExclusive as a position for buffer
coordinates). This is important for selection to be able to highlight
the entire line.
- 📝`BottomInclusiveRightExclusive()` will replace `EndExclusive` in the
UIA code
- Point: `iterate_rows_exclusive` is similar to `iterate_rows`, except
it has handling for RightExclusive
- Renderer
- Use `iterate_rows_exclusive` for proper handling (this actually fixed
a lot of our issues)
- Remove some workarounds in `_drawHighlighted` (this is a boundary
where we got inclusive coords and made them exclusive, but now we don't
need that!)
- Terminal
- fix selection marker rendering
- `_ConvertToBufferCell()`: add a param to allow for RightExclusive or
clamp it to RightInclusive (original behavior). Both are useful!
- Use new `GetWordStart2` and `GetWordEnd2` to improve word boundaries
and make them feel right now that the selection an exclusive range.
- Convert a few `IsInBounds` --> `IsInExclusiveBounds` for safety and
correctness
- Add `TriggerSelection` to `SelectNewRegion`
- 📝 We normally called `TriggerSelection` in a different layer, but it
turns out, UIA's `Select` function wouldn't actually update the
renderer. Whoops! This fixes that.
- TermControl
- `_getTerminalPosition` now has a new param to round to the nearest
cell (see #5099)
- UIA
- `TermControlUIAProvider::GetSelectionRange` no need to convert from
inclusive range to exclusive range anymore!
- `TextBuffer::GetPlainText` now works on an exclusive range, so no need
to convert the range anymore!
## Validation Steps Performed
This fundamental change impacts a lot of scenarios:
- ✅Rendering selections
- ✅Selection markers
- ✅Copy text
- ✅Session restore
- ✅Mark mode navigation (i.e. character, word, line, buffer)
- ✅Mouse selection (i.e. click+drag, shift+click, multi-click,
alt+click)
- ✅Hyperlinks (interaction and rendering)
- ✅Accessibility (i.e. get selection, movement, text extraction,
selecting text)
- [ ] Prev/Next Command/Output (untested)
- ✅Unit tests
## Follow-ups
- Refs #4423
- Now that selection and UIA are both exclusive ranges, it should be a
lot easier to deduplicate code between selection and UIA. We should be
able to remove `EndExclusive` as well when we do that. This'll also be
an opportunity to modernize that code and use more `til` classes.
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.
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. ✅
The code in #17909 was not completely right for padding values with
fewer than four components, and it was doing some fragile string math
(that is: if you wanted to change the third element in the padding it
would parse out the whole thing, edit the third value, and then format
it again).
This pull request moves the control's padding parser into cppwinrt_utils
(for lack of a better place) and makes the settings UI use it to parse
the padding out into a `Thickness` as early as possible. Then, the
controls operate directly on the Thickness' members rather than parsing
the padding string again.
To handle two-way serialization properly, we also required a function
that converts a thickness back into a reduced string representation
(i.e. when all four values are N, it will return "N").
As a bonus, this pull request also:
- removes another use of `std::getline`
- fixes an issue where resetting the padding would change it
(infinitesimally) and cause it to be set again
- adds a readout of the current padding value in the expander itself
- removes `MaxValueFromPaddingString`, which was apparently unused
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.
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
There's an existing WinUI bug where a nested Grid has it's star-sizing
ignored on Windows 10. This resulted in the New Tab Menu page looking
weird on Windows 10. This PR fixes the layout issue by applying a max
width to the first column, which will be clipped as necessary to make
space for the second column.
Part of #18281
## Validation Steps Performed
Validated the page looks good on Windows 10 and Windows 11, even after
resizing the window.
Fixes a few accessibility bugs in the SettingContainer previews. Main
changes include:
- `SettingContainer` was considered a separate UIA element from the
inner expander. It's been marked as `AccessibilityView=Raw` to "remove"
it from the UIA tree.
- Added a `CurrentValueAccessibleName` property to the
`SettingContainer` to expose the current value to the screen reader for
`SettingContainer`s that have expanders. Non-expander
`SetttingContainer`s already worked fine.
- Applied `CurrentValueAccessibleName` to various settings throughout
the settings UI for full coverage. Added a `CurrentValue` for the ones
that were missing it.
- Removed a redundant/hidden tab stop in `Icon`
`Padding` was not updated since #18300 is handling that. This'll just
automatically make it accessible.
Font axes and features weren't updated to show previews, but I'm happy
to do it if given a suggestion.
Part of #18318
## Details
- `SettingContainer` updates:
- `AccessibilityView = Raw` for `SettingContainer`s with expanders. This
is because the expander itself is the one we care about. No need to have
another layer of UIA objects saying it's a group.
- Added a `CurrentValueAccessibleName` property
- This specifically defines what should be read out by the screen
reader, similar to `AutomationProperties.Name`
- It updates automatically when `CurrentValue` changes.
- It's applied on the inner `Expander`, if one exists.
- The accessible name is constructed to be `"<Header>:
<CurrentValueAccessibleName>"`. If `CurrentValueAccessibleName` isn't
provided, we try to use the `CurrentValue` if it's a string.
- Profile (and appearance) settings:
- `Icon`'s value is now read out by a screen reader instead of staying
silent. It'll read the icon path.
- A redundant/hidden tab stop was removed from `Icon`.
- `TabTitle` now displays/reads "None" if no tab title is set.
- `ColorScheme` is now read out by a screen reader.
- The color scheme overrides (i.e. `Foreground`, `Background`,
`SelectionBackground`, and `CursorColor`) are now read out by a screen
reader. Format is "#<hex value>".
- `BackgroundImageAlignment` is now displayed and read out by a screen
reader.
- `LaunchSize` is now displayed and read out by a screen reader. Format
is "Width x Height".
## Validation Steps Performed
Tabbed through the settings UI with a screen reader. Each of these
settings now reads out a preview.
This fixes the bit check for key down and adds a few comments.
Closes#18331
## Validation Steps Performed
Printing the resulting INPUT_RECORDs shows both key down and up events
when pressing F7. Alt-Space now also works again.
The CoreWindow approach to implementing this has proven itself to be bug
prone. This PR switches to using the much better Win32 ShowCursor API,
which uses a reference count. This prevents the exact sort of race
condition we have where we we disable the cursor in our code and the
WinUI code then sets it to a different cursor internally which gets the
system out of sync. There's no WinUI API to just hide the cursor and if
it did, it would probably be a Boolean which would result in the same
issue.
Closes#18400
## Validation Steps Performed
It's difficult to assert the correctness of this approach, outside of
just trying it out (which I did and it works). The good news is that
this uses a static bool to ensure we only hide it exactly once and show
it exactly once and we do the latter on every WM_ACTIVATE message which
should hopefully restore the cursor when tabbing out and back in at
least.