## Summary
Fixes a crash in the Settings UI font face control when selecting a font
suggestion with the keyboard and pressing Enter.
The font face `AutoSuggestBox` path was explicitly unfocusing the box
after a chosen suggestion was submitted. During the keyboard suggestion
commit path, that `Focus(FocusState::Unfocused)` call can trigger a
WinUI/XAML crash before the settings model update completes.
This change avoids explicitly unfocusing the `AutoSuggestBox` in the
chosen-suggestion path and instead commits the selected font and moves
focus to the parent container.
Fixes#20245.
## Validation
Manually validated with a local `CascadiaPackage` Debug x64 build:
- Reproduced the crash before the fix.
- Opened Settings → Defaults → Appearance → Font face.
- Typed a partial font name.
- Used arrow keys to select a suggestion.
- Pressed Enter.
- Verified Terminal no longer crashes.
- Verified the selected font is applied and Save works.
This adds a new feature to the Windows Terminal: "Workspaces"
Workspaces are very shamelessly inspired by Edge workspaces of the same
name.
The core idea is that when users name a window and they close that
window, we will persist that Windows layout and buffers, seperately from
the rest of window restoration. So a user can open a named window, open
some profiles, some panes, do some stuff in it, then close it, and we
will keep that state around for the next time the user opens that window
name.
Unnamed windows still behave the same. If you close an unnamed window,
and it's not the last window, then we won't persist the state of it.
To facilitate restoring named windows, we add a `openWorkspace` action.
This allows us to persist the open workspace action in the window layout
restoration path. So when we deserialize the list of tab layouts, and
open workspace action will tell us, hey, go retrieve this known
workspace from the state.json, instead of trying to serialize the window
state in two places.
As demoed in the video, we add a flyout to list the windows that the
user has open, and the named workspaces that they have saved. This
allows users to quickly reopen previously closed workspaces, as well as
quickly rename a window, thereby adding it to the list of saved
workspaces. This button can also be hidden using the theme settings.
Closes#17084
(this is a reboot of #20162, but with the event from #20311)
This is a pair of changes to make the code formatting scripts work,
circa 2026.
* If you only have VS Insiders installed, then vswhere can't actually
find a clang-format to build with. You need `-prerelease` to let it also
find preview builds of VS.
* Years ago we updated OpenConsole.psm1 to only support pwsh 7. I, of
course, use `cmd` as my dev env for terminal, so I use `runformat.cmd`,
which always shelled to `powershell` (5). This updates that tool to use
pwsh 7. Clearly this impacted only me ever.
related to #20162
From ye old days where we were a multi-process app, we would
`shellexecute` to create a new Terminal process when we wanted to open a
new window.
Now that we're all one process (#18215), this dance doesn't make sense
anymore.
So: let's just add a bunch of plumbing to take the IContentArgs up to
the emperor and have it hand them back to a new window.
(this will be used to resurrect #20162)
This adds a new feature to the Windows Terminal: "Workspaces"
Workspaces are very shamelessly inspired by Edge workspaces of the same
name.
The core idea is that when users name a window and they close that
window, we will persist that Windows layout and buffers, seperately from
the rest of window restoration. So a user can open a named window, open
some profiles, some panes, do some stuff in it, then close it, and we
will keep that state around for the next time the user opens that window
name.
Unnamed windows still behave the same. If you close an unnamed window,
and it's not the last window, then we won't persist the state of it.
To facilitate restoring named windows, we add a `openWorkspace` action.
This allows us to persist the open workspace action in the window layout
restoration path. So when we deserialize the list of tab layouts, and
open workspace action will tell us, hey, go retrieve this known
workspace from the state.json, instead of trying to serialize the window
state in two places.
As demoed in the video, we add a flyout to list the windows that the
user has open, and the named workspaces that they have saved. This
allows users to quickly reopen previously closed workspaces, as well as
quickly rename a window, thereby adding it to the list of saved
workspaces. This button can also be hidden using the theme settings.
Closes#17084
## Summary of the Pull Request
Fix DevOps capitalization in README.
## Detailed Description of the Pull Request / Additional comments
Updated "Devops" to "DevOps" in README for consistent capitalization.
## Validation Steps Performed
* Checked README formatting
* Verified markdown renders correctly
## Summary of the Pull Request
targets #20010
This adds support for the `OSC 777 ; notify ; title ; body ST` sequence.
This allows client applications to send a notification to the Terminal.
When this notification is clicked, it summons the terminal window that
sent it.
## Validation Steps Performed
```pwsh
# in PowerShell. Terminal should not be focused.
sleep 2; Write-Output "`e]777;notify;Hello;This is a notification`a"
```
## PR Checklist
- [X] Closes#7718
- [ ] Documentation updated
- [X] Schema updated (if necessary)
Heavily based on #19938
Co-authored by @zadjii-msft
## Summary of the Pull Request
Adds a manual event handler for `PaneOpened`/`PaneClosed` on the
navigation view in the settings UI. After catching the event, we raise a
UIA notification event to force the attached screen reader to read out
"Navigation pane opened/closed" appropriately. This experience aligns
with WinUI and the text is localized appropriately.
## Validation Steps Performed
✅ Narrator announces "Navigation pane opened/closed" appropriately
(aligns with WinUI 3 gallery experience)
## PR Checklist
Closes#19687📝 NOTE: the associated issue is currently affecting our accessibility
score
Currently when you use the cmdpal in tabswitcher mode, we "preview"
switching to that tab. We don't do that for `tabSearch` mode though.
Fixing that was half a line of code. Now we do.
Closes#20233
## Summary of the Pull Request
Renames the "New tab menu" page to "Dropdown menu".
Redesigns the page with the following notes:
- the preview is now on the right side so that it's always visible
- moves preview buttons into border with previewed new tab menu entries
- when the window narrows, removes the icons from the controls, then
changes layout to be vertical so that it all fits.
Aside from the main redesign changes above, a lot of the other changes
are to make sure that spacing and alignment looks ok.
## Validation Steps Performed
- [x] Wide view
- [x] Medium width view
- [x] Narrow view
## PR Checklist
Related to #17000
This is a trivial fix for an issue we get a somewhat outsized number of
complaints about.
When the user has adjusted the font size in any direction, we'll just
keep track of the magnitude and apply it every time the settings change.
Yes, this means that if you zoom once and then change your real font
size it's going to zoom even more.
That probably doesn't matter.
Refs #11522
We believed that this would fix an issue on Windows 10, where the volume
mixer would forget Windows Terminal after every relaunch. It turns out
that it does not.
Still, this code is much more concise and doesn't require yet another
WinRT object. Story of our lives.
Refs #17733
There is some disagreement among terminal emulators as to whether DECSTR
(and therefore, soft reset) restores the cursor in the active buffer or
in all buffers.
We had previously chosen to restore the cursor in all buffers.
xterm restores the cursor only in the active buffer.
Closes#19918
This adds a `safeUriSchemes` global setting which lets you define
hyperlink URI schemes which the user considers safe. No confirmation
dialog will be shown when trying to open hyperlinks which use these
schemes.
- This solves the root issue, but doesn't introduce any UI or
documentation changes. I wanted to validate the approach and
implementation with you first.
- I closely followed the code handling the `disabledProfileSources`
setting, which is of the same type.
- This feature does not change the behavior of `http`, `https` and
`file` schemes.
Validation
I ran the dev terminal, and tested the behavior by clicking on `vscode`
hyperlinks generated by ripgrep with various `safeUriSchemes` settings:
- Setting not defined - asks for confirmation
- `["vscode"]` - does not ask for confirmation
- `["foo", "vscode"]` - does not ask for confirmation
- `["foo"]` - asks for confirmation
- `null` - asks for confirmation
- `[]` - asks for confirmation
- `[""]` - asks for confirmation
- `[{"foo": "bar"}]` - fails to deserialize (as expected)
A few uinit tests failed, but they seem unrelated to these changes:
- `KeyBindingTests` in `UnitTests_SettingsModel`, probably because I use
an AZERTY keyboard.
- A few `Conhost` tests, but I didn't touch this part
Refs #20065Closes#20191
This commit implements two fixes for the integer overflow/out-of-bounds
write reported in #20149.
First, it catches any exception generated in sixel char processing
(which will prevent `out_of_memory` or `bad_alloc` from being ignored
sight-unseen, and will prevent the consumption of further DCS content).
Second, it prevents us from allocating memory for an image which will
never be displayed (because it exceeds the height of the display.)
This supersedes prior work in #20153 for the same issues.
Closes#20149Closes#20153
Co-authored-by: James Holderness <j4_james@hotmail.com>
This commit ensures that we only set the starting title once when we
open a new terminal pane.
It also consolidates all title selection into Terminal::GetConsoleTitle,
which is now used in the TitleChanged event.
TitleChanged no longer stores a separate copy of the starting title if
an application attempts to _clear_ the title; that seems like a poorer
implementation of what we already had.
This supersedes work in #20204.
Closes#19340Closes#20204
Co-authored-by: imsh <im.shaedar@gmail.com>
Closes#18147
`SystemErrorTextColor` doesn't adapt to High Contrast themes, so the
error details in the "Failed to reload settings" dialog are illegible
(yellow on cream in HC White, for example).
Fix: skip the `ErrorTextBrush` foreground override when High Contrast is
active, letting the text inherit the system HC text color from its
parent element. This matches the existing HC detection pattern used in
`TermControl.cpp` and `MainPage.cpp`.
Validated manually on High Contrast White and Night sky themes.
Co-authored-by: SushaanthSrinivasan <SushaanthSrinivasan@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This fix addresses issue #19983 where resizePane actions unconditionally
consume keystrokes even when no resize can occur.
The fix follows the same pattern used for moveFocus and swapPane fixes:
- Changed Tab::ResizePane to return bool indicating success
- Changed TerminalPage::_ResizePane to return bool from ResizePane
- Updated _HandleResizePane to set args.Handled() based on whether
resize succeeded
This allows the keychord to propagate to the terminal when no resize can
occur, matching the behavior of moveFocus and swapPane (#6129).
Closes#19983
---------
Co-authored-by: nmurrell07 <nmurrell07@users.noreply.github.com>
Co-authored-by: Dustin L. Howett <dustin@howett.net>
It is possible to craft a packet whose `len` is `0x80000001`.
We should not produce values that do not fit in size_t (on e.g. x86).
Reject them summarily.
Some work was required to ensure conhost builds.
---------
Co-authored-by: Dragos Sambotin <dragoss@microsoft.com>
Co-authored-by: Daniel Paoliello (HE HIM) <danpao@microsoft.com>
## Summary of the Pull Request
Replaces the `warning.confirmCloseAllTabs` setting with a
`warning.confirmOnClose` enum setting that accepts the following:
- `never`: don't present a warning dialog when closing a session
- `automatic`: present a warning dialog when closing multiple tabs/panes
at once
- `always`: present a warning dialog when closing any session
The confirmation dialog contains a "don't ask me again" checkbox. When
checked, we update the setting to `never`.
This setting also affects the following actions:
- "close other tabs"
- "close tabs after"
- "close other panes"
- "quit"
The appropriate confirmation dialog is shown in these scenarios. We also
present an aggregate dialog instead of prompting the user once per
tab/pane. If there are no other tabs/panes, we don't present a dialog
and treat the key binding as unhandled (passing the key through).
## References and Relevant Issues
Iteration of #19944
## Validation Steps Performed
- closing a tab:
- ✅ 1 pane --> no dialog
- ✅ 2 panes --> dialog
- ✅ action and middle clicking tab trigger same flow
- close all other tabs:
- ✅ no other tabs --> no dialog
- ✅ 1 other tab --> dialog
- close all other panes:
- ✅ 1 pane --> no dialog
- ✅ 2 panes --> dialog
- close all tabs after the current tab:
- ✅ no tabs after --> no dialog (even if tabs before)
- ✅ 1 tab after --> dialog
- close window:
- ✅ 2 tabs --> dialog
- ✅ 2 panes --> dialog
- ✅ 1 tab with one pane --> no dialog
- Quit the Terminal:
- ✅ 3 windows --> dialog
- ✅1 window --> dialog
- ✅ "don't ask me again" checkbox checked --> setting changed to "never"
- ✅ "never" --> no dialog for scenarios above
- ✅ "always" --> dialog always appears, even when closing a single pane
## PR Checklist
Closes#5301Closes#6641
"don't ask me again" checkbox is also mentioned in #10000
Co-authored by @zadjii-msft
## Summary of the Pull Request
Targets #20010
Adds another `bellStyle` flag option. This sends a windows toast
notification to the user when a BEL is encountered
- [X] Closes#18605
- [ ] Documentation updated
Heavily based on #19936
Co-authored by @zadjii-msft
The bug was caused by an AUMID mismatch between the Taskbar's .lnk file
and Windows Terminal. Since no AUMID was associated with the .exe, the
OS automatically creates one for us. However, #20018 added an AUMID for
unpackaged scenarios, so now there was a mismatch, resulting in a new
taskbar entry being created.
To fix this, we check if a .lnk points to our .exe in the taskbar.
There's 3 cases here:
1. no .lnk of interest exists --> set the AUMID normally
2. the .lnk carries our AUMID --> set the AUMID normally
3. the .lnk doesn't have an AUMID (aka uses the auto-resolved one) -->
- for this launch: don't set the AUMID so that we both use the
auto-resolved one
- on next launch: set the AUMID on the .lnk and process so that they all
agree
## Validation Steps Performed
In unpackaged folder, move WindowsTerminal.exe to the taskbar (creates
.lnk)...
✅ Double-click the .exe --> Same taskbar entry is used
✅ Double-click the .exe _again_ --> second window goes to same taskbar
entry
The first window doesn't have to close for this to work. It just * works
*!
Bug introduced in #20018Closes#20053
## Summary of the Pull Request
Adds the infrastructure for toast notifications. Breakdown:
- `DesktopNotification`:
- `DesktopNotificationArgs` includes the struct to group all
notification-related data together.
- `SendNotification()` actually sends it
- `AppCommandlineArgs.cpp`: added a check for the `--from-toast` no-op
sentinel; ensures no new window is created
- Most of the other changes are just bubbling up the notification from
the `TerminalPaneContent` to `TerminalPage`
- `TabManagement.cpp`: `_SendDesktopNotification()` does the final
packaging of the notification before calling the `DesktopNotification`
API
This supports finding the right tab when it's been reordered or even
moved to a new window!
This also has expanded to support finding the right pane, which is
resilient to pane swaps/closing too. When the pane can't be found, we
just fallback to the tab.
If the pane is already focused, we don't send a notification.
This simply adds the infrastructure! Looks like nothing can actually
take advantage of it yet, but it's been tested with the changes in
#20011.
Heavily based on #19935
Co-authored by @zadjii-msft
## Summary of the Pull Request
Dustin reported this bug to me. Thankfully it was an easy fix.
## References and Relevant Issues
Bug from implementing #5099
## Validation Steps Performed
Double-click ____ of right-most cell of a word selects the current word
✅ right-half
✅ left-half
## Summary of the Pull Request
Changes how/when we display the "restart connection" item in the tab's
context menu. Now, we always display it, but it's disabled if we're not
in a terminal tab.
Applies similar enable/disable logic to the rest of the menu items.
Previous to this, they just wouldn't do anything (which is fair, they
didn't make any sense).
## Validation Steps Performed
Check tab's menu in following scenarios:
✅ terminal pane
✅ settings tab
✅ snippets pane
Closes#18891
## Summary of the Pull Request
Adds tests to `UnitTests_SettingsModel` to improve coverage. Tests
include:
- `SettingInheritanceFallback`: Settings inherit from user defaults;
unset settings fall back to built-in defaults
- `ClearSettingRestoresInheritance`: `ClearXxx()` removes the value at
the current layer, causing fallback to the parent
- `HasSettingAtSpecificLayer`: `HasXxx() `distinguishes explicitly set
values from inherited ones
- `ModifyProfileSettingAndRoundtrip`: Change a profile setting via
setter and `ToJson()` reflects it
- `ModifyGlobalSettingAndRoundtrip`: Change global settings via setter
and `ToJson()` reflects them
- `ModifyColorSchemeAndRoundtrip`: Change a color scheme property and
the serialized JSON reflects it
- `FixupUserSettingsDetectsChanges`: A clean roundtrip produces
idempotent FixupUserSettings() (returns false)
- `FixupCommandlinePatching`: 4 sub-cases: CMD/PowerShell short names
get patched to full paths, no-op when already clean, custom profiles are
untouched
This also updates `TestCloneInheritanceTree` to verify that `HasXxx()`
and settters that modify the clone don't modify the original.
This is being done in preparation for auto-save to help ensure we don't
have any regressions.
## Validation Steps Performed
✅ Tests pass
✅ Manually reviewed the new tests, they make sense and do add value
(though some are less valuable than others, admittedly)
✅ Sent Copilot on a quest to ensure we're not adding redundant tests. It
did catch a few and remove them fwiw.
This is a refresh of spell-check-this, more or less as of
e089393b4e.
## References and Relevant Issues
A number of changes take advantage of features from
http://github.com/check-spelling/check-spelling/releases/v0.0.26
1.
[`load-config-from`](https://docs.check-spelling.dev/Configuration#load-config-from)
will allow future PRs to switch cleanly w/o the mess that this PR has --
once this merges, the `config.json` file will be used for the three
dictionary configuration elements instead of the ones in the workflow.
2. `contents: read` is no longer needed by the comment jobs as the data
is provided by the main job
Contains fixes for the following specific issues:
`without`, `with`, `with the`, `with the window`, `will be`,
`whether or not`, `where the`, `using`, `uppercase or lowercase`,
`unit testing`, `to`, `to which...`, `to which`,
`to which the view refers`, `to which the pane was moved`,
`to run a command/switch to a tab/...`,
`to retrieve the user selected command`, `time,`, `the...that the`,
`the session's initial directory`, `that`, `that will ask`, `that the`,
`that opened the first flyout`, `same as terminal,`, `results,`,
`queue,`, `please`, `pane,`, `out-of-date`, `our`, `one`, `on-screen`,
`often`, `off-screen`, `of a`, `little-endian`, `left over`,
`includes, at a minimum,`, `know of`, `its`,
`if, after the calculation,`, `if`, `if we have an`, `if dragging`,
`if commands`, `guard,`, `given process information in a list`,
`from which`, `from creating`, `for which...`, `for the axis`,
`for initializing the buffer`, `containing the cursor`, `console-wait`,
`change`, `bytes`, `be`, `baseline,`, `aumid`, `at`, `ask me *again*`,
`an`, `also need to`, `again`, `add`, `add event`, `about spelunking`,
(rewrite `Appearances::_UpdateWithNewViewModel` comment), `'a'`, and ` (`
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
This pipeline runs on our agents, rather than OneBranch's, and doesn't
use all of the OneBranch machinery--which is only required for producing
a vpack that we check into Windows. Since Canary will never be a vpack,
we don't need to worry.
It runs at about twice the speed _and_ we control the build images!
This pull request also adds support for the "Terrapin Retrieval Tool,"
which will allow us to move away from having vcpkg contact remote
servers directly to download source code (and which may become mandatory
even in our OneBranch pipelines.)