## Summary of the Pull Request
Updates the individual profile pages to include:
- icons + settings expanders/cards
- `SettingsResetButton`: a new "reset value" button
- a new "unfocused appearance" subpage with its own preview (similar to
default appearance)
## Detailed Description of the Pull Request / Additional comments
- `IInheritableViewModel`: interface exposing `HasSetting()`,
`ClearSetting()`, and `SettingOverrideSource()`
- To help ensure that these are updated properly, a static assert was
added that checks the number of profile settings. This is intended to be
a tripwire to ensure future changes also update the reset buttons.
- `Profiles_UnfocusedAppearance.h/cpp/idl/xaml`: the new unfocused
appearance page
- added helper functions `FormatAccessibleName()` and
`ColorToHexString()` to deduplicate code that creates accessible names
for SettingsExpanders across the entire SUI
## Validation Steps Performed
- [X] settings search + deep link navigation
- [X] "reset value" button
- [X] accessibility pass with Narrator
## PR Checklist
Related to #17000
---------
Co-authored-by: Dustin L. Howett <dustin@howett.net>
Okay, so, every SettingsCard inherits from ButtonBase. ButtonBase has
its own local KeyDown/KeyUp handler, which can prevent the event from
being bubbled at all.
Moving our key handling to our local KeyDown/KeyUp handler allows us to
decide when to involve ButtonBase's handler, rather than allowing it to
delegate to us.
Incidentally, this is probably why the implementer had to use the
PreviewKeyXxx events; it was the only other way to get a "say" before
the button handled it itself.
Closes#20657 (superseded)
## Summary of the Pull Request
Adds expander groups throughout the entire settings UI (except Profiles
pages) to group similar settings together. These expanders got an icon
to help make them easier to find and navigate.
There are also a few other changes that were folded into this PR:
- "Appearance" page was renamed to "Personalization"
- Move settings from "Rendering" page to "Compatibility"
Those were done as a part of this PR for a holistic restructuring. Given
that spacing has changed, the content also needs to be reviewed so that
it looks right with this new structure (i.e. long help text should be
reconsidered to be shorter).
## Validation Steps Performed
Scenarios:
- ensure all settings are in expanders
- [x] Startup
- [x] Interaction
- [x] Personalization
- [x] Compatibility
- [x] settings search still works and deep links
## PR Checklist
Related to #17000
Raise the visible terminal minimum from 1×1 cells to 2×2 cells so a pane
or window can no longer reach a 1-column viewport (keyboard, mouse,
`split-pane`, `wt --size`, `initialCols`/`initialRows`, or VT resize).
This mitigates an issue where we hang when we display a 2-cell char
in one cell.
Refs:
- j4james: 2×2 is the VT theoretical minimum (`DECSTBM` height ≥ 2,
`DECSLRM` width ≥ 2).
Verification:
- Confirmed the hang on unpatched Dev (`WindowsTerminalDev`) and Store
1.24.11911 with `echo 音楽🎵测试` in view, then shrink the left pane to the
stop.
Closes#19996
Co-authored-by: Leonard Hecker <lhecker@microsoft.com>
After quite a lot of deliberation today, I think this is how I would
personally define it. I tried to keep it short and open to AI-use,
but particularly restrictive to autonomous AI-use (= typically slop).
Important context: To make a window smaller programmatically,
the win32 console APIs have since forever required you to
* narrow the viewport
* then narrow the buffer
To make the window larger you had to
* enlarge the buffer
* then enlarge the viewport
This is because a viewport had to fit into the buffer and vice versa.
ConEmu was very popular in the past and used this to implement proper
terminals around conhost. When WSL came along this resulted in a
problem: It wants SIGWINCH-style notifications. And there are none
on Windows. A long time ago, a hack was introduced that simply
raised buffer size events on any viewport size changes.
The problem: It was raised for _any_ viewport size changes.
And it was also raised for ASB switching.
Problema numero due: OpenSSH for WIndows is like WSL, but it has a
severe bug: A SIGWINCH during a partial input read will corrupt the
read and the other side will read either garbage or duplicate input.
Well, we can fix that by just not raising buffer size events.
It's very dangerous, because it may easily regress ConEmu (etc.).
See: https://github.com/PowerShell/Win32-OpenSSH/issues/2275
Also: Fun fact, we've been ignoring `ENABLE_WINDOW_INPUT`
since Windows 1607! No way fixing this breaks anything! /s
So, this PR introduces two **regressions**:
* `ENABLE_WINDOW_INPUT` is being respected again
* `WINDOW_BUFFER_SIZE_EVENT` is not sent anymore
when the viewport changes if VT mode disabled
Changes:
* Reintroduce support for `ENABLE_WINDOW_INPUT`
* Coalesce buffer size events
* Avoid such events when switching ASB on/off
* Ensure we reliably raise the events for viewport size changes
This is part of #281.
## Validation Steps Performed
* Spawn OpenConsole
* Run `ConEmuC64.exe -AUTOATTACH -GHWND=NEW`
* Run `wsl -- bash`
* Run `while stty size; do read -rt .05 ||:; done`
* Narrowing the window reduces the WSL width ✅
* Widening the window increases the WSL width ✅
Fixes indexed `.exe`, `.dll`, and `.lnk` profile icons being rejected
during media resource validation.
Regression from #19143.
Restores the indexed icon behavior introduced by #14107 / #1504.
## Detailed Description
Media resource validation currently checks the complete icon value,
including its `,index` suffix, with `std::filesystem::exists`. For
example, it checks for a file literally named `shell32.dll,210`, rejects
the resource, and prevents `IconPathConverter` from extracting the
requested icon.
This change:
- recognizes signed icon indexes for `.exe`, `.dll`, and `.lnk`
resources;
- validates and resolves the binary path without the index;
- preserves the original index for `IconPathConverter`;
- splits on the final comma so commas in directory and file names remain
valid;
- leaves non-icon media resources under strict whole-path validation.
## Validation Steps Performed
- Built the full Debug x64 solution with the repository's standard
`Invoke-OpenConsoleBuild` workflow.
- Ran
`SettingsModelUnitTests::MediaResourceTests::RealResolverIndexedIconPaths`.
- Verified absolute, relative, environment-expanded, positive, negative,
zero, malformed, and non-icon indexed paths.
- Verified paths with commas in both directory names and file names,
with and without an index.
- Registered and launched the local Windows Terminal Dev package and
visually confirmed an icon loaded from `oicons.dll,24`.
Closes#20567
Co-authored-by: Aristide Apodaca Aragon <arista+microsoft@microsoft.com>
Background: https://github.com/microsoft/microsoft-ui-xaml/issues/11523
Disabling the GDI redirection surface saves approximately 6 MB of memory
for a 1080p display and 32 MB for a 4K display (when the window fills
the entire screen). This PR applies this optimization to the Windows
Terminal window. Since the memory is not allocated by the application
itself but by the DWM, there is no simple way to accurately measure and
test it. I have manually tested all CreateWindowEx calls to ensure they
are correct.
Fixes an issue where the query button in the SUI search box wouldn't do
anything. This is because `SettingsSearchBox_QuerySubmitted()` was only
doing work if a suggestion was chosen.
Rather than creating a new page to just show the search results, I made
it just invoke the currently selected item. Unfortunately, that means
that we need to keep track of the selected item ourselves, but aside
from that, it's a pretty small PR. I added `_NavigateToSearchResult()`
to help deduplicate some code.
## Validation Steps Performed
✅ ignore "no results" placeholder
✅ fallback to top result if none are selected
## Summary of the Pull Request
Updates the Actions and Edit Action pages according to the mockups in
#20036 + some iterations past that. Notable changes:
- "Actions" --> "Shortcuts"
- `KeyChordVisual`: new control to display the key bindings. Bound to a
`KeyChord`. Inspired by PowerToys' implementation
- Actions.xaml:
- relatively thin entries for each shortcut
- Actions can have multiple key chords associated with them. All of
these are shown.
- Edit button associated with each key chord. Clicking it allows you to
immediately modify the key chord without navigating to the sub-page.
Tooltip + automation properties constructed to make it more clear what
these buttons do.
- EditAction.xaml:
- each action arg is represented in a settings card for consistent UI
- shortcut type is the first/primary setting. Changing this updates the
"additional customizations" section at the bottom
- "key bindings" section enumerates all associated shortcuts and allows
the user to modify them individually
- "additional customizations" includes "shortcut name" to allow users to
override the command palette representation. This also includes action
args UI.
## Validation Steps Performed
Scenarios:
- Actions page:
- [X] key chord visuals are legible
- [X] edit button --> edit mode --> show key chord listener (and focus
it)
- [X] binding to an key chord that is in use shows a warning
- [X] clicking on entry navigates to Edit Action page
- [X] accessibility testing
- Edit Action page:
- [X] accessibility testing
## PR Checklist
Related to #17000
`TsfDataProvider::GetCursorPosition()` tells the IME where the
composition is. It built that rectangle from `GetWindowRect()`, so while
the window is maximized the rectangle sits above the actual caret by the
height of the resize handle. The IME anchors the candidate window to
that rectangle, so the candidate window ends up covering the text that
is being composed.
Use `ClientToScreen` instead of `GetWindowRect`, and use the composition
scale rather than the window DPI.
Closes#20318
When the terminal performs a soft reset (`DECSTR`), we reinitialize the
`TerminalOutput` class to reset the character set mappings, but in the
process we lose the DRCS state that tracks whether there is a soft font
available. A similar problem occurs when restoring the cursor state with
the `DECRC` sequence. This PR updates the `TerminalOutput` class's soft
reset and restore implementations to fix these issues.
## References and Relevant Issues
The original DRCS support was added in PR #10011. The soft reset of the
character sets was changed in PR #16547, but as far as I can tell this
would have already been broken in the initial implementation.
## Detailed Description of the Pull Request / Additional comments
I realized I could simplify the issue, by first reimplementing the
`SoftReset` method as a call to `Restore` with a fresh instance of the
class (although initialized with the active GR translation state, since
we don't want to lose that either). It then becomes the responsibility
of the `Restore` method to preserve the DRCS state after it replaces
everything else.
We can't just preserve the `_drcsId` and `_drcsTranslationTable` fields
though. We also need to handle the case where the DRCS font is replacing
one of the restored G-sets. But this can be achieved just by calling one
of the `SetDrcsDesignation` methods, exactly as if the font was being
newly downloaded.
## Validation Steps Performed
I've manually verified that the test case in #20581 is now working as
expected in OpenConsole. I've also added unit tests that confirm that
`DECSTR` resets the character sets as expected, and `DECRC` restores the
character sets as expected, but they also both preserve the soft font if
one has been defined.
Closes#20581
The primary Cloud Shell API is changing from `2023-02-01-preview` to
`2025-09-01-preview`. This change ensures continued functionality once
the 2023 API is retired. The API commands themselves are unchanged, so
no additional code changes are needed.
Notes:
- Standard Cloud Shell users will be unaffected by this change (the new
api-version is backward compatible with their old user settings)
- Cloud Shell in a VNet users may receive a message to visit Azure
Portal to make required RBAC permission updates. This is due to the
deprecation of ACI network profiles with this API version change. More
details/instructions: aka.ms/cloud-shell-rbac-changes
- Users who don't update Terminal with this commit will be unable to use
Azure Cloud Shell via Terminal - Requests made with the 2023 API may
start to fail after 10/1.
Some headers in src\inc\til use the `__WEX_COMMON_H__` macro to detect
when it is safe to specialize the
`WEX::TestExecution::VerifyOutputTraits` and
`WEX::TestExecution::VerifyCompareTraits` classes. The
`__WEX_COMMON_H__` macro is an internal implementation detail of TAEF
that I plan to remove in an upcoming TAEF version. (I am the main dev
for TAEF.) To avoid issues when you upgrade TAEF versions, I'm switching
the code to check whether `VERIFY_ARE_EQUAL` is defined instead. This is
a documented macro that is defined in the same header that defines the
`VerifyOutputTraits` and `VerifyCompareTraits` clases.
No validation other than a quick check in a different project that
`#ifdef` works with macros that take parameters. The change is simple,
and the PR build should catch any issues if any exist.
## Summary of the Pull Request
Updates the settings UI to introduce a new Profiles page. This page
includes:
- a "Profile Defaults" navigator
- a "Color Schemes" navigator (removed top-level item in favor of this)
- an "add profile" split button (removed AddProfile page in favor of
this)
- a navigator for each profile
- tooltips were added for the "hidden"/"orphaned" info badge
## Validation Steps Performed
Scenarios:
- [x] settings search
- [X] defaults
- [X] color schemes
- [X] setting in defaults
- [X] breadcrumbs
- [X] navigate to individual profiles (via search and not)
- [X] update settings for a profile
- [X] accessibility testing
## PR Checklist
Related to #17000
Stacked on #20232
## Summary of the Pull Request
Ports the `SettingsCard` and `SettingsExpander` from Windows Community
Toolkit to the TerminalSettingsEditor project:
- Windows Community Toolkit code:
https://github.com/CommunityToolkit/Windows/tree/main/components/SettingsControls/src
- `SettingsCard` and `SettingsExpander` were ported over and reuse our
macros to reduce boilerplate.
- A few deviations exist since WCT targets WinUI 3 but TSE uses WinUI 2
(i.e. chevron rendering)
- One deviation specific to TSE: `Description` is applied as
`AutomationProperties.FullDescription` for accessibility. This is for
accessibility compliance. Description text should be read out by the
screen reader (scan mode isn't enough). Prior to this change, we would
expose it as `HelpText`. This change exposes it as `FullDescription`
which is more fitting as it's generally an opt-in behavior for screen
reader users to hear. This prevents the user from being overwhelmed with
information.
- `SettingsControlsHelpers` is used to make this much easier to review.
Any converters, triggers, or other classes that are used for the
migration were added there.
Additionally, this PR performs the migration to use these new controls
and removes `SettingContainer` entirely. Associated changes:
- Resources: renamed keys `.HelpText` --> `.Description`
- Deleting `SettingContainerStyle.xaml` and moving anything that's still
used to `CommonResources.xaml`
- Appearances: `BackgroundImageSettingsVisible` -->
`BackgroundImageSettingsEnabled` to make use of the disabled styling
- GenerateSettingsIndex.ps1 was updated to target
SettingsCard/SettingsExpander for the search index
Other notable changes as a part of using the new controls:
- Navigators (i.e. "Advanced" button in Profiles page, Extensions page)
were also converted to use `SettingsCard`
- Utils.h/cpp includes a fix for deep link to work for nested settings
(i.e. "Foreground", "Columns")
Switching to use the WCT port directly allows us to iterate faster on
the settings UI and be more consistent with the Windows ecosystem.
However, this does mean that the "reset button" had to be removed from
the individual settings. This was already a weird pattern, so removing
it shouldn't be too much of an issue. However, there was value to being
able to reset settings. To provide this kind of functionality, a "reset"
button is being added to the profile pages. This clears all settings in
a profile so that they can apply their own customizations on top. It
sacrifices granularity for simplicity and is a better understood
concept.
## Validation Steps Performed
- [X] settings search should pick up and navigate to settings properly
- [X] accessibility audit
## PR Checklist
Related to #17000
* Dead key releases should not be reported
* Modifier key releases should only be reported
if `ReportAllKeysAsEscapeCodes` is also set
* (Also fixes encoding for numpad Enter)
Closes#20522
## Validation Steps Performed
* Switch to Swiss French (`0000100c`) layout
* Enable modes 0b11 (`DisambiguateEscapeCodes`, `ReportEventTypes`)
* Pressing `Shift+]` produces `!` ✅
* Pressing `] ] ] A` produces `¨¨ä` ✅
This is part one of a two-part pair of PRs to add support for per window
name settings to the Windows terminal.
This first PR functionally does very little. It introduces the concept
of a `WindowSettings` object, where each `WindowSettings` object may be
different based off of the name of the window. **However**, the settings
model doesn't actually expose different instances of `WindowSettings`
currently. It just introduces one fake instance that actually just wraps
the global settings object to store all of them. This means that
functionally the code hasn't actually changed in this PR. We are just
accessing these properties through an intermediate type.
Largely this PR is mostly mechanical. where we previously would have
been accessing properties on the `GlobalAppSettings`, now we are just
accessing the `_currentWindowSettings()` (via a helper, or passing as a
parameter).
All of this refactoring can be done now to always access the correct
window settings object so that the next PR is much easier to read. That
is where it will get more interesting and we will have more instances of
window settings.
Refs #9992
In v0.0.26, check_extra_dictionaries isn't honored from config.json for
pull requests
Leave `cspell` with the value from v0.0.26, and use `cspell1` for the
active dictionaries.
## Detailed Description of the Pull Request / Additional comments
check-spelling v0.0.26 has a minor bug where it doesn't honor
check_extra_dictionaries from config.json in pull requests (it does for
pushes). I missed it in testing (it's fixed in prerelease).
The workaround is to use a different alias in config.json for the
check_extra_dictionaries and reserve `cspell` for the current version of
check-spelling (currently v0.0.26). When the repository updates to the
next version, that aliasing can be dropped (and at some point, once
people are all relying on config.json, I'll probably upgrade the
defaults, but until people are using a version of config.json that can
tolerate such jitter, I don't want to do that...).
Add a timer in WindowEmperor to automatically exit after 5 seconds if no
windows are created during a ConPTY handoff. The timer is cancelled as
soon as a new window is created. This prevents the process from staying
alive indefinitely if a handoff fails or is never received.
We needed this when VS2019 and VS2022 defaulted to 32-bit tools.
Now it prevents us from using the native ARM64-hosted compiler.
In a prior commit, I included this comment:
Except, most build agent tasks have not been reconfigured. The default settings for
Azure DevOps tasks MSBuild@1 and VSBuild@1 launch the 32-bit version of MSBuild.
This causes the selection of the x86 compiler.
Yes. By default on an all-x64 build agent you will still run the x86-x64 cross compiler.
We could fix this by specifying the MSBuild architecture, but that has myriad problems:
...
3. Ironically, doing so will force the use of x64 emulated MSBuild on ARM64 build agents,
which is the exact problem we're trying to avoid.
It is, largely, still true. However: fuck it.
People sometimes use ConPTY just for console API translation and so the
host lacks any VT capabilities. This means DSR-CPR queries never get a
response. Previously we would never clear the dirty flag which would
result in a 500ms lag on each `GetConsoleScreenBufferInfo` call and
PowerShell calls that API _**on every single stdout print**_
(sometimes per character due to lack of any stdout buffering).
## Validation Steps Performed
* Lobotomize conhost's ability to respond to DSR-CPR
* Run OpenConsole --> VtPipeTerm --> pwsh
* Resize the window
* After this PR, stdio will not lag
NOTE:
This commit changes our input model to treat all
Ctrl-Alt combinations as an AltGr modifier by default.
Ctrl+Alt+/ will not produce `"\x1b\x1f"` anymore.
This fixes the following issues:
* Base-key report of non-ASCII keys was broken
* AltGr on international keyboards would spam
Ctrl/Alt up/down events repeatedly forever
* KKP doesn't report modifier key repeats
* AltGr+Key combinations were reported as Ctrl+Alt+key
but should've been just plain Key-But-Modified
Closes#19977
## Validation Steps Performed
This cannot be easily tested in unit tests, due to
the dependence on international keyboard layouts.
It appears to work correctly from what I can tell.