Compare commits

..

128 Commits

Author SHA1 Message Date
Windows Console Service Bot
e86b524597 Localization Updates - main - 03/08/2024 20:28:42 (#16847)
(cherry picked from commit c238416ae1)
Service-Card-Id: 92019658
Service-Version: 1.18
2024-03-08 15:09:41 -06:00
Dustin L. Howett
706df46ffd Check the localizations into the project nightly (#16835)
Right now, the localization submission pipeline runs every night and
sends our localizable resources over to Touchdown. Later, release builds
pick up the localizations directly from Touchdown, move them into place,
and consume them.

This allowed us to avoid having localized content in the repository, but
it came with too many downsides:

- Users could not contribute additional localizations very easily
- We use the same release pipeline and Touchdown configuration for every
  branch, so strings needed to either slightly match or _entirely match_
  across an entire set of active release branches
- Building from day to day can pull in different strings, making the
  product not reproduceable
- Calling TDBuild during release builds requires network access from the
  build machine (so does restoring NuGet packages, but that's neither
  here nor there)
- Local developers and users could not test out other languages

This pull request moves all localization processing into the nightly
build phase and introduces support for checking loc in and submitting a
pull request. The pull request will not be created anew if one already
exists which has not been merged.

Anything we needed to do on release is now done overnight. This includes
moving loc files into the right places and merging the Cascadia
resources with the Context Menu resources (so that we can work around a
relatively lower amount of translations being chosen for the app versus
the context menu; see #12491 for more info.)

There are some smaller downsides to this approach and its
implementation:

- The first commit is going to be huge
- Right now, it only manages a single branch and uses a force push; if a
  PR is not reviewed timely, it will be force-pushed and you cannot see
  the day-to-day changes in the strings. Hopefully there won't be any.

I've taken great care to ensure that repeated runs of this new pipeline
will not result in unnecessary whitespace changes. This required
changing how we merge ContextMenu.resw into CascadiaPackage to always
use the .NET XmlWriter with specific flags.

NOTE that this does not allow users to _contribute_ translation fixes
for the 10 languages which we are importing. We will still need to pull
changes out of those files and submit them as bugs to the localization
team separately, and hope they come back around in another nightly
build. However, there is no reason users cannot contribute
_non-Touchdown_ languages.

(cherry picked from commit ab4b140aa4)
Service-Card-Id: 92019663
Service-Version: 1.18
2024-03-08 15:09:39 -06:00
Dustin L. Howett
9b9350e81d build: switch to NuGetAuthenticate@1 (#16752)
It keeps warning us that v0 has been deprecated.

(cherry picked from commit 6b29ef51e3)
Service-Card-Id: 91903281
Service-Version: 1.18
2024-03-08 15:09:29 -06:00
Leonard Hecker
2742f3de37 Fix an apparent x86 miscompilation on MSVC 19.38 (#16742)
There's an apparent miscompilation of `dynamic_bitset` on x86 with
MSVC 19.38, where the following code:
```cpp
dynamic_bitset<uint64_t> bits(80 * 24, 0);
bits.set(0, 3 * 80, true);
```

is expected to set the first 3.75 blocks to 1 which should produce
the following blocks:
```
0xffffffffffffffff
0xffffffffffffffff
0xffffffffffffffff
0x0000ffffffffffff
```

but it actually produces:
```
0xffffffffffffffff
0x00000000ffffffff
0xffffffffffffffff
0x0000ffffffffffff
```

The weird thing here is that this only happens if `til::bitmap`
uses a `dynamic_bitset<uint64_t>`. As soon as it uses `<uint32_t>`
any other instantiation of `<uint64_t>` is magically fixed.

Conclusion: Use `size_t` until we know what's going on.
Last known good CL version: 14.37.32822
Current broken CL version: 14.38.33130

## Validation Steps Performed

The following test completes successfully again:
```cpp
til::bitmap map{ { 80, 24 } };
map.translate({ 0, 3 }, true);
VERIFY_ARE_EQUAL(3u, map.runs().size());
```

(cherry picked from commit d3ec47a7fc)
Service-Card-Id: 91894072
Service-Version: 1.18
2024-03-08 15:09:28 -06:00
Leonard Hecker
78de1147e9 Fix a bug caused by #16592 (#16624)
#16592 passes the return value of `GetEnvironmentStringsW` directly
to the `hstring` constructor even though the former returns a
double-null terminated string and the latter expects a regular one.

This PR fixes the issue by using a basic strlen() loop to compute
the length ourselves. It's still theoretically beneficial over
the previous code, but now it's rather bitter since the code isn't
particularly short anymore and so the biggest benefit is gone.

Closes #16623

## Validation Steps Performed
* Validated the `env` string in a debugger 
  It's 1 character shorter than the old `til::env` string.
  That's fine however, since any `HSTRING` is always null-terminated
  anyways and so we get an extra null-terminator for free.
* `wt powershell` works 

(cherry picked from commit c669afe2a0)
Service-Card-Id: 91719861
Service-Version: 1.18
2024-01-30 18:25:07 -06:00
Leonard Hecker
8ac494b8c1 Pump the message queue on frozen windows (#16588)
This changeset ensures that the message queue of frozen windows is
always being serviced. This should ensure that it won't fill up and
lead to deadlocks, freezes, or similar. I've tried _a lot_ of different
approaches before settling on this one. Introducing a custom `WM_APP`
message has the benefit of being the least intrusive to the existing
code base.

The approach that I would have favored the most would be to never
destroy the `AppHost` instance in the first place, as I imagined that
this would be more robust in general and resolve other (rare) bugs.
However, I found that this requires rewriting some substantial parts
of the code base around `AppHost` and it could be something that may
be of interest in the future.

Closes #16332
Depends on #16587 and #16575

(cherry picked from commit 5d2fa4782f)
Service-Card-Id: 91642478
Service-Version: 1.18
2024-01-29 16:47:41 -06:00
Mike Griese
dd595d7aed Use TerminateProcess to exit early (#16575)
Closes MSFT:46744208

BODGY: If the emperor is being dtor'd, it's because we've gone past the
end of main, and released the ref in main. Then we might run into an
edge case where main releases it's ref to the emperor, but one of the
window threads might be in the process of exiting, and still holding a
strong ref to the emperor. In that case, we can actually end up with
the _window thread_ being the last reference, and calling App::Close
on that thread will crash us with a E_WRONG_THREAD.

This fixes the issue by calling `TerminateProcess` explicitly.

How validated: The ES team manually ran the test pass this was
crashing in a hundred times to make sure this actually fixed it.

Co-authored-by: Leonard Hecker <lhecker@microsoft.com>
(cherry picked from commit 0d47c862c2)
Service-Card-Id: 91642488
Service-Version: 1.18
2024-01-29 13:09:06 -06:00
Leonard Hecker
1eabe7c97b Simplify WindowEmperor::HandleCommandlineArgs (#16592)
This simplifies the function in two ways:
* Passing `nCmdShow` from `wWinMain` alleviates the need to interpret
  the return value of `GetStartupInfoW`.
* `til::env::from_current_environment()` calls `GetEnvironmentStringsW`
  to get the environment variables, while `to_string()` turns it back.
  Calling the latter directly alleviates the need for this round-trip.

(cherry picked from commit a39ac598cd)
Service-Card-Id: 91643114
Service-Version: 1.18
2024-01-25 18:07:45 -06:00
Leonard Hecker
7dc278c506 Fix a coroutine AV crash (#16412)
tl;dr: A coroutine lambda does not hold onto captured variables.
This causes an AV crash when closing tabs. I randomly noticed this
in a Debug build as the memory contents got replaced with 0xCD.
In a Release build this bug is probably fairly subtle and not common.

(cherry picked from commit 91fd7d0101)
Service-Card-Id: 91258716
Service-Version: 1.18
2024-01-25 18:07:44 -06:00
glenrgordon
80de11ba66 Eliminate two memory leaks (#16597)
In WindowsTerminal, there was a leak of a BSTR with every call to
ITextRangeProvider::GetText, and a failure to call VariantClear in
ITextRange::GetAttributeValue when the value stored in the variant is
VT_BSTR. These were fixed by switching to wil::unique_bstr and
wil::unique_variant.

(cherry picked from commit da99d892f4)
Service-Card-Id: 91631735
Service-Version: 1.18
2024-01-25 16:30:54 -06:00
Leonard Hecker
f4d8b7955e Avoid timer ticks on frozen windows (#16587)
At the time of writing, closing the last tab of a window inexplicably
doesn't lead to the destruction of the remaining TermControl instance.
On top of that, on Win10 we don't destroy window threads due to bugs in
DesktopWindowXamlSource. In other words, we leak TermControl instances.

Additionally, the XAML timer class is "self-referential".
Releasing all references to an instance will not stop the timer.
Only calling Stop() explicitly will achieve that.

The result is that the message loop of a frozen window thread has so
far received 1-2 messages per second due to the blink timer not being
stopped. This may have filled the message queue and lead to bugs as
described in #16332 where keyboard input stopped working.

(cherry picked from commit 521a300c17)
Service-Card-Id: 91620224
Service-Version: 1.18
2024-01-25 16:30:53 -06:00
Carlos Zamora
b236c6a396 Update SUI Color Scheme colors' AutoProp.Name and ToolTip (#16544)
In the Settings UI's Color Scheme page (where you edit the color scheme itself), update the color chip buttons to include the RGB value in the tooltip and screen reader announcements.

Closes #15985
Closes #15983

## Validation Steps Performed
Tooltip and screen reader announcement is updated on launch and when a new value is selected.

(cherry picked from commit 057183b651)
Service-Card-Id: 91642734
Service-Version: 1.18
2024-01-25 16:26:39 -06:00
James Holderness
16863cd401 Change the SUB control glyph to U+2426 (#16559)
Up to now we've using `U+2E2E` (reverse question mark) to represent the
`SUB` control glyph. This PR changes the glyph to `U+2426` (substitute
form two), which is also rendered as a reverse question mark, but is
more semantically correct.

The original `SUB` control rendering was implemented in PR #15075.

I've manually confirmed that `printf "\x1A"` is now shown as a reverse
question mark in OpenConsole when using the Cascadia Code font. That
would not previously have worked, because `U+2E2E` is not supported by
Cascadia Code.

Closes #16558

(cherry picked from commit 92f9ff948b)
Service-Card-Id: 91559315
Service-Version: 1.18
2024-01-22 16:51:15 -06:00
Adam Reynolds
e75637352c Fixed crash when cloud shell provider timed out or was closed waiting for login (#16364)
## Summary of the Pull Request
Cloud shell connection calls out to Azure to do a device code login.
When the polling interval is exceeded or the tab is closed, the method
doing the connection polling returns `nullptr`, and `AzureConnection`
immediately tries to `GetNamedString` from it, causing a crash. This
doesn't repro on Terminal Stable or Preview, suggesting it's pretty
recent related to the update of this azureconnection.

This is just a proposed fix, not sure if you want to do more extensive
changes to the affected class or not, so marking this as a draft.

## References and Relevant Issues
* N/A - encountered this while using the terminal myself

## PR Checklist/Validation
Tested out a local dev build:

- [x] Terminal doesn't crash when cloudshell polling interval exceeded
- [x] Terminal doesn't crash when cloudshell tab closed while polling
for Azure login

(cherry picked from commit 0c4751ba30)
Service-Card-Id: 91232783
Service-Version: 1.18
2024-01-22 16:51:10 -06:00
Leonard Hecker
6cae665199 Fix input buffering for A APIs (#16313)
This fixes an issue where character-wise reading of an input like "abc"
would return "a" to the caller, store "b" as a partial translation
(= wrong) and return "c" for the caller to store it for the next call.

Closes #16223
Closes #16299

## Validation Steps Performed
* `ReadFile` with a buffer size of 1 returns inputs character by
  character without dropping any inputs 

---------

Co-authored-by: Dustin L. Howett <duhowett@microsoft.com>
(cherry picked from commit 63b3820a18)
Service-Card-Id: 91108808
Service-Version: 1.18
2024-01-22 16:51:09 -06:00
Leonard Hecker
6be86cb3f3 Fix nearby fonts for DxEngine again (#16323)
The nearby font loading has to be outside of the try/catch of the
`_FindFontFace` call, because it'll throw for broken font files.
But in my previous PR I had overlooked that the font variant loop
modifies the only copy of the face name that we got and was in the
same try/catch. That's bad, because once we get to the nearby search
code, the face name will be invalid. This commit fixes the issue by
wrapping each individual `_FindFontFace` call in a try/catch block.

Closes #16322

## Validation Steps Performed
* Remove every single copy of Windows Terminal from your system
* Manually clean up Cascadia .ttf files because they aren't gone
* Destroy your registry by manually removing appx references (fun!)
* Put the 4 Cascadia .ttf files into the Dev app AppX directory
* Launch
* No warning 

(cherry picked from commit b780b44528)
Service-Card-Id: 91114950
Service-Version: 1.18
2024-01-22 16:51:08 -06:00
Tushar Singh
d7ea49de59 Use MSWord compatible RTF sequence for background text color (#16035)
The `GenRTF(...)` was using `\highlight` control word for sending
background text color in the RTF format during a copy command. This
doesn't work correctly, since many applications (E.g. MSWord) don't
support full RGB with `\highlight`, and instead uses an approximation of
what is received. For example, `rgb(197, 15, 31)` becomes `rgb(255, 0,
255)`. Also, the standard way of using background colors is `\cbN`
control word, which isn't supported as per the [RTF Spec 1.9.1]
in Word.

But it briefly mentioned a workaround at Pg. 23, which seems to work on
all the RTF editors I tested.

The PR makes the changes to use `\chshdng0\chcbpatN` for the background
coloring.

Also did some refactoring to make the implementation concise.

## Validation Steps Performed

Verified that the background is correctly copied on below editors:
- MSWord
- WordPad
- LibreOffice
- Outlook

[RTF Spec 1.9.1]: https://msopenspecs.azureedge.net/files/Archive_References/[MSFT-RTF].pdf

(cherry picked from commit 310814bb30)
Service-Card-Id: 91349197
Service-Version: 1.18
2024-01-22 16:51:06 -06:00
Dustin Howett
2304a9c3a9 Remove the rainbow frame fix from dc0cbf827 2023-11-14 11:04:48 -06:00
Mike Griese
4e6cc1d892 Fix leak in buffering text for UIA when unfocused (#16251)
Notes in #16217 have the investigation.

TL;DR: we'd always buffer text. Even if we're disabled (unfocused). When
we're
disabled, we'd _never_ clear the buffered text. Oops.

Closes #16217

(cherry picked from commit d14524cd4c)
Service-Card-Id: 91033137
Service-Version: 1.18
2023-11-13 16:57:56 -06:00
PankajBhojwani
883b77645c Update Azure Cloud Shell for their new URI format (#16247)
The Azure cloud shell team made some API changes that required us to
format our requests a little differently. This PR makes those changes
(more info in the comments in the code)

Closes #16098

(cherry picked from commit 5a9f3529d7)
Service-Card-Id: 90985892
Service-Version: 1.18
2023-11-13 16:57:55 -06:00
Dustin L. Howett
7f8834d855 releng: add --first-parent to the scripts that use git log (#16279)
It makes the output less cluttered and more correct (for example:
ServicingPipeline no longer tries to service two copies of each commit
if there's a merge in the history...)

(cherry picked from commit 18b0ecbb2a)
Service-Card-Id: 91042449
Service-Version: 1.18
2023-11-13 16:57:54 -06:00
Mike Griese
8a02fd9ff9 Another theoretical fix for a crash (#16267)
For history:

> This is MSFT:46763065 internally. Dumps show this repros on 1.19 too.
>
> This was previously #16061 which had a theoretical fix in #16065.
Looks like you're on Terminal Stable v1.18.2822.0, and
https://github.com/microsoft/terminal/releases/tag/v1.18.2822.0 is
supposed to have had that fix in it. Dang.

> well this is embarrassing ... I never actually checked if we _still
had a `_window`_. We're alive, yay! But we're still in the middle of
refrigerating. So, there's no HWND anymore

Attempt to fix this by actually ensuring there's a `_window` in
`AppHost::_WindowInitializedHandler`

Closes #16235

(cherry picked from commit 59dcbbe0e9)
Service-Card-Id: 91041358
Service-Version: 1.18
2023-11-07 12:06:15 -06:00
Taha Haksal
d0f3d5516a Added selectionBackground to light color schemes (#16243)
Add a selectionBackground property which is set to the scheme's
brightBlack too all 3 of the light color schemes.

Related to #8716
It does not close the bug because as mentioned in the issue, when you
input numbers, they seem to be invisible in the light color schemes and
selecting them with the cursor doesn't reveal them.

(cherry picked from commit a5c269b280)
Service-Card-Id: 91033166
Service-Version: 1.18
2023-11-07 12:06:14 -06:00
Leonard Hecker
cb7ac60f04 Fix the fix for the fix of nearby font loading (#16196)
I still don't know how to reproduce it properly, but I'm slowly
wrapping my head around how and why it happens. The issue isn't that
`FindFamilyName` fails with `exists=FALSE`, but rather that any of the
followup calls like `GetDesignGlyphMetrics` fails, which results in an
exception and subsequently in an orderly fallback to Consolas.
I've always thought that the issue is that even with the nearby font
collection we get an `exists=FALSE`... I'm not sure why I thought that.

This changeset also drops the fallback iteration for Lucida Console and
Courier New, because I felt like the code looks neater that way and I
think it's a reasonable expectation that Consolas is always installed.

Closes #16058

(cherry picked from commit 9e86c9811f)
Service-Card-Id: 90885610
Service-Version: 1.18
2023-11-07 12:06:13 -06:00
Leonard Hecker
a3caf5559f AtlasEngine: Minor bug fixes (#16219)
This commit fixes 4 minor bugs:
* Forgot to set the maximum swap chain latency. Without it, it defaults
  to up to 3 frames of latency. We don't need this, because our renderer
  is simple and fast and is expected to draw frames within <1ms.
* ClearType treats the alpha channel as ignored, whereas custom shaders
  can manipulate the alpha channel freely. This meant that using both
  simultaneously would produce weird effects, like text having black
  background. We now force grayscale AA instead.
* The builtin retro shader should not be effected by the previous point.
* When the cbuffer is entirely unused in a custom shader, it has so far
  resulted in constant redraws. This happened because the D3D reflection
  `GetDesc` call will then return `E_FAIL` in this situation.
  The new code on the other hand will now assume that a failure
  to get the description is equal to the variable being unused.

Closes #15960

## Validation Steps Performed
* A custom passthrough shader works with grayscale and ClearType AA
  while also changing the opacity with Ctrl+Shift+Scroll 
* Same for the builtin retro shader, but ClearType works 
* The passthrough shader doesn't result in constant redrawing 

(cherry picked from commit 0289cb043c)
Service-Card-Id: 90915276
Service-Version: 1.18
2023-11-07 12:06:12 -06:00
Mike Griese
dc0cbf8275 Clear the system menu when we refrigerate a window (#16225)
As in the title. Also fixes a crash for refrigeration with the rainbow
border.

Closes #16211

Tested by manually forcing us into Windows 10 mode (to refrigerate the
window). That immediately repros the bug, which was simple enough to
fix.

(cherry picked from commit d8c7719bfb)
Service-Card-Id: 90928407
Service-Version: 1.18
2023-11-07 12:06:11 -06:00
Leonard Hecker
8261d52f56 env: properly handle nulls in REG_SZ strings (#16190)
eb871bf fails to properly handle REG_SZ strings, which are documented as
being null-terminated _and_ length restricted.
`wcsnlen` is the perfect fit for handling this situation as it returns
the position of the first \0, or the given length parameter.

As a drive by improvement, this also drops some redundant code:
* `to_environment_strings_w` which is the same as `to_string`
* Retrieving `USERNAME`/`USERDOMAIN` via `LookupAccountSidW` and
  `COMPUTERNAME` via `GetComputerNameW` is not necessary as the
  variables are "volatile" and I believe there's generally no
  expectation that they change unless you log in again.

Closes #16051

## Validation Steps Performed
* Run this in PowerShell to insert a env value with \0:
  ```pwsh
  $hklm = [Microsoft.Win32.RegistryKey]::OpenBaseKey(
    [Microsoft.Win32.RegistryHive]::LocalMachine,
    0
  )
  $key = $hklm.OpenSubKey(
    'SYSTEM\CurrentControlSet\Control\Session Manager\Environment',
    $true
  )
  $key.SetValue('test', "foo`0bar")
  ```
* All `EnvTests` still pass 
* (Don't forget to remove the above value again!)

(cherry picked from commit 64b5b2884a)
Service-Card-Id: 90879163
Service-Version: 1.18
2023-11-07 12:06:10 -06:00
Dustin L. Howett
0af5c42a31 build: pass branding into the nuget variable template (#16122)
This fixes a cosmetic issue with the version number in the unpackaged
builds and NuGet packages.

They were showing up as `-preview`, even when they were stable, because
the variable template didn't know about the branding.

(cherry picked from commit 544cdd78af)
Service-Card-Id: 90786431
Service-Version: 1.18
2023-11-07 12:06:09 -06:00
Mike Griese
5034ad1f76 Theoretical fix for some crashes (#16047)
Found this while looking through dumps for failure
`f544cf8e-1879-c59b-3f0b-1a364b92b974`. That's MSFT:45210947. (1% of our
1.19 crashes)

From the dump I looked at,

Looks like,

* we're on Windows 10
* We're refrigerating a window
* We are pumping the remaining XAML messages as we refrigerate
(`_pumpRemainingXamlMessages`)
* In there, we're finally getting the
`TerminalPage::_CompleteInitialization`
* that calls up to the `_root->Initialized` lambda set up in
`TerminalWindow::Initialize`
* There it tries to get the launch mode from the settings, and explodes.
Presumably _settings is null, but can't see in this dump.

so the window is closing before it's initialized.

When we `_warmWindow = std::move(_host->Refrigerate())`, we call
`AppHost::Refrigerate`, which will null out the TerminalWindow. So when
we're getting to `TerminalWindow::Initialize`, we're calling that on a
nullptr. That's the trick.

We need to revoke the internal Initialized callback. Which makes sense.
It's a lambda that binds _this_ 🤦

Service-Card-Id: 90878965
Service-Version: 1.18

---

After more looking, it really doesn't _seem_ like the stacks that are
tracked in `f544cf8e-1879-c59b-3f0b-1a364b92b974` look like the same
stack that I was debugging, but this _is_ a realy issue regardless.

(cherry picked from commit 7073ec01bf)
2023-11-07 12:06:08 -06:00
Mike Griese
32b6220703 Bounds check some tab GetAt()s (#16016)
`GetAt` can throw if the index is out of range. We don't check that in
some places. This fixes some of those.

I don't think this will take care of #15689, but it might help?

(cherry picked from commit 5aadddaea9)
Service-Card-Id: 90731980
Service-Version: 1.18
2023-10-05 14:44:55 -05:00
inisarg
daf03bae02 Dismiss flyouts before opening warning dialog when exiting app (#16075)
Updated the function `TerminalPage::CloseWindow` to include logic for
closing context and flyout menus so that they are dismissed before the
warning is displayed.

Closes #16039

(cherry picked from commit aafb91745e)
Service-Card-Id: 90731988
Service-Version: 1.18
2023-10-03 15:41:53 -05:00
Mike Griese
335abe3e2b Use weak_ptrs for AppHost for coroutines (#16065)
See MSFT:46763065. Looks like we're in the middle of being
`Refrigerate`d, we're pumping messages, and as we pump messages, we get
to a `co_await` in `AppHost::_WindowInitializedHandler`. When we resume,
we just try to use `this` like everything's fine but OH NO, IT'S NOT.

To fix this, I'm
* Adding `enable_shared_from_this` to `AppHost`
* Holding the `AppHost` in a shared_ptr in WindowThread
- though, this is a singular owning `shared_ptr`. This is probably ripe
for other footguns, but there's little we can do about this.
* whenever we `co_await` in `AppHost`, make sure we grab a weak ref
first, and check it on the other side.

This is another "squint and yep that's a bug" fix, that I haven't been
able to verify locally. This is

[allegedly](https://media.tenor.com/VQi3bktwLdIAAAAC/allegedly-supposedly.gif)
about 10% of our 1.19 crashes after 3 days.

Closes #16061

(cherry picked from commit 8521aae889)
Service-Card-Id: 90731961
Service-Version: 1.18
2023-10-03 15:41:52 -05:00
Mike Griese
8e00896531 Fix tearout with startupActions set. (#16089)
Wow our preview population must just not use `startupActions`. This
obviously never worked in 1.18 Preview.

Closes #16050

(cherry picked from commit f6425dbd59)
Service-Card-Id: 90715242
Service-Version: 1.18
2023-10-03 15:41:50 -05:00
Dustin L. Howett
8758d3173d build: add a OneBranch Official release pipeline (#16081)
This pipeline does everything the existing release pipeline does, except
it does it using the OneBranch official templates.

Most of our existing build infrastructure has been reused, with the
following changes:

- We are no longer using `job-submit-windows-vpack`, as OneBranch does
this for us.
- `job-merge-msix-into-bundle` now supports afterBuildSteps, which we
use to stage the msixbundle into the right place for the vpack
- `job-build-project` supports deleting all non-signed files (which the
OneBranch post-build validation requires)
- `job-build-project` now deletes `console.dll`, which is unused in any
of our builds, because XFGCheck blows up on it for some reason on x86
- `job-publish-symbols` now supports two different types of PAT
ingestion
- I have pulled out the NuGet filename variables into a shared variables
template

I have also introduced a TSA config (which files bugs on us for binary
analysis failures as well as using the word 'sucks' and stuff.)

I have also baselined a number of control flow guard/binary analysis
failures.

(cherry picked from commit 6489f6b39d)
Service-Card-Id: 90706776
Service-Version: 1.18
2023-10-03 12:31:56 -05:00
Dustin L. Howett
7b91d9992d build: switch the EsrpCodeSigning task to version 3 (#16057)
The version we were using requires .NET 2.1 (wow) which is way out of
support.

Task version 3 supports much newer versions.

(cherry picked from commit ac2b0e744c)
Service-Card-Id: 90688107
Service-Version: 1.18
2023-09-29 15:26:18 -05:00
Dustin L. Howett
bcd4f9b263 Fix CFG on our static-lib-only DLL projects (#16056)
Control Flow Guard requires both linker and compiler flags.

It turns out that the MSVC build rules determine whether to _link_ with
CFG based on whether it compiled anything with CFG.

It also turns out that when you don't compile anything (such as in our
DLL projects that only consume a static library!), the build rules can't
guess whether to link with CFG.

Whoops.
We need to force it.

(cherry picked from commit 1b143e34a8)
Service-Card-Id: 90688104
Service-Version: 1.18
2023-09-29 15:26:17 -05:00
Carlos Zamora
1f00838e94 [Schema] Fix incorrect default value for 'allowEmpty' (#16040)
(cherry picked from commit 4382a17352)
Service-Card-Id: 90686476
Service-Version: 1.18
2023-09-29 15:26:16 -05:00
Leonard Hecker
b807bb0fbe Fix URL sanitizer for long URLs (#16026)
f1aa699 was fundamentally incorrect as it used `IdnToAscii` and
`IdnToUnicode` on the entire URL, even though these functions only work
on domain names. This commit fixes the issue by using the WinRT `Url`
class and its `AbsoluteUri` and `AbsoluteCanonicalUri` getters.
The algorithm still works the same way though.

Closes #16017

* ``"`e]8;;https://www.xn--fcbook-3nf5b.com/`e\test`e]8;;`e\"``
  still shows as two URLs in the popup 
* Shows the given URI if it's canonical and not an IDN 
* Works with >100 char long file:// URIs 

(cherry picked from commit 198c11f36d)
Service-Card-Id: 90642843
Service-Version: 1.18
2023-09-29 15:26:15 -05:00
Dustin Howett
574891be88 **BODGY** Migrate resw files from main
This works around an issue we encountered in Touchdown where we added
keys in main *and* changed keys in main and release-1.18. Because the
file hashes don't match, this file is not considered a localization
target. I think it is because we changed keys on both branches, but
there was no intermediate time point where the entire file was
consistent on both branches. Therefore, the files got localized on main
and the translations logged against the specific resw version that
existed on main. They were never logged against this weird backported
verison.
2023-09-25 11:38:47 -05:00
Dustin Howett
0baf372958 Import *another* missing #include <til/winrt.h> from main
Fixes 1eab243f7f
2023-09-23 11:23:31 -05:00
Dustin L. Howett
b45f80c660 Disable warning C4702 in adaptDispatch
Scrollbar marks are not enabled in Release builds, which results in some
dead code.

Fixes 799b5d4add
2023-09-23 11:23:03 -05:00
Mike Griese
f2426c9ba7 Allow inheriting env vars from wt again and other env var changes too (#15897)
This PR is a few things:

* part the first: Convert the `compatibility.reloadEnvironmentVariables`
setting to a per-profile one.
* The settings should migrate it from the user's old global place to the
new one.
  * We also added it to "Profile>Advanced" while I was here.
* Adds a new pair of commandline flags to `new-tab` and `split-pane`:
`--inheritEnvironment` / `--reloadEnvironment`
* On `wt` launch, bundle the entire environment that `wt` was spawned
with, and put it into the `Remoting.CommandlineArgs`, and give them to
the monarch (and ultimately, down to `TerminalPage` with the
`AppCommandlineArgs`). DO THIS ALWAYS.
* As a part of this, we’ll default to _reloading_ if there’s no explicit
commandline set, and _inheriting_ if there is.
* For example, `wt -- cmd` would inherit, and `wt -p “Command Prompt”`
would reload.[^1]
* This is a little wacky, but we’re trying to separate out the
intentions here:
* `wt -- cmd` feels like “I want to run cmd.exe (in a terminal tab)”.
That feels like the user would _like_ environment variables from the
calling process. They’re doing something more manual, so they get more
refined control over it.
* `wt` (or `wt -p “Command Prompt”`) is more like, “I want to run the
Terminal (or, my Command Prompt profile) using whatever the Terminal
would normally do”. So that feels more like a situation where it should
just reload by default. (Of course, this will respect their settings
here)

https://github.com/microsoft/terminal/issues/15496#issuecomment-1692450231
has more notes.

This is so VERY much plumbing. I'll try to leave comments in the
interesting parts.

- [x] This is not _all_ of #15496. We're also going to do a `-E foo=bar`
arg on top of this.
- [x] Tests added/passed
- [x] Schema updated

[^1]: In both these cases, plus the `environment` setting, of course.

(cherry picked from commit 59248de1e4)
Service-Card-Id: 90383402
Service-Version: 1.18
2023-09-22 18:40:36 -05:00
Mike Griese
9206575a8f Fix the TilWinRT tests (#15820)
It's unknown how this ever worked, or why it stopped working recently.

We removed our desire to directly compare property against T at some point.

(cherry picked from commit 256d46ad6b)
Service-Card-Id: 90625813
Service-Version: 1.18
2023-09-22 18:37:57 -05:00
Dustin Howett
e71c78eb7f Import a missing #include <til/winrt.h> from main
Fixes 1eab243f7f
2023-09-22 18:34:40 -05:00
Dan Albrecht
6d0b6b1a1f Fix C2664 errors (#15714)
## Summary of the Pull Request
Fix C2664 errors under latest compiler.

## References and Relevant Issues
#15309

## Detailed Description of the Pull Request / Additional comments
- Latest compilers are more strict
- Internal background of change:
[DevDiv:1810844](https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1810844)

## Validation Steps Performed
- Now successfully builds under VS `17.8.0 Preview 1.0 `
- Still successfully builds under VS `17.6.5`

## PR Checklist
- [x] Closes #15309
- [ ] 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)

---------

Co-authored-by: Dan Albrecht <danalb@ntdev.microsoft.com>
(cherry picked from commit f4bcbfbadd)
Service-Card-Id: 90625792
Service-Version: 1.18
2023-09-22 18:12:33 -05:00
Mike Griese
849d80d038 Don't crash when the checking for updates without a network (#16002)
You can't catch an A/V.

Closes #15459

(cherry picked from commit 523edd7941)
Service-Card-Id: 90584971
Service-Version: 1.18
2023-09-22 18:01:13 -05:00
Dustin L. Howett
9b392debad Remove the pending update version from the About dialog (#15378)
It turns out that the store API *doesn't* tell us what the new version
is. We were loading up our own package and checking its version instead.

The best we can do is tell users that an update--any update--is
available.

(cherry picked from commit 125026dbb6)
Service-Card-Id: 89245539
Service-Version: 1.18
2023-09-22 18:01:11 -05:00
Mike Griese
0513bb295e Fix enter to restart the first pane in a split (#16001)
I noticed this last week, but forgot to file. If you have a pair of
splits, and `exit -1` the first, you can't use `enter` to restart it.

This PR fixes that. Basically, `TerminalPage` registers it's
`_restartPaneConnection` handler when it makes a new `Pane` object. It
registers the callback straight to the `Pane`. However, when a `Pane`
gets split, it makes a _new_ `Pane` object, and moves the original
content into the new pane. `TerminalPage` however, would never hook up
its own callback to that newly created pane.

This fixes that.

(cherry picked from commit 9b986a16cf)
Service-Card-Id: 90584595
Service-Version: 1.18
2023-09-22 18:00:47 -05:00
Leonard Hecker
6fe7f07beb AtlasEngine: Harden against invalid soft fonts (#15889)
This is a theoretical improvement for #15553 where Windows Terminal
crashed due to AtlasEngine accessing the soft font bitmap outside of
bounds. The problem is that the soft font cell size was non-zero.
This PR hardens against such situations by checking whether the
requested soft font index is inside the bounds of the bitmaps.
The improvement couldn't be tested as it couldn't be reproduced.

(cherry picked from commit 1f3779e05a)
Service-Card-Id: 90625738
Service-Version: 1.18
2023-09-22 17:54:59 -05:00
Carlos Zamora
eff8cfa4b2 Make screen reader announce successful MovePane and MoveTab actions (#15771)
Uses the `RaiseNotificationEvent()` API from UIA automation peers to
announce successful `MovePane` and `MoveTab` actions. The announcements
are localized in the resw file.

Closes #15159
Based on #13575

(cherry picked from commit 2fb4a7fa91)
Service-Card-Id: 90438494
Service-Version: 1.18
2023-09-22 17:54:58 -05:00
Mike Griese
1eab243f7f Raise ShortcutActions with the sender (tab, control) context (#15773)
This PR's goal is to allow something like a `Tab` to raise a
ShortcutAction, by saying "this action should be performed on ME". We've
had a whole category of these issues in the past:

* #15734
* #15760
* #13579
* #13942
* #13942
* Heck even dating back to #10832

So, this tries to remove a bit of that footgun. This probably isn't the
_final_ form of what this refactor might look like, but the code is
certainly better than before.

Basically, there's a few bits:

* `ShortcutActionDispatch.DoAction` now takes a `sender`, which can be
_anything_.
* Most actions that use a "Get the focused _thing_ then do something to
it" are changed to "If there was a sender, let's use that - otherwise,
we'll use the focused _thing_".
* TerminalTab was largely refactored to use this, instead of making
requests to the `TerminalPage` to just do a thing to it.

I've got a few TODO!s left, but wanted to get initial feedback.
* [x] `TerminalPage::_HandleTogglePaneZoom`
* [x] `TerminalPage::_HandleFocusPane`
* [x] `TerminalPage::_MoveTab`

Closes #15734

(cherry picked from commit 30eb9eed49)
Service-Card-Id: 90438493
Service-Version: 1.18
2023-09-22 17:54:34 -05:00
Leonard Hecker
2b5b5741d9 AtlasEngine: Fix ligature splitting for JetBrains Mono (#15810)
Some fonts implement ligatures by replacing a string like "&&" with
a whitespace padding glyph, followed by the actual "&&" glyph which
has a 1 column advance width. In that case the algorithm in
`_drawTextOverlapSplit` will get confused because it strictly scans
the input from left to right, searching for color changes.
The initial color is the glyph's color and so it breaks for such fonts
because then the first split will retain the last column's color.

## Validation Steps Performed
* Use JetBrains Mono
* Print ``"`e[91m`&`e[96m&`e[m"``
* Red and blue `&` appear 

---------

Co-authored-by: Tushar Singh <tusharvickey1999@gmail.com>
Co-authored-by: Dustin L. Howett <duhowett@microsoft.com>
(cherry picked from commit a7a44901c2)
Service-Card-Id: 90153416
Service-Version: 1.18
2023-09-22 17:49:54 -05:00
Leonard Hecker
48b42db6ef Fix horizontal scrolling bugs in AtlasEngine/DxEngine (#15707)
This commit fixes a number of issues around horizontal scrolling.
DxEngine only had one bug, where the clip rect would cause any content
outside of the actual viewport to be invisible. AtlasEngine had more
bugs, mostly around the conversion from textbuffer-relative coordinates
to viewport-relative coordinates, since AtlasEngine stores things like
the cursor position, attributes, etc., relative to the viewport.

It also renames `cellCount` to `viewportCellCount`, because I realized
that it might have to deal with a `textBufferCellCount` or similar in
the future. I hope that the new name is more descriptive of what it
refers to.

Future improvements to AtlasEngine in particular would be to not copy
the entire `Settings` struct every time the horizontal scroll offset
changes, and to trim trailing whitespace before shaping text.

This is in preparation for #1860

## Validation Steps Performed
* Patch `RenderingTests` to run in the main (and not alt) buffer
* Horizontal scrolling of line renditions and attributes works 
* Selection retains its position (mostly) 

(cherry picked from commit 89c39b06ed)
Service-Card-Id: 90625739
Service-Version: 1.18
2023-09-22 17:49:52 -05:00
Mike Griese
af358b7049 Don't update the settings, unless the theme actually changed (#16004)
`ImmersiveColorSet` gets sent more often than just on a theme change. It notably gets sent when the PC is locked, or the UAC prompt opens.

## Validation Steps Performed

Tested manually by setting the font to `garbo`and:
* locking, then logging back in. No dialog 
* UAC via run dialog + `regedit`. No dialog 
* Actually changing the OS theme. Dialog 

Closes #15732

(cherry picked from commit c1bdcf8b97)
Service-Card-Id: 90600308
Service-Version: 1.18
2023-09-22 17:43:45 -05:00
Mike Griese
78508c8411 Don't explode if we try to parse an empty keys (#16003)
Saving the SUI with an empty "keys" will persist `"keys": ""` to the
JSON.

The keychord parser tries to parse that.
`KeyChordSerialization.cpp@_fromString` returns a KeyChord with both
vkey and scancode set to 0, and the ctor asserts and explodes.

We shouldn't do that.

Closes #13221

(cherry picked from commit d272fc4644)
Service-Card-Id: 90597699
Service-Version: 1.18
2023-09-22 17:43:43 -05:00
Carlos Zamora
ed16c3210c Add Auto Prop Name to 'Delete Color Scheme' button (#15994)
Since the "delete color scheme" button is filled with an icon and a Text
Box, the text is not automatically exposed as the autoProp.Name for the
button. We have to do it manually just like we do for "delete profile".

Validated manually using accessibility insights

Closes #15984

(cherry picked from commit 3550e19751)
Service-Card-Id: 90584974
Service-Version: 1.18
2023-09-22 17:39:37 -05:00
inisarg
3cb78b2d25 Allows negative values in launch parameters (#15941)
Added a style that allows negative values in the launch position
parameters.

## PR Checklist
- [x] Closes #15832

(cherry picked from commit 5d300b20ed)
Service-Card-Id: 90451445
Service-Version: 1.18
2023-09-22 17:39:35 -05:00
Mike Griese
cea9705959 Update close button visibility based on BOTH settings and readonly mode (#15914)
`TerminalTab::_RecalculateAndApplyReadOnly` didn't know about whether a
tab should be closable or not, based on the theme settings. Similarly
(though, unreported), the theme update in
`TerminalPage::_updateAllTabCloseButtons` didn't really know about
readonly mode.

This fixes both these issues by moving responsibility for the tab close
button visibility into `TabBase` itself.

Closes #15902

(cherry picked from commit 2f41d23d6d)
Service-Card-Id: 90379173
Service-Version: 1.18
2023-09-22 17:39:34 -05:00
Mike Griese
2007b9a29e Don't explode if HKCU\Console is write-protected (#15916)
I manually changed the permissions on `HKCU\Console` to deny "Create
subkey" to myself. Then confirmed that it explodes before this change,
and not after this change.

Closes #15458

(cherry picked from commit 6cff135f37)
Service-Card-Id: 90380920
Service-Version: 1.18
2023-09-22 17:39:32 -05:00
Leonard Hecker
3471983702 AtlasEngine: Fix overly aggressive invalidation (#15929)
When marking newly scrolled in rows as invalidated we used:
```
if (offset < 0)
    ...
else
    ...
```
But it should've been:
```
if (offset < 0)
    ...
else if (offset > 0)
    ...
```
Because now it always set the start of the invalidated rows range to 0.

Additionally, this includes a commented debug helper which I've used
to figure out an unrelated bug. During that search I found this bug.

(cherry picked from commit b53ddd1b47)
Service-Card-Id: 90438487
Service-Version: 1.18
2023-09-22 17:39:31 -05:00
Leonard Hecker
742a0356c3 AtlasEngine: Fix invalidation when the cursor is invisible (#15904)
`PaintCursor()` is only called when the cursor is visible, but we need
to invalidate the cursor area even if it isn't. Otherwise a transition
from a visible to an invisible cursor wouldn't be rendered.

I'm confident that this closes #15199

## Validation Steps Performed
* Set blink duration extremely high
* Launch pwsh.exe
* Press Enter a few times
* Press Ctrl+L
* There are never 2 cursors visible, not even briefly 

(cherry picked from commit 60843faa9e)
Service-Card-Id: 90438488
Service-Version: 1.18
2023-09-22 17:39:30 -05:00
Leonard Hecker
240be9953f AtlasEngine: Fix support for font features (#15912)
Font features require us to skip the fast path via `GetTextComplexity`.
`IDWriteTextLayout` handles it the same way internally.

Closes #15896

## Validation Steps Performed
* Use Cascadia Code
* Set `features: { "ss19": 1 }`
* "0" has a dash in it instead of a dot 

(cherry picked from commit 5fb2518117)
Service-Card-Id: 90380016
Service-Version: 1.18
2023-09-22 17:39:28 -05:00
Dustin L. Howett
06c22b2846 Remove outdated or implied build conditions and parameters (#15842)
We no longer multiplex PGO through the test runner. We also removed the
compliance build.

(cherry picked from commit df648208d5)
Service-Card-Id: 90438492
Service-Version: 1.18
2023-09-22 17:39:19 -05:00
Dustin L. Howett
beaf74f7a2 Allow skipping artifact publication in all release build jobs (#15846)
The OneBranch build system relies on the *build container host* being
able to publish all artifacts all at once. Therefore, our build steps
must not publish any artifacts.

I made it configurable so that the impact on existing pipelines was
minimal.

For every job that produces artifacts and is part of the release
pipeline, I am now exposing two variables that we can pass to OneBranch
so that it can locate and name artifacts:
- `JobOutputDirectory`, the output folder for the entire job
- `JobOutputArtifactName`, the name of the artifact produced by the job

I have also added a `variables` parameter to every job, so consuming
pipelines can override or insert their own variables.

(cherry picked from commit 6cb14d226d)
Service-Card-Id: 90438489
Service-Version: 1.18
2023-09-22 17:38:45 -05:00
James Pack
037b36211f Add support for running profiles from Add tab menu as admin without a keyboard (#15679)
Add support for running profiles in the Add Tab drop down as
administrator without a keyboard.
This pull request adds a FlyoutMenu to each Profile entry in the Add New
tab drop down. When a profile is right clicked or held for 2 seconds in
the case of no mouse input will present a MenuItem to allow the user to
click and run the selected profile as administrator
- Responds to pointer input events (mouse, pointer, touchpad)
- Adjusts to theme changes.
- Only shows when a profile is selected. Will not show on settings or
pallete entries

- [x] Closes #14517
- [ ] 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 42e9ddcc78)
Service-Card-Id: 90068191
Service-Version: 1.18
2023-09-22 17:38:36 -05:00
Mike Griese
0e9c549050 Refrigerate our threads for later reuse (#15424)
This is my proposed solution to #15384.

Basically, the issue is that we cannot ever close a
`DesktopWindowXamlSource` ("DWXS"). If we do, then any other thread that
tries to access XAML metadata will explode, which happens frequently. A
DWXS is inextricably linked to an HWND. That means we have to not only
reuse DWXS's, but the HWNDs themselves. XAML also isn't agile, so we've
got to keep the `thread` that the DWXS was started on alive as well.

To do this, we're going to introduce the ability to "refrigerate" and
"reheat" window threads.
* A window thread is "**hot**" if it's actively got a window, and is
pumping window messages, and generally, is a normal thing.
* When a window is closed, we need to "**refrigerate**" it's
`WindowThread` and `IslandWindow`. `WindowEmperor` will take care of
tracking the threads that are refrigerated.
* When a new window is requested, the Emperor first try to
"**reheat**"/"**microwave**" a refrigerated thread. When a thread gets
reheated, we'll create a new AppHost (and `TerminalWindow`/`Page`), and
we'll use the _existing_ `IslandWindow` for that instance.

<sub>The metaphor is obviously ridiculous, but _you get it_ so who
cares.</sub>

In this way, we'll keep all the windows we've ever created around in
memory, for later reuse. This means that the leak goes from (~12MB x
number of windows closed) to (~12MB x maximum number of simultaneously
open Terminal windows). It's still not good.

We won't do this on Windows 11, because the bug that is the fundamental
premise of this issue is fixed already in the OS.

I'm not 100% confident in this yet.
* [x] There's still a d3d leak of some sort on exit in debug builds.
(maybe #15306 related)
* havent seen this in a while. Must have been a issue in an earlier
revision.
* [x] I need to validate more on Windows 11
* [x] **BAD**: Closing the last tab on Windows 11 doesn't close the
window
* [x] **BAD**: Closing a window on Windows 11 doesn't close the window -
it just closes the one tab item and keeps on choochin'
* [x] **BAD**: Close last tab, open new one, attempt to close window -
ALL windows go \*poof\*. Cause of course. No break into post-mortem
either.
* [x] more comments
* [ ] maybe a diagram
* [x] Restoring windows is at the wrong place entirely? I once reopened
the Terminal with two persisted windows, and it created one at 0,0
* [x] Remaining code TODO!s: 0 (?)
* [ ] "warm-reloading" `useTabsInTitlebar` (change while terminal is
running after closing a window, open a new one) REALLY doesn't work.
Obviously restores the last kind of window. Yike.

is all about #15384

closes #15410 along the way. Might fork that fix off.

(cherry picked from commit 7010626497)
Service-Card-Id: 89927087
Service-Version: 1.18
2023-09-22 17:38:05 -05:00
Dustin L. Howett
52c0424ee6 Add a Nightly build pipeline for the Canary branding (#15869)
To make this happen, I moved most of `release.yml` into a shared
_pipeline_ template (which is larger than a steps or jobs template).
Most of the diffs are due to that move.

If you compare main:build/pipelines/release.yml against
dev/duhowett/nightly-build:build/pipelines/templates-v2/pipeline-full-release-build.yml,
you will see that the changes are much more minimal than they look.

I also added a parameter to configure how long symbols will be kept. It
defaults to 36530 days (which is the default for the PublishSymbols
task! Yes, 100 years!) but nightly builds will get 15 days.

(cherry picked from commit 5651f08770)
Service-Card-Id: 90368684
Service-Version: 1.18
2023-08-30 11:44:45 -05:00
Dustin L. Howett
52ceac7716 Disambiguate the test job artifact based on attempt number (#15877)
Closes #15876

(cherry picked from commit b024efb3b7)
Service-Card-Id: 90368682
Service-Version: 1.18
2023-08-30 11:44:43 -05:00
Dustin L. Howett
44faad04c0 Include our Azure client ID in AzureConnection (#15866)
Some folks over in MSAL land told us that client IDs don't need to be
kept secret.

This reduces the delta between "public" terminal and "release build"
terminal by one more file, leaving only the telemetry header left (which
won't be going public for obvious reasons).

This will also make it easier for contributors to test out Azure Cloud
Shell changes... and testing out VT without ConPTY interfering[^1].

[^1]: When Dev branding is selected, Azure Cloud Shell has the added
perk of being wired directly to TerminalCore rather than going through
ConPTY.

(cherry picked from commit 8f20ea6b2d)
Service-Card-Id: 90293632
Service-Version: 1.18
2023-08-30 11:44:29 -05:00
Dustin L. Howett
ed1c447f65 Use a different schema for each branding (#15856)
Switch the schema depending on the branding we're being built for

Ever since we started writing the entire settings file out ourselves,
we've had the opportunity to control which schema it uses.

This is a quality-of-life improvement for Preview users, and might make
life easier for Dev users as well.

For Debug builds, it even switches over to a local `file://` path to
the schema in the source directory!

Closes #6601

(cherry picked from commit 333fcd89b3)
Service-Card-Id: 90281511
Service-Version: 1.18
2023-08-30 11:44:27 -05:00
Dustin L. Howett
f5fe60113f Move the Azure Cloud Shell icons from terminal-internals (#15841)
I put them in that package like 40 years ago to get them into the build
system faster. They actually belong here.

I made them based on SVGs the Azure Cloud Shell team shared with us.

(cherry picked from commit d28b6bf1f2)
Service-Card-Id: 90245817
Service-Version: 1.18
2023-08-30 11:44:26 -05:00
Dustin L. Howett
6d457f79de Launch the settings in the PGO harness (#15631)
When we moved the settings UI to lazy initialization in #15628, we broke
PGO. Apparently, we were PGOing the tiny part of Settings that was being
loaded on every launch (e.g. the XAML metadata provider 🤦)

Let's actually PGO launching the settings.

(cherry picked from commit 80f2776272)
Service-Card-Id: 90213941
Service-Version: 1.18
2023-08-14 18:30:01 -05:00
Dustin L. Howett
bb64c797ab Rewrite the entire Azure DevOps build system (#15808)
This pull request rewrites the entire Azure DevOps build system.

The guiding principles behind this rewrite are:

- No pipeline definitions should contain steps (or tasks) directly.
- All jobs should be in template files.
- Any set of steps that is reused across multiple jobs must be in
  template files.
- All artifact names can be customized (via a property called
  `artifactStem` on all templates that produce or consume artifacts).
- No compilation happens outside of the "Build" phase, to consolidate
  the production and indexing of PDBs.
- **Building the project produces a `bin` directory.** That `bin`
  directory is therefore the primary currency of the build. Jobs will
  either produce or consume `bin` if they want to do anything with the
  build outputs.
- All step and job templates are named with `step` or `job` _first_,
  which disambiguates them in the templates directory.
- Most jobs can be run on different `pool`s, so that we can put
  expensive jobs on expensive build agents and cheap jobs on cheap
  build agents. Some jobs handle pool selection on their own, however.

Our original build pipelines used the `VSBuild` task _all over the
place._ This resulted in Terminal being built in myriad ways, different
for every pipeline. There was an attempt at standardization early on,
where `ci.yml` consumed jobs and steps templates... but when
`release.yml` was added, all of that went out the window.

The new pipelines are consistent and focus on a small, well-defined set
of jobs:

- `job-build-project`
    - This is the big one!
    - Takes a list of build configurations and platforms.
    - Produces an artifact named `build-PLATFORM-CONFIG` for the entire
      matrix of possibilities.
    - Optionally signs the output and produces a bill of materials.
    - Admittedly has a lot going on.
- `job-build-package-wpf`
    - Takes a list of build configurations and platforms.
    - Consumes the `build-` artifact for every config/platform
      possibility, plus one for "Any CPU" (hardcoded; this is where the
      .NET code builds)
    - Produces one `wpf-nupkg-CONFIG` for each configuration, merging
      all platforms.
    - Optionally signs the output and produces a bill of materials.
- `job-merge-msix-into-bundle`
    - Takes a list of build configurations and platforms.
    - Consumes the `build-` artifact for every config/platform
    - Produces one `appxbundle-CONFIG` for each configuration, merging
      all platforms for that config into one `msixbundle`.
    - Optionally signs the output and produces a bill of materials.
- `job-package-conpty`
    - Takes a list of build configurations and platforms.
    - Consumes the `build-` artifact for every config/platform
    - Produces one `conpty-nupkg-CONFIG` for each configuration, merging
      all platforms.
    - Optionally signs the output and produces a bill of materials.
- `job-test-project`
    - Takes **one** build config and **one** platform.
    - Consumes `build-PLATFORM-CONFIG`
    - Selects its own pools (hardcoded) because it knows about
      architectures and must choose the right agent arch.
    - Runs tests (directly on the build agent).
- `job-run-pgo-tests`
    - Just like the above, but runs tests where `IsPgo` is `true`
    - Collects all of the PGO counts and publishes a `pgc-intermediates`
      artifact for that platform and configuration.
- `job-pgo-merge-pgd`
    - Takes **one** build config and multiple platforms.
    - Consumes `build-$platform-CONFIG` for each platform.
    - Consumes `pgc-intermediates-$platform-CONFIG` for each platform.
    - Merges the `pgc` files into `pgd` files
    - Produces a new `pgd-` artifact.
- `job-pgo-build-nuget-and-publish`
    - Consumes the `pgd-` artifact from above.
    - Packs it into a `nupkg` and publishes it.
- `job-submit-windows-vpack`
    - Only expected to run against `Release`.
    - Consumes the `appxbundle-CONFIG` artifact.
    - Publishes it to a vpack for Windows to consume.
- `job-check-code-format`
    - Does not use artifacts. Runs `clang-format`.
- `job-index-github-codenav`
    - Does not use artifacts.

Fuzz submission is broken due to changes in the `onefuzz` client.

I have removed the compliance and security build because it is no longer
supported.

Finally, this pull request has some additional benefits:

- I've expanded the PGO build phase to cover ARM64!
- We can remove everything Helix-related except the WTT parser
    - We no longer depend on Helix submission or Helix pools
- The WPF control's inner DLLs are now codesigned (#15404)
- Symbols for the WPF control, both .NET and C++, are published
  alongside all other symbols.
- The files we submit to ESRP for signing are batched up into a single
  step[^1]

Closes #11874
Closes #11974
Closes #15404

[^1]: This will have to change if we want to sign the individual
per-architecture `.appx` files before bundling so that they can be
directly installed.

(cherry picked from commit 69eff7e9fd)
Service-Card-Id: 90183388
Service-Version: 1.18
2023-08-11 14:15:50 -05:00
nxya
ae8c441f1c Added background to CommandKeyChord (#15677)
## Summary of the Pull Request

Adds a background to key chord border in the CommandPalette Screen. This
prevents certain accent colors from rendering the KeyChords unreadable.

Before (where the text is unreadble);

![image](https://github.com/microsoft/terminal/assets/33658638/370fa7c7-f42e-48b3-af54-6fe7d5f89c73)

After (from this PR):

![image](https://github.com/microsoft/terminal/assets/33658638/5ce8601a-80f2-4efe-9270-9dd7209cdfff)

See #15228 for more details

(cherry picked from commit 91012a4e3f)
Service-Card-Id: 90068188
Service-Version: 1.18
2023-08-11 14:13:33 -05:00
Dustin L. Howett
76790e72e5 Remove TerminalTrySetDarkTheme, use the DWMWA directly (#15667)
The DWMWA for this has been documented for quite a while now!

I've also updated to a version of TerminalThemeHelpers that removes all the Dark Theme exports.

(cherry picked from commit 2f0d3dc17a)
Service-Card-Id: 90068186
Service-Version: 1.18
2023-08-11 14:13:32 -05:00
Dustin L. Howett
531fc0c1b7 Consolidate and clean up all API logging (#15737)
`s_TraceApi` was a magic function in Tracing that logged a different
event based on what type it was called with. It was bad for two reasons:

1. I wanted to add a field to each trace indicating the originating
process and thread. This would have required adding a `CONSOLE_API_MSG`
parameter to _every instance_ of `s_TraceApi`, and even then it would
have not been particularly consistent.
2. The design of Tracing, where the TraceLogging macros are hidden
inside opaque functions, subverts the lightweight trace probe detection
present in `TraceLoggingWrite`. Every tracing probe turned into a call
to a cold function which, in 99% of cases, returned immediately.

To that end, I've introduced a new macro _only_ to ApiDispatchers that
emits a named probe with a set of preloaded information. It is a macro
to avoid any unnecessary branching or the emission of any explicit
tracing functions into the final binary.

I have also removed the generic handler for timing any/all API calls, as
we never used them and they were largely redundant with the information
we were capturing from API-specific reports.

I've also removed tracing from all APIs that do not mutate console
state. With the notable exception of ReadConsoleInput, we will see logs
only for things that change mutable console state.

All these things together allows us to construct a process+API-focused
timeline of console events, ala:

```
cmd.exe (20304)   CookedRead          pwsh                4                07/13/2023 22:02:53.751
cmd.exe (20304)   API_GetConsoleMode  True
cmd.exe (20304)   API_SetConsoleMode  False               0x00000003
cmd.exe (20304)   API_SetConsoleMode  True                0x000001F7
pwsh.exe (4032)   ConsoleAttachDetach 07/13/2023 22:03:17.393              True                True
pwsh.exe (4032)   API_GetConsoleMode  False
pwsh.exe (4032)   API_GetConsoleMode  False
pwsh.exe (4032)   API_SetConsoleMode  False               0x00000007
```

This pull request also switches the ConsoleAttachDetach and CookedRead
reports to use the PID and FILETIME markings for their pids and
filetimes. This is compatible with the uint32 and uint64 fields that
used to use those names, so anybody who was depending on them will
experience no change in functionality.

I also switched up their order to make them more ergonomic in WPA when
combined with the other API_ tracing (as viewed above.)

(cherry picked from commit 5daf4983d2)
Service-Card-Id: 90012631
Service-Version: 1.18
2023-07-27 12:45:30 -05:00
Leonard Hecker
3312c0f0f0 AtlasEngine: Harden against empty target sizes (#15615)
The WPF control has a minor bug where it initializes the renderer
when there isn't even a window yet. When it then calls `SetWindowSize`
it'll pass the result of `GetWindowRect` which is `0,0,0,0`.
This made AtlasEngine unhappy because it restricted the glyph atlas
size to some multiple of the window size. If the window size is `0,0`
then there couldn't be a glyph atlas and so it crashed.

## Validation Steps Performed
* Fixes WPF test control crash on startup 

(cherry picked from commit a084834596)
Service-Card-Id: 90012548
Service-Version: 1.18
2023-07-27 12:45:26 -05:00
Dustin L. Howett
7769062e5c Lazily load the settings UI DLL (#15628)
Due to an implementation detail in the Xaml compiler--which wants to
ensure that all metadata providers on an App are available
immediately--we were eagerly loading the settings UI DLL and all of its
dependencies, even in sessions where the user was not going to open
Settings.

By turning off eager provider generation and handling it ourselves, we
get to control exactly when the settings UI is loaded.

This required some gentle poking-through of the barrier between App and
Page, but it is almost certainly worth it.

Turning on the Xaml code generation flag to not generate providers
automatically adds an `AddProvider` member to the internal interface for
the autogenerated XamlMetadataProvider. We needed to switch to using the
internal interface rather than the projected type in our custom App base
class to get at it.

Providers that App/Page use must be initialized by the time we start the
WindowsXamlManager, so we load Control and Controls (ha) eagerly and
early.

It looks like it may save 400ms of CPU time (?) on startup.

(cherry picked from commit 0f41851e67)
Service-Card-Id: 90012539
Service-Version: 1.18
2023-07-27 12:45:25 -05:00
Leonard Hecker
9aacda78d6 Display Unicode URIs side-by-side with their Punycode encoding (#15488)
06174a9 didn't properly fix the issue of us showing homoglyphs in our
URI tooltip. This commit introduces a different approach where we
display both, the Punycode and Unicode encoding, whenever we encounter
an IDN. This isn't perfect but simple to implement.

Closes #15432

## Validation Steps Performed
* `https://www.xn--fcbook-3nf5b.com/` (which contains confusing glyphs)
  is shown both in its Punycode and Unicode form simultaneously. 

---------

Co-authored-by: Carlos Zamora <carlos.zamora@microsoft.com>
(cherry picked from commit f1aa6993f1)
Service-Card-Id: 90012449
Service-Version: 1.18
2023-07-27 12:45:24 -05:00
Carlos Zamora
1b1a9eeb05 Expose 'Default' tag to Screen Readers in Color Schemes page (#15486)
## Summary of the Pull Request
This removes the "default" text box from the UI Automation tree, thus
preventing screen readers from navigating to it. This was a confusing
scenario for users because the "default" tag was unclear if it was a
part of the previous or next color scheme (i.e. consider hearing
"Campbell, default, Campbell PowerShell"; it's unclear which one is
default).

This also appends the "default" string to the `ToString` function of the
color scheme view model. This makes it so that the combo box and list
view visually appear the same, but can be quick searched or read out by
the screen reader with the 'default' tag.

## Validation Steps Performed
- [x] Verified this works on Windows 11
- [x] Verified this works on Windows 10
- Scenarios tested:
   - [x] saving settings after changing the default scheme
   - [x] saving settings.json to force a refresh in SUI

Closes #14401

(cherry picked from commit 0425ab0c1d)
Service-Card-Id: 90012454
Service-Version: 1.18
2023-07-27 12:45:23 -05:00
Brandon Dong
55fa853236 Fix matches of multiple schemas on "colorScheme" (#15748)
Adds proper `type` for `SchemePair` definition to avoid warnings about matches of multiple schemas.

Same fix as https://github.com/microsoft/terminal/pull/4045

## Validation Steps Performed
- Pointed $schema to local file instead of https://aka.ms/terminal-profiles-schema
- Confirmed warning goes away when using a string
- Confirmed using the light/dark object format still passes validation
- Confirmed values like `"colorScheme": 3` no longer incorrectly pass validation whereas they would before

(cherry picked from commit 57b9549ff8)
Service-Card-Id: 90012053
Service-Version: 1.18
2023-07-27 12:37:54 -05:00
Carlos Zamora
d31f81a2da Fix Default Terminal and Color Scheme ComboBoxes cropping at 200% Text Size (#15762)
When the OS' "text size" setting gets set to 200% and the display
resolution is reduced quite a bit, we get some cropped text in the SUI's
Default Terminal ComboBox. Turns out, we have a height set on the items.
I went ahead and removed that so we don't crop the text. Everything
looks good still!

A similar issue occurs in the Profile > Appearance > Color Scheme
ComboBox. I went ahead and fixed that too by removing the height
restriction.

Other minor changes:
- fixed the comments
- changed "author and version" row to "auto" instead of "*" (star sizing
is great for proportional sizing, so we're not really taking advantage
of it)

Closes #15149

(cherry picked from commit 1f9426b051)
Service-Card-Id: 89991191
Service-Version: 1.18
2023-07-27 12:37:53 -05:00
Carlos Zamora
dec1974fbc Add UIA element grouping to SettingsContainer (#15756)
Adds an `AutomationProperty.Name` to the main grid in the `SettingContainer`. Doing so makes it so that the group of elements is considered a "group \<header\>".

Now, when navigating with a screen reader, when you enter the group of elements, the "group \<header\>" will be presented. Thus, if the user navigates to the "reset" button, it'll be prefaced with a "group \<header\>" announcement first. If the user navigates to it from the other direction (the setting control), this announcement isn't made, but the user already has an understanding of what group of settings they're in, which is standard practice.

Closes #15158

(cherry picked from commit d70794a246)
Service-Card-Id: 89990839
Service-Version: 1.18
2023-07-27 12:37:49 -05:00
Dustin L. Howett
86a785efbc Switch away from the WinDev agent pools (#15755)
Using our own pools like this gives us a lot of freedom in the tooling
that's installed, the OS versions it targets, and when we take on Visual
Studio updates.

As part of this effort, I've also stood up a "small" agent pool. At the
time of this PR, that pool is using D2ads-v5 SKU VMs (2 vcore 8 GiB)
versus the "large" agent pool's D8as-v5 (8 vcore 32 GiB). Smaller build
tasks have been moved over to the small pool. Compilation's the hard
part, so it gets to stay on the large pool.

(cherry picked from commit 1a40ff3746)
Service-Card-Id: 89988510
Service-Version: 1.18
2023-07-27 12:37:46 -05:00
Leonard Hecker
dc512b61b7 Fix VtEngine hang when resizing while scrolling (#15618)
This fixes a bug reported internally that occurs when resizing the
terminal while also scolling the contents. The easiest way to reproduce
it is to resize the terminal to 0 rows, but it's much more prominent
in a debug build where everything goes out of sync almost immediately.

The underlying issue is that `VtEngine::_wrappedRow` may contain an
offset that is outside of the viewport bounds, because reflowing and
scrolling aren't properly synchronized. The previous `bitmap` code
would then throw an exception for such invalid coordinates and cause
the internal `VtEngine` state to be broken. Once `_wrappedRow` got
to a negative value at least once, it would stay that way unless you're
scrolling up. If the contents are actively scrolling it would quickly
reach a negative value from which it can never recover. At that point
OpenConsole would enter a tight exception-throw-catch-retry loop
and Windows Terminal seemingly cease to show any content.

## Validation Steps Performed
* Resize WT to the minimal window size repeatedly
* Doesn't hang 

(cherry picked from commit 358e10b17f)
Service-Card-Id: 89739742
Service-Version: 1.18
2023-07-27 12:37:42 -05:00
Dustin L. Howett
6be957c253 wpf: delay-load UIAutomationCore because it's incomplete in RS1 (#15614)
UiaRaiseNotificationEvent is not present on Windows Server 2016, even
though it is documented as being present.
This also removes the cost of loading up UIAutomationCore from the
critical path.

(cherry picked from commit 99c18ce57e)
Service-Card-Id: 89704754
Service-Version: 1.18
2023-07-27 12:37:41 -05:00
Dustin L. Howett
213b4456a0 Add the drop validator task, rework some build artifacts (#15568)
I originally intended to add the Drop Validator (which is a compliance
requirement) task to the build, but I quickly realized that we weren't
generating a complete SBOM manifest covering every artifact that we
produced.

We were generating the SBOM manifest, and then re-packing the Terminal
app which very likely invalidated all of the hashes and signatures in
the SBOM manifest!

We were also missing the unpackaged build.

I've removed the `appx-PLATFORM-CONFIG` and `unpackaged-PLAT-CONF`
artifacts and combined them into a single one, `terminal-PLAT-CONF`.

(cherry picked from commit 191eb00f43)
Service-Card-Id: 89624683
Service-Version: 1.18
2023-07-27 12:37:40 -05:00
Leonard Hecker
e5e2fb6fea Fix a crash when duplicating tabs with elevate:true (#15548)
When `elevate` is set to `true`, `_maybeElevate` would try to
modify `newTerminalArgs` and crash, because during tab duplication
there aren't any `newTerminalArgs`. This issue may happen for instance
when receiving hand-off from a non-elevated client and then trying
to duplicate that tab.

Closes #15534

## Validation Steps Performed
* Launch with `"elevate": false`
* Set `"elevate": true`
* Duplicate a tab
* Doesn't crash 

(cherry picked from commit 427b37c07d)
Service-Card-Id: 89534065
Service-Version: 1.18
2023-07-27 12:37:39 -05:00
Dustin L. Howett
c0b295084a Detect likely Powerline fonts, add a special powerline preview (#15365)
When we detect a font that has a glyph for `U+E0B6`, we will switch the
preview connection text to contain a special powerline prompt. This will
allow people to see how different settings might impact their real-world
environment.

When we _don't_ detect such support, we fall back to the CMD-style
`C:\>` prompt.

Pros:
- It's beautiful.

Cons:
- More code

Risks:
- `U+E0B6` is part of the private use area, and fonts that have symbols
there (such as Cirth as sub-allocated by the ConScript Unicode Registry)
will result in something unexpected.
- Actually, `E0B6` isn't part of base powerline... but I think this
specific set of characters looks too good to pass up.

(cherry picked from commit 37e8aff967)
Service-Card-Id: 89468351
Service-Version: 1.18
2023-07-27 12:37:37 -05:00
Leonard Hecker
1733c801ef AtlasEngine: Fix some Windows 10 <14393 bugs (#15485)
This fixes a couple spots where I wasn't properly checking
for the existence of some optional D2D interfaces.

## Validation Steps Performed
I haven't tested this and don't intend to do it just yet.
Windows Terminal requires build 19041 at least anyways.

(cherry picked from commit f0705fb7f7)
Service-Card-Id: 89409006
Service-Version: 1.18
2023-07-27 12:37:36 -05:00
James Holderness
d11e4dd2eb Make sure RIS re-enables win32 input and focus events (#15476)
When an `RIS` (hard reset) sequence is executed, ConHost will pass that
through to the connected conpty terminal, which results in all modes
being reset to their initial state. To work best, though, conpty needs
to have the win32 input mode enabled, as well as the focus event mode.
This PR addresses that by explicitly requesting the required modes after
an `RIS` is passed through.

Originally these modes were only set if the `--win32input` option was
given, but there is really no need for that, since terminals that don't
support them should simply ignore the request. To avoid that additional
complication, I've now removed the option (i.e. ConHost will now always
attempt to set the modes it needs).

I've manually confirmed that keypresses are still passed through with
win32 input sequences after a hard reset, and that focus events are
still being generated. I've also updated the existing conpty round-trip
test for `RIS` to confirm that it's now also passing through the mode
requests that it needs.

Closes #15461

(cherry picked from commit 8aefc7a697)
Service-Card-Id: 89384907
Service-Version: 1.18
2023-07-27 12:37:35 -05:00
Mike Griese
14fb08a228 Exit the process after commandline-only invocations (#15445)
Yep it's that dumb

Closes #15443

(cherry picked from commit c9e993a38e)
Service-Card-Id: 89327583
Service-Version: 1.18
2023-05-26 13:50:59 -07:00
Leonard Hecker
d90c837e63 Hotfix block selection linebreaks in conhost (#15423)
This regressed in a1f42e8 which only made changes to Windows Terminal
but forgot to make equivalent ones in OpenConsole/conhost.
Without this fix, line breaks in block selections are missing if the
line doesn't force a wrap via an explicit newline.

Closes #15153

## Validation Steps Performed
* Run Far or print long lines of text
* Trigger block selection via Ctrl+M or Edit > Mark
* Clipboard contains N-1 newlines lines for N selected rows 

(cherry picked from commit cd6b0832e2)
Service-Card-Id: 89338031
Service-Version: 1.18
2023-05-26 13:50:58 -07:00
Mike Griese
910cfe06c4 Theoretical fix for some crashes (#15457)
RE:
* #15454
* MSFT:44725712 "WindowsTerminal.exe!NonClientIslandWindow::OnSize"
* MSFT:44754014 "NonClientIslandWindow::GetTotalNonClientExclusiveSize"

I think this should fix all of those, but I want to ship and verify
live, since I can't repro this locally.

(cherry picked from commit 8611d901b6)
Service-Card-Id: 89337669
Service-Version: 1.18
2023-05-26 13:50:57 -07:00
Leonard Hecker
e1e3acf611 AtlasEngine: Improve scroll and swap chain invalidation (#15425)
`_p.MarkAllAsDirty()` sets `_p.scrollOffset` to 0, so we need to use
that instead of `_api.scrollOffset` when getting the offset.
Additionally, the previous code failed to release the swap chain
when recreating the backend, which is technically not correct.
I'm not sure to what issues this might have led, as it didn't had any
negative effects on my PC, but it's definitely not according to spec.

## Validation Steps Performed
Difficult to test but it seems alright.

(cherry picked from commit a19d30a25a)
Service-Card-Id: 89315195
Service-Version: 1.18
2023-05-26 13:50:56 -07:00
Steve Otteson
e4f0ab6c90 env: always expand PATH vars (#15444)
Make sure we always expand path env vars, even if they're REG_SZ in the
registry.

## Detailed Description of the Pull Request / Additional comments
On some systems path vars are REG_SZ instead of REG_EXPAND_SZ. We need
to make sure we always expand them. We looked at the system code, and it
also makes to sure to always expand them.

## Validation Steps Performed
Built locally and made sure the problem went away. Also stepped through
in the debugger to make sure things were working correctly.

Closes #15442

(cherry picked from commit 709189d471)
Service-Card-Id: 89337408
Service-Version: 1.18
2023-05-26 13:50:55 -07:00
Mike Griese
808d35b815 AGAIN, intentionally leak our App, so that we DON'T crash on exit (#15451)
This is a resurrection of #5629. As it so happens, this crash-on-exit
was _not_ specific to my laptop. It's a bug in the XAML platform
somewhere, only on Windows 10.

In #14843, we moved this leak into `becomeMonarch`. Turns out, we don't
just need this leak for the monarch process, but for all of them.

It's not a real "leak", because ultimately, our `App` lives for the
entire lifetime of our process, and then gets cleaned up when we do. But
`dtor`ing the `App` - that's apparently a no-no.

Was originally in #15424, but I'm pulling it out for a super-hotfix
release.

Closes #15410

MSFT:35761869 looks like it was closed as no repro many moons ago. This
should close out our hits there (firmly **40% of the crashes we've
gotten on 1.18**)

(cherry picked from commit aa8ed8c2d4)
Service-Card-Id: 89332890
Service-Version: 1.18
2023-05-26 13:50:54 -07:00
Mike Griese
2325442cb8 Fix focusFollowMouse (#15420)
Because this looks like it's entirely broken in `main`, and possibly in
1.17(?)

We didn't take a strong ref to the coroutine parameter. As to be
expected, that explodes.

Closes #15412

(cherry picked from commit 6775300f42)
Service-Card-Id: 89311373
Service-Version: 1.18
2023-05-26 10:57:00 -07:00
Leonard Hecker
81bf8d5e3b AtlasEngine: Fix Present() of out of bounds glyphs (#15403)
`til::rect`'s truthiness check (= rect is valid) returns `false` for
any rects that have negative coordinates. This makes sense for buffer
handling, but breaks AtlasEngine, where glyph coordinates can go out
of bounds and it's entirely valid for that to happen.

Closes #15416

## Validation Steps Performed
* Use MesloLGM NF and print NF glyphs in the first row
* Text rendering, selection, etc., still works 

---------

Co-authored-by: Dustin L. Howett <duhowett@microsoft.com>
(cherry picked from commit a9f34e3095)
Service-Card-Id: 89326794
Service-Version: 1.18
2023-05-25 12:53:31 -07:00
Leonard Hecker
9200979cb0 AtlasEngine: Fix cursor invalidation for BackendD2D (#15427)
TIL: `CreateCompatibleRenderTarget` does not initialize the bitmap
it returns. You got to do that yourself just like in D3D.

## Validation Steps Performed
* Set `ATLAS_DEBUG_FORCE_D2D_MODE` to 1
* Changing the cursor in the settings immediately updates it 

(cherry picked from commit 7650ecf658)
Service-Card-Id: 89323214
Service-Version: 1.18
2023-05-25 12:50:09 -07:00
Leonard Hecker
89ee00d96e Fix VS profile command generation (#15439)
This regressed in f06cd17. It seems like the change went untested,
because it appends an extra " after -startdir=none.
This changeset also avoids calling `append()` twice.

Closes #15436

## Validation Steps Performed
* VS Developer Command Prompt works 

(cherry picked from commit 0073e36d81)
Service-Card-Id: 89324745
Service-Version: 1.18
2023-05-25 12:50:08 -07:00
Leonard Hecker
ecdba747bb AtlasEngine: Fix nullptr crash when using soft fonts (#15419)
Woops. Regressed in #15343. Fixes #15409.

## Validation Steps Performed
* Run `RenderingTests.exe`
* Soft fonts work 

(cherry picked from commit 245b13b94e)
Service-Card-Id: 89323212
Service-Version: 1.18
2023-05-25 12:50:06 -07:00
Mike Griese
068159607e Leak the window when it closes on Windows 10 (#15397)
Re: #15384

Basically, when we close a `DesktopWindowXamlSource`, it calls to `Windows_UI_Xaml!DirectUI::MetadataAPI::Reset`, which resets the XAML metadata provider _for the process_. So, closing one DWXS on one thread will force an A/V next time another thread tries to do something like... display a tooltip. Not immediately, but surely soon enough.

This was fixed in Windows 11 by os.2020!5837001. That wasn't backported to Windows 10.

This will cause a ~15MB memory leak PER WINDOW. OBVIOUSLY, this is bad, but it's less bad than crashing.

We're gonna keep using #15384 for other ideas here too.

(cherry picked from commit c589784b54)
Service-Card-Id: 89283538
Service-Version: 1.18
2023-05-22 19:21:39 -05:00
Dustin L. Howett
a5c351c513 Switch the Preview text emoji to one that exists on Win10 (#15381)
(cherry picked from commit 0ee2c74cd4)
Service-Card-Id: 89252873
Service-Version: 1.18
2023-05-18 16:38:03 -05:00
Dustin L. Howett
02eb1eae59 Make the preview text 100% more accurate (#15366)
(cherry picked from commit ce60bf290a)
Service-Card-Id: 89232221
Service-Version: 1.18
2023-05-16 18:05:07 -05:00
Dustin L. Howett
745c4e4f0e Reword the AdjustIndistinguishableColors subhead and perf. note (#15361)
I've changed the wording so that it flows better.

(cherry picked from commit e269945a74)
Service-Card-Id: 89230299
Service-Version: 1.18
2023-05-16 15:05:43 -05:00
Dustin L. Howett
edb55d74f4 Add a fun new preview text in the SUI, enable the cursor (#15363)
Our existing preview text was not very helpful in learning how different
settings impacted the display of text in Terminal.

This new preview text contains:
* Bold text, which is controlled by intenseTextStyle
* Colors
* Emoji
* A cursor, which overlaps a single character to show inversion behavior

(cherry picked from commit fbe45fafb5)
Service-Card-Id: 89230302
Service-Version: 1.18
2023-05-16 15:05:42 -05:00
Dustin L. Howett
521e1318df Reword or remove a bunch of subheadings in the SUI (#15362)
Some of these were reundant, and some didn't feel right when I read
them.

Oh, and I got rid of all of these particularly unhelpful or non-additive
resources:

```
Color Scheme        [                     v ]
Is a color scheme
```

(cherry picked from commit 62766db94d)
Service-Card-Id: 89230304
Service-Version: 1.18
2023-05-16 15:05:40 -05:00
James Holderness
e4a62fb2e1 Add support for horizontal margin sequences (#15084)
This PR introduces two new escapes sequences: `DECLRMM` (Left Right
Margin Mode), which enables the horizontal margin support, and `DECSLRM`
(Set Left and Right Margins), which does exactly what the name suggests.

A whole lot of existing operations have then been updated to take those
horizontal margins into account.

## Detailed Description of the Pull Request / Additional comments

The main complication was in figuring out in what way each operation is
affected, since there's a fair amount of variation.

* When writing text to the buffer, we need to wrap within the horizontal
margins, but only when the cursor is also within the vertical margins,
otherwise we just wrap within the boundaries of the screen.

* Not all cursor movement operations are constrained by the margins, but
for those that are, we clamp within both the vertical and horizontal
margins. But if the cursor is already outside the margins, it is just
clamped at the edges of the screen.

* The `ICH` and `DCH` operations are constrained by the horizontal
margins, but only when inside the vertical margins. And if the cursor is
outside the horizontal margins, these operations have no effect at all.

* The rectangular area operations are clamped within the horizontal
margins when in the origin mode, the same way they're clamped within the
vertical margins.

* The scrolling operations only scroll the area inside both horizontal
and vertical margins. This includes the `IL` and `DL` operations, but
they also won't have any effect at all unless the cursor is already
inside the margin area.

* `CR` returns to the left margin rather than the start of the line,
unless the cursor is already left of that margin, or outside the
vertical margins.

* `LF`, `VT`, `FF`, and `IND` only trigger a scroll at the bottom margin
if the cursor is already inside both vertical and horizontal margins.
The same rules apply to `RI` when triggering a scroll at the top margin.

Another thing worth noting is the change to the `ANSISYSSC` operation.
Since that shares the same escape sequence as `DECSLRM`, they can't both
be active at the same time. However, the latter is only meant to be
active when `DECLRMM` is set, so by default `ANSISYSC` will still work,
but it'll no longer apply once the `DECLRMM` mode is enabled.

## Validation Steps Performed

Thanks to @al20878, these operations have been extensively tested on a
number of DEC terminals and I've manually confirmed our implementation
matches their behavior.

I've also extended some of our existing unit tests to cover at least the
basic margin handling, although not all of the edge cases.

Closes #14876

(cherry picked from commit b00b77a7ac)
Service-Card-Id: 89180228
Service-Version: 1.18
2023-05-15 17:37:56 -05:00
Leonard Hecker
5d1bcd6324 AtlasEngine: Clip box glyphs to their cells (#15343)
Overhangs for box glyphs can produce unsightly effects, where the
antialiased edges of horizontal and vertical lines overlap between
neighboring glyphs and produce "boldened" intersections.
This avoids the issue in most cases by simply clipping the glyph to the
size of a single cell. The downside is that it fails to work well for
custom line heights, etc.

## Validation Steps Performed

* With Cascadia Code, printing ``"`u{2593}`n`u{2593}"`` in pwsh
  doesn't produce a brightened overlap anymore 
* ``"`e#3`u{2502}`n`e#4`u{2502}"`` produces a fat vertical line 

(cherry picked from commit 4628ceb295)
Service-Card-Id: 89213363
Service-Version: 1.18
2023-05-15 17:37:54 -05:00
Mike Griese
6942992d7b Manually pre-evaluate the starting directory when calling elevate-shim (#15286)
_targets #15280_

When ctrl+clicking on a profile, pre-evaluate the starting directory of
that profile, and stash that in the commandline we pass to elevate shim.

So in the case of something like "use parent process directory", we'll
run `elevate-shim new-tab -p {guid} -d "C:\\the path\\of\\terminal\\."`

Closes #15173

---------

Co-authored-by: Leonard Hecker <lhecker@microsoft.com>
(cherry picked from commit 9a4f4abaf2)
Service-Card-Id: 89180220
Service-Version: 1.18
2023-05-15 17:37:51 -05:00
James Holderness
c7bf735167 Add support for LNM (Line Feed/New Line Mode) (#15261)
This PR adds support for the ANSI Line Feed/New Line mode (`LNM`), which
determines whether outputting a linefeed control should also trigger a
carriage return, and whether the `Return` key should generate an `LF` in
addition to `CR`.

## Detailed Description of the Pull Request / Additional comments

In ConHost, there was already a console mode which handled the output
side of things, but I've now also added a `TerminalInput` mode that
controls the behavior of the `Return` key. When `LNM` is set, both the
output and input modes are enabled, and when reset, they're disabled.

If they're not already matching, then `LNM` has no effect, and will be
reported as unknown when queried. This is the typical state for legacy
console applications, which expect a linefeed to trigger a carriage
return, but wouldn't want the `Return` key generating both `CR`+`LF`.

As part of this PR, I've also refactored the `ITerminalApi` interface to
consolidate what I'm now calling the "system" modes: bracketed paste,
auto wrap, and the new line feed mode. This closes another gap between
Terminal and ConHost, so both auto wrap, and line feed mode will now be
supported for conpty pass through.

## Validation Steps Performed

I've added an `LNM` test that checks the escape sequence is triggering
both of the expected mode changes, and added an additional `DECRQM` test
covering the currently implemented standard modes: the new `LNM`, and
the existing `IRM` (which wasn't previously tested). I've also extended
the `DECRQM` private mode test to cover `DECAWM` and Bracketed Paste
(which we also weren't previously testing).

I've manually tested `LNM` in Vttest to confirm the keyboard is working
as expected.

Closes #15167

(cherry picked from commit 3d737214a4)
Service-Card-Id: 89180225
Service-Version: 1.18
2023-05-15 17:37:49 -05:00
Leonard Hecker
6e6777a613 Fix AtlasEngine not being used in the appearance settings (#15355)
`TermControl` cannot change the text rendering engine after its
construction. Fix the issue by deferring the construction until
after we got the initial profile settings.

## Validation Steps Performed
* A line height of 0.5 shows up with overlapping rows 

(cherry picked from commit f6e9f91504)
Service-Card-Id: 89208954
Service-Version: 1.18
2023-05-15 14:34:30 -05:00
Leonard Hecker
622844ab3d AtlasEngine: Fix animated shaders (#15353)
We need to avoid calling `Present1()` with an empty dirty rect, but the
backends are what determines the resulting dirty rect, so we need to
first run the backend code and then decide if we `Present1()` or not.

## Validation Steps Performed
* `Animate_scan.hlsl` shows a smoothly animated line 

(cherry picked from commit 457bc65d7e)
Service-Card-Id: 89208947
Service-Version: 1.18
2023-05-15 14:34:29 -05:00
Leonard Hecker
74665fea72 AtlasEngine: Fix han unification issues (#15358)
This commit ensures that we pass the user's locale to `MapCharacters`.

## Validation Steps Performed
See: https://heistak.github.io/your-code-displays-japanese-wrong/
After modifying the `userLocaleName` to contain `ja-JP`, `zh-CN` and
`zh-TW`, printing "刃直海角骨入" produces the expected, localized result.

(cherry picked from commit 4c3d3d83a5)
Service-Card-Id: 89211793
Service-Version: 1.18
2023-05-15 14:34:28 -05:00
Leonard Hecker
0dbcc5bed1 AtlasEngine: Fix multiple minor issues (#15357)
This commit fixes 3 bugs that I found while working on another feature:
* `GetGlyphIndices` doesn't return an error when the codepoint couldn't
  be found, it simply returns a glyph index of 0.
* `_resetGlyphAtlas` failed to reset the `linear_flat_set` "load" to 0
  which would result in an unbounded memory growth over time.
* `linear_flat_set` was missing move constructors/operators, which
  would've led to crashes, etc., but thankfully we haven't made use
  of these operators yet. But better fix it now than never.

(cherry picked from commit af5a6ea640)
Service-Card-Id: 89210623
Service-Version: 1.18
2023-05-15 14:34:26 -05:00
Leonard Hecker
747999a7e8 Fix DesktopWindowXamlSource related crashes when closing a window (#15338)
XAML/WinUI may pump the event loop internally. One of the functions
that does this right now is `DesktopWindowXamlSource::Close()`.

This is problematic in the previous code, because we'd set `_window`
to `nullptr` before calling `Close()` and so any of the `IslandWindow`
callbacks may be invoked during shutdown, which then try to potentially
access `_window` and end up crashing. This commit fixes the issue by
simply not nulling out the `_window` and calling `Close()` directly.

Furthermore, `NonClientIslandWindow` may directly access WinUI
objects in its message handlers which also crashes.

I've had this happen roughly ~1% of my test exits in a debug build
and every single time on a (artificial) very slow CPU.

## Validation Steps Performed
* Closing a window destroys the rendering instance 

(cherry picked from commit ba39db52d7)
Service-Card-Id: 89191262
Service-Version: 1.18
2023-05-15 14:34:25 -05:00
Mike Griese
11233c5108 Don't even try to MoveContent to the same window you started in (#15325)
Don't go.
Tracked in #14957

(cherry picked from commit 1324a0148a)
Service-Card-Id: 89180217
Service-Version: 1.18
2023-05-12 17:51:14 -05:00
Mike Griese
704be8021c Don't dismiss the command palette when the new tab menu closes (#15340)
Transient UIs are hard.

Regressed in #15077.

Closes #15305

(cherry picked from commit 1bf2fcb6e0)
Service-Card-Id: 89193705
Service-Version: 1.18
2023-05-12 17:51:13 -05:00
Leonard Hecker
9909b890eb Make path-string conversions cheaper (#15332)
`native()` returns a `const std::wstring&`, whereas `wstring()`
returns a copy. Use the former to make path conversions cheaper.

(cherry picked from commit 95944e5939)
Service-Card-Id: 89194127
Service-Version: 1.18
2023-05-12 17:51:12 -05:00
Leonard Hecker
7e5922f3d3 Fix WindowEmperor exiting too early (#15337)
`WindowEmperor` would exit as soon as the last window would enter
`RundownForExit()`, which is too early and triggers leak checks.
This commit splits up the shutdown up into deregistering the window from
the list of windows and into actually decrementing the window count.

Closes #15306

## Validation Steps Performed
* D2D leak warnings seem to disappear 

(cherry picked from commit 488de2d42c)
Service-Card-Id: 89180861
Service-Version: 1.18
2023-05-12 17:51:11 -05:00
Leonard Hecker
8bc192db65 Avoid recreating the bell MediaPlayer every time (#15333)
We don't need to recreate the `MediaPlayer` to avoid the influence of
media keys if we simply opt out of media key controls.

## Validation Steps Performed
* Set a random .wav as the bell sound
* Bell is audible 
* Media keys have no effect while the sound plays 

(cherry picked from commit bf8ef638b7)
Service-Card-Id: 89180446
Service-Version: 1.18
2023-05-12 17:51:10 -05:00
Leonard Hecker
6504066441 Fix race conditions in ControlCore (#15334)
`ControlCore` contained two bugs:
* Race condition on access of the 3 throttled funcs which may now
  be `reset()` during tear out
* The `ScrollPositionChanged` event emitter was written incorrectly
  and would emit the event from the background thread without
  throttling during tear out

(cherry picked from commit 6a26fd68c4)
Service-Card-Id: 89180582
Service-Version: 1.18
2023-05-12 17:51:09 -05:00
Dustin L. Howett
7c69fe3d0b 1.18: build PGO using Preview branding 2023-05-12 17:50:32 -05:00
Dustin L. Howett
08d395514f PGO train 1.18 separately 2023-05-12 14:27:32 -05:00
Mike Griese
5c6e626bee Restore the tab padding (#15339)
Honestly, I don't really know where it regressed. There isn't time for
me to go digging.

See also
* #15313
* #15164

Closes #15326

(cherry picked from commit d0f66b9668)
Service-Card-Id: 89193703
Service-Version: 1.18
2023-05-12 14:04:41 -05:00
Mike Griese
8d2447bce4 Use a "virtual CWD" for each terminal window (#15280)
Before process model v3, each Terminal window was running in its own process, each with its own CWD. This allowed `startingDirectory: .` to work relative to the terminal's own CWD. However, now all windows share the same process, so there can only be one CWD. That's not great - folks who right-click "open in terminal", then "Use parent process directory" are only ever going to be able to use the CWD of the _first_ terminal opened.

This PR remedies this issue, with a theory we had for another issue. Essentially, we'll give each Terminal window a "virtual" CWD. The Terminal isn't actually in that CWD, the terminal is in `system32`. This also will prevent the Terminal from locking the directory it was originally opened in.

* Closes #5506
* There wasn't a 1.18 issue for "Use parent process directory is broken" yet, presumably selfhosters aren't using that feature
* Related to #14957

Many more notes on this topic in https://github.com/microsoft/terminal/issues/4637#issuecomment-1531979200

> **Warning**
> ## Breaking change‼️

This will break a profile like

```json
{
    "commandline": "media-test.exe",
    "name": "Use CWD for media-test",
    "startingDirectory": "."
},
```

if the user right-clicks "open in terminal", then attempts to open that profile. There's some theoretical work we could do in a follow up to fix this, but I'm inclined to say that relative paths for `commandline`s were already dangerous and should have been avoided.

(cherry picked from commit 5c08a86c49)
Service-Card-Id: 89180224
Service-Version: 1.18
2023-05-12 14:04:40 -05:00
Leonard Hecker
e80661f8b1 Fix theoretical new-tab file drop crash (#15336)
After retrieving the items via `GetStorageItemsAsync()` inside a try
clause it fails to check if the pointer is actually non-null.
Apart from this this commit fixes the unsafe use of `this` by properly
using `get_weak()`. Finally it allows >1 paths to be dropped.

## Validation Steps Performed
* Dropping >1 file works 
* Dropping >1 directory works 

(cherry picked from commit 99abb2a6b5)
Service-Card-Id: 89193984
Service-Version: 1.18
2023-05-12 14:04:39 -05:00
1124 changed files with 56165 additions and 54925 deletions

View File

@@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"XamlStyler.Console": {
"version": "3.2311.2",
"version": "3.2206.4",
"commands": [
"xstyler"
]

View File

@@ -6,6 +6,8 @@
By default the command suggestion will generate a file named based on your commit. That's generally ok as long as you add the file to your commit. Someone can reorganize it later.
:warning: The command is written for posix shells. If it doesn't work for you, you can manually _add_ (one word per line) / _remove_ items to `expect.txt` and the `excludes.txt` files.
If the listed items are:
* ... **misspelled**, then please *correct* them instead of using the command.
@@ -34,9 +36,7 @@ https://www.regexplanet.com/advanced/perl/) yours before committing to verify it
* well-formed pattern.
If you can write a [pattern](
https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-patterns
) that would match it,
If you can write a [pattern](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-patterns) that would match it,
try adding it to the `patterns.txt` file.
Patterns are Perl 5 Regular Expressions - you can [test](

View File

@@ -16,10 +16,7 @@ clig
CMMI
consvc
copyable
Counterintuitively
CtrlDToClose
CVS
CUI
cybersecurity
dalet
Dcs
@@ -58,7 +55,6 @@ hyperlinks
iconify
img
inlined
issuetitle
It'd
kje
libfuzzer
@@ -83,34 +79,26 @@ noreply
ogonek
ok'd
overlined
perlw
pipeline
postmodern
Powerline
powerline
ptys
pwshw
qof
qps
Remappings
Retargets
rclt
reimplementation
reserialization
reserialize
reserializes
rlig
rubyw
runtimes
servicebus
shcha
similaritytolerance
slnt
Sos
ssh
sustainability
stakeholders
sxn
timeline
timelines
timestamped
@@ -121,19 +109,15 @@ toolset
truthiness
tshe
ubuntu
UEFI
uiatextrange
UIs
und
unregister
versioned
vsdevcmd
walkthrough
walkthroughs
We'd
westus
wildcards
workarounds
XBox
YBox
yeru

View File

@@ -1,12 +1,9 @@
aalt
abvm
ACCEPTFILES
ACCESSDENIED
acl
aclapi
alignas
alignof
allocconsolewithoptions
APPLYTOSUBMENUS
appxrecipe
bitfield
@@ -24,21 +21,17 @@ COLORPROPERTY
colspan
COMDLG
commandlinetoargv
commoncontrols
comparand
COPYFROMRESOURCE
cstdint
CXICON
CYICON
Dacl
dataobject
dcomp
debugbreak
delayimp
DERR
delayimp
dlldata
DNE
dnom
DONTADDTORECENT
DWMSBT
DWMWA
@@ -47,12 +40,10 @@ endfor
ENDSESSION
enumset
environstrings
EXACTSIZEONLY
EXPCMDFLAGS
EXPCMDSTATE
filetime
FILTERSPEC
fina
FORCEFILESYSTEM
FORCEMINIMIZE
frac
@@ -61,12 +52,10 @@ futex
GETDESKWALLPAPER
GETHIGHCONTRAST
GETMOUSEHOVERTIME
GETTEXTLENGTH
Hashtable
HIGHCONTRASTON
HIGHCONTRASTW
hinternet
HIGHQUALITYSCALE
HINTERNET
hotkeys
href
@@ -83,7 +72,6 @@ IBox
IClass
IComparable
IComparer
ICONINFO
IConnection
ICustom
IDialog
@@ -93,7 +81,6 @@ IExplorer
IFACEMETHOD
IFile
IGraphics
IImage
IInheritable
IMap
IMonarch
@@ -101,7 +88,6 @@ IObject
iosfwd
IPackage
IPeasant
isa
ISetup
isspace
IStorage
@@ -123,15 +109,12 @@ lsass
LSHIFT
LTGRAY
MAINWINDOW
MAXIMIZEBOX
medi
memchr
memicmp
MENUCOMMAND
MENUDATA
MENUINFO
MENUITEMINFOW
MINIMIZEBOX
mmeapi
MOUSELEAVE
mov
@@ -155,7 +138,6 @@ NOTIFYBYPOS
NOTIFYICON
NOTIFYICONDATA
ntprivapi
numr
oaidl
ocidl
ODR
@@ -169,7 +151,6 @@ OUTLINETEXTMETRICW
overridable
PACL
PAGESCROLL
PALLOC
PATINVERT
PEXPLICIT
PICKFOLDERS
@@ -181,11 +162,9 @@ REGCLS
RETURNCMD
rfind
RLO
rnrn
ROOTOWNER
roundf
RSHIFT
rvrn
SACL
schandle
SEH
@@ -204,7 +183,6 @@ snprintf
spsc
sregex
SRWLOC
srwlock
SRWLOCK
STDCPP
STDMETHOD
@@ -221,12 +199,10 @@ TABROW
TASKBARCREATED
TBPF
THEMECHANGED
THICKFRAME
tlg
TME
tmp
tmpdir
tokeninfo
tolower
toupper
TRACKMOUSEEVENT
@@ -244,7 +220,6 @@ Vcpp
Viewbox
virtualalloc
vsnwprintf
wcsnlen
wcsstr
wcstoui
WDJ

View File

@@ -4,7 +4,6 @@ advapi
altform
altforms
appendwttlogging
appinstaller
appx
appxbundle
appxerror
@@ -20,7 +19,6 @@ cpptools
cppvsdbg
CPRs
cryptbase
cscript
DACL
DACLs
defaultlib
@@ -46,7 +44,6 @@ MSAA
msixbundle
MSVC
MSVCP
mtu
muxc
netcore
Onefuzz
@@ -62,13 +59,12 @@ PRIINFO
propkey
pscustomobject
QWORD
rdpclip
regedit
resfiles
robocopy
SACLs
sdkddkver
segoe
sdkddkver
Shobjidl
sid
Skype
@@ -90,10 +86,8 @@ Virtualization
visualstudio
vscode
VSTHRD
WINBASEAPI
winsdkver
wlk
wscript
wslpath
wtl
wtt

View File

@@ -6,7 +6,6 @@ bhoj
Bhojwani
Bluloco
carlos
craigloewen
dhowett
Diviness
dsafa
@@ -55,7 +54,6 @@ mikegr
mikemaccana
miloush
miniksa
nguyen
niksa
nvaccess
nvda

View File

@@ -1,37 +1,23 @@
# marker to ignore all code on line
^.*/\* #no-spell-check-line \*/.*$
# marker to ignore all code on line
^.*\bno-spell-check(?:-line|)(?:\s.*|)$
# https://cspell.org/configuration/document-settings/
# cspell inline
^.*\b[Cc][Ss][Pp][Ee][Ll]{2}:\s*[Dd][Ii][Ss][Aa][Bb][Ll][Ee]-[Ll][Ii][Nn][Ee]\b
# marker for ignoring a comment to the end of the line
// #no-spell-check.*$
# patch hunk comments
^\@\@ -\d+(?:,\d+|) \+\d+(?:,\d+|) \@\@ .*
# git index header
index (?:[0-9a-z]{7,40},|)[0-9a-z]{7,40}\.\.[0-9a-z]{7,40}
# file permissions
['"`\s][-bcdLlpsw](?:[-r][-w][-Ssx]){2}[-r][-w][-SsTtx]\+?['"`\s]
# css url wrappings
\burl\([^)]+\)
index [0-9a-z]{7,40}\.\.[0-9a-z]{7,40}
# cid urls
(['"])cid:.*?\g{-1}
# data url in parens
#\(data:(?:[^) ][^)]*?|)(?:[A-Z]{3,}|[A-Z][a-z]{2,}|[a-z]{3,})[^)]*\)
\(data:[^)]*?(?:[A-Z]{3,}|[A-Z][a-z]{2,}|[a-z]{3,})[^)]*\)
# data url in quotes
([`'"])data:(?:[^ `'"].*?|)(?:[A-Z]{3,}|[A-Z][a-z]{2,}|[a-z]{3,}).*\g{-1}
([`'"])data:.*?(?:[A-Z]{3,}|[A-Z][a-z]{2,}|[a-z]{3,}).*\g{-1}
# data url
data:[-a-zA-Z=;:/0-9+]*,\S*
# https/http/file urls
(?:\b(?:https?|ftp|file)://)[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]
# mailto urls
mailto:[-a-zA-Z=;:/?%&0-9+@.]{3,}
@@ -49,9 +35,6 @@ magnet:[?=:\w]+
# asciinema
\basciinema\.org/a/[0-9a-zA-Z]+
# asciinema v2
^\[\d+\.\d+, "[io]", ".*"\]$
# apple
\bdeveloper\.apple\.com/[-\w?=/]+
# Apple music
@@ -106,7 +89,7 @@ vpc-\w+
# Google Drive
\bdrive\.google\.com/(?:file/d/|open)[-0-9a-zA-Z_?=]*
# Google Groups
\bgroups\.google\.com(?:/[a-z]+/(?:#!|)[^/\s"]+)*
\bgroups\.google\.com/(?:(?:forum/#!|d/)(?:msg|topics?|searchin)|a)/[^/\s"]+/[-a-zA-Z0-9$]+(?:/[-a-zA-Z0-9]+)*
# Google Maps
\bmaps\.google\.com/maps\?[\w&;=]*
# Google themes
@@ -134,8 +117,6 @@ themes\.googleusercontent\.com/static/fonts/[^/\s"]+/v\d+/[^.]+.
(?:\[`?[0-9a-f]+`?\]\(https:/|)/(?:www\.|)github\.com(?:/[^/\s"]+){2,}(?:/[^/\s")]+)(?:[0-9a-f]+(?:[-0-9a-zA-Z/#.]*|)\b|)
# GitHub SHAs
\bgithub\.com(?:/[^/\s"]+){2}[@#][0-9a-f]+\b
# GitHub SHA refs
\[([0-9a-f]+)\]\(https://(?:www\.|)github.com/[-\w]+/[-\w]+/commit/\g{-1}[0-9a-f]*
# GitHub wiki
\bgithub\.com/(?:[^/]+/){2}wiki/(?:(?:[^/]+/|)_history|[^/]+(?:/_compare|)/[0-9a-f.]{40,})\b
# githubusercontent
@@ -147,9 +128,9 @@ themes\.googleusercontent\.com/static/fonts/[^/\s"]+/v\d+/[^.]+.
# git.io
\bgit\.io/[0-9a-zA-Z]+
# GitHub JSON
"node_id": "[-a-zA-Z=;:/0-9+_]*"
"node_id": "[-a-zA-Z=;:/0-9+]*"
# Contributor
\[[^\]]+\]\(https://github\.com/[^/\s"]+/?\)
\[[^\]]+\]\(https://github\.com/[^/\s"]+\)
# GHSA
GHSA(?:-[0-9a-z]{4}){3}
@@ -162,8 +143,8 @@ GHSA(?:-[0-9a-z]{4}){3}
# GitLab commits
\bgitlab\.[^/\s"]*/(?:[^/\s"]+/){2}commits?/[0-9a-f]+\b
# binance
accounts\.binance\.com/[a-z/]*oauth/authorize\?[-0-9a-zA-Z&%]*
# binanace
accounts.binance.com/[a-z/]*oauth/authorize\?[-0-9a-zA-Z&%]*
# bitbucket diff
\bapi\.bitbucket\.org/\d+\.\d+/repositories/(?:[^/\s"]+/){2}diff(?:stat|)(?:/[^/\s"]+){2}:[0-9a-f]+
@@ -299,9 +280,9 @@ slack://[a-zA-Z0-9?&=]+
\bdropbox\.com/sh?/[^/\s"]+/[-0-9A-Za-z_.%?=&;]+
# ipfs protocol
ipfs://[0-9a-zA-Z]{3,}
ipfs://[0-9a-z]*
# ipfs url
/ipfs/[0-9a-zA-Z]{3,}
/ipfs/[0-9a-z]*
# w3
\bw3\.org/[-0-9a-zA-Z/#.]+
@@ -378,25 +359,16 @@ ipfs://[0-9a-zA-Z]{3,}
# tinyurl
\btinyurl\.com/\w+
# codepen
\bcodepen\.io/[\w/]+
# registry.npmjs.org
\bregistry\.npmjs\.org/(?:@[^/"']+/|)[^/"']+/-/[-\w@.]+
# getopts
\bgetopts\s+(?:"[^"]+"|'[^']+')
# ANSI color codes
(?:\\(?:u00|x)1[Bb]|\x1b|\\u\{1[Bb]\})\[\d+(?:;\d+|)m
(?:\\(?:u00|x)1b|\x1b)\[\d+(?:;\d+|)m
# URL escaped characters
\%[0-9A-F][A-F](?=[A-Za-z])
# lower URL escaped characters
\%[0-9a-f][a-f](?=[a-z]{2,})
\%[0-9A-F][A-F]
# IPv6
#\b(?:[0-9a-fA-F]{0,4}:){3,7}[0-9a-fA-F]{0,4}\b
\b(?:[0-9a-fA-F]{0,4}:){3,7}[0-9a-fA-F]{0,4}\b
# c99 hex digits (not the full format, just one I've seen)
0x[0-9a-fA-F](?:\.[0-9a-fA-F]*|)[pP]
# Punycode
@@ -404,7 +376,7 @@ ipfs://[0-9a-zA-Z]{3,}
# sha
sha\d+:[0-9]*[a-f]{3,}[0-9a-f]*
# sha-... -- uses a fancy capture
(\\?['"]|&quot;)[0-9a-f]{40,}\g{-1}
(['"]|&quot;)[0-9a-f]{40,}\g{-1}
# hex runs
\b[0-9a-fA-F]{16,}\b
# hex in url queries
@@ -419,21 +391,18 @@ sha\d+:[0-9]*[a-f]{3,}[0-9a-f]*
# Well known gpg keys
.well-known/openpgpkey/[\w./]+
# pki
-----BEGIN.*-----END
# uuid:
\b[0-9a-fA-F]{8}-(?:[0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}\b
# hex digits including css/html color classes:
(?:[\\0][xX]|\\u|[uU]\+|#x?|\%23)[0-9_a-fA-FgGrR]*?[a-fA-FgGrR]{2,}[0-9_a-fA-FgGrR]*(?:[uUlL]{0,3}|[iu]\d+)\b
(?:[\\0][xX]|\\u|[uU]\+|#x?|\%23)[0-9_a-fA-FgGrR]*?[a-fA-FgGrR]{2,}[0-9_a-fA-FgGrR]*(?:[uUlL]{0,3}|u\d+)\b
# integrity
integrity=(['"])(?:\s*sha\d+-[-a-zA-Z=;:/0-9+]{40,})+\g{-1}
integrity="sha\d+-[-a-zA-Z=;:/0-9+]{40,}"
# https://www.gnu.org/software/groff/manual/groff.html
# man troff content
\\f[BCIPR]
# '/"
\\\([ad]q
# '
\\\(aq
# .desktop mime types
^MimeTypes?=.*$
@@ -442,33 +411,21 @@ integrity=(['"])(?:\s*sha\d+-[-a-zA-Z=;:/0-9+]{40,})+\g{-1}
# Localized .desktop content
Name\[[^\]]+\]=.*
# IServiceProvider / isAThing
\b(?:I|isA)(?=(?:[A-Z][a-z]{2,})+\b)
# IServiceProvider
\bI(?=(?:[A-Z][a-z]{2,})+\b)
# crypt
(['"])\$2[ayb]\$.{56}\g{-1}
"\$2[ayb]\$.{56}"
# scrypt / argon
\$(?:scrypt|argon\d+[di]*)\$\S+
# go.sum
\bh1:\S+
# scala modules
("[^"]+"\s*%%?\s*){2,3}"[^"]+"
# Input to GitHub JSON
content: (['"])[-a-zA-Z=;:/0-9+]*=\g{-1}
content: "[-a-zA-Z=;:/0-9+]*="
# This does not cover multiline strings, if your repository has them,
# you'll want to remove the `(?=.*?")` suffix.
# The `(?=.*?")` suffix should limit the false positives rate
# printf
#%(?:(?:(?:hh?|ll?|[jzt])?[diuoxn]|l?[cs]|L?[fega]|p)(?=[a-z]{2,})|(?:X|L?[FEGA]|p)(?=[a-zA-Z]{2,}))(?=[_a-zA-Z]+\b)(?!%)(?=.*?['"])
# Python string prefix / binary prefix
# Python stringprefix / binaryprefix
# Note that there's a high false positive rate, remove the `?=` and search for the regex to see if the matches seem like reasonable strings
(?<!')\b(?:B|BR|Br|F|FR|Fr|R|RB|RF|Rb|Rf|U|UR|Ur|b|bR|br|f|fR|fr|r|rB|rF|rb|rf|u|uR|ur)'(?=[A-Z]{3,}|[A-Z][a-z]{2,}|[a-z]{3,})
(?<!')\b(?:B|BR|Br|F|FR|Fr|R|RB|RF|Rb|Rf|U|UR|Ur|b|bR|br|f|fR|fr|r|rB|rF|rb|rf|u|uR|ur)'(?:[A-Z]{3,}|[A-Z][a-z]{2,}|[a-z]{3,})
# Regular expressions for (P|p)assword
\([A-Z]\|[a-z]\)[a-z]+
@@ -484,35 +441,16 @@ content: (['"])[-a-zA-Z=;:/0-9+]*=\g{-1}
^\s*/\\[b].*/[gim]*\s*(?:\)(?:;|$)|,$)
# javascript replace regex
\.replace\(/[^/\s"]*/[gim]*\s*,
# assign regex
= /[^*]*?(?:[a-z]{3,}|[A-Z]{3,}|[A-Z][a-z]{2,}).*/
# perl regex test
[!=]~ (?:/.*/|m\{.*?\}|m<.*?>|m([|!/@#,;']).*?\g{-1})
# perl qr regex
(?<!\$)\bqr(?:\{.*?\}|<.*?>|\(.*?\)|([|!/@#,;']).*?\g{-1})
# Go regular expressions
regexp?\.MustCompile\(`[^`]*`\)
# regex choice
\(\?:[^)]+\|[^)]+\)
# proto
^\s*(\w+)\s\g{-1} =
# sed regular expressions
sed 's/(?:[^/]*?[a-zA-Z]{3,}[^/]*?/){2}
# node packages
(["'])\@[^/'" ]+/[^/'" ]+\g{-1}
# go install
go install(?:\s+[a-z]+\.[-@\w/.]+)+
# jetbrains schema https://youtrack.jetbrains.com/issue/RSRP-489571
urn:shemas-jetbrains-com
# kubernetes pod status lists
# https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-phase
\w+(?:-\w+)+\s+\d+/\d+\s+(?:Running|Pending|Succeeded|Failed|Unknown)\s+
@@ -524,47 +462,19 @@ urn:shemas-jetbrains-com
-[0-9a-f]{10}-\w{5}\s
# posthog secrets
([`'"])phc_[^"',]+\g{-1}
posthog\.init\((['"])phc_[^"',]+\g{-1},
# xcode
# xcodeproject scenes
(?:Controller|destination|ID|id)="\w{3}-\w{2}-\w{3}"
(?:Controller|ID|id)="\w{3}-\w{2}-\w{3}"
# xcode api botches
customObjectInstantitationMethod
# configure flags
.* \| --\w{2,}.*?(?=\w+\s\w+)
# font awesome classes
\.fa-[-a-z0-9]+
# bearer auth
(['"])Bear[e][r] .*?\g{-1}
# basic auth
(['"])Basic [-a-zA-Z=;:/0-9+]{3,}\g{-1}
# base64 encoded content
#([`'"])[-a-zA-Z=;:/0-9+]+=\g{-1}
# base64 encoded content in xml/sgml
>[-a-zA-Z=;:/0-9+]+=</
# base64 encoded content, possibly wrapped in mime
#(?:^|[\s=;:?])[-a-zA-Z=;:/0-9+]{50,}(?:[\s=;:?]|$)
# encoded-word
=\?[-a-zA-Z0-9"*%]+\?[BQ]\?[^?]{0,75}\?=
# Time Zones
\b(?:Africa|Atlantic|America|Antarctica|Asia|Australia|Europe|Indian|Pacific)(?:/\w+)+
# linux kernel info
^(?:bugs|flags|Features)\s+:.*
# systemd mode
systemd.*?running in system mode \([-+].*\)$
# Update Lorem based on your content (requires `ge` and `w` from https://github.com/jsoref/spelling; and `review` from https://github.com/check-spelling/check-spelling/wiki/Looking-for-items-locally )
# grep '^[^#].*lorem' .github/actions/spelling/patterns.txt|perl -pne 's/.*i..\?://;s/\).*//' |tr '|' "\n"|sort -f |xargs -n1 ge|perl -pne 's/^[^:]*://'|sort -u|w|sed -e 's/ .*//'|w|review -
# Warning, while `(?i)` is very neat and fancy, if you have some binary files that aren't proper unicode, you might run into:
@@ -575,62 +485,32 @@ systemd.*?running in system mode \([-+].*\)$
(?:\w|\s|[,.])*\b(?i)(?:amet|consectetur|cursus|dolor|eros|ipsum|lacus|libero|ligula|lorem|magna|neque|nulla|suscipit|tempus)\b(?:\w|\s|[,.])*
# Non-English
[a-zA-Z]*[ÀÁÂÃÄÅÆČÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæčçèéêëìíîïðñòóôõöøùúûüýÿĀāŁłŃńŅņŒœŚśŠšŜŝŸŽžź][a-zA-Z]{3}[a-zA-ZÀÁÂÃÄÅÆČÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæčçèéêëìíîïðñòóôõöøùúûüýÿĀāŁłŃńŅņŒœŚśŠšŜŝŸŽžź]*|[a-zA-Z]{3,}[ÀÁÂÃÄÅÆČÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæčçèéêëìíîïðñòóôõöøùúûüýÿĀāŁłŃńŅņŒœŚśŠšŜŝŸŽžź]|[ÀÁÂÃÄÅÆČÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæčçèéêëìíîïðñòóôõöøùúûüýÿĀāŁłŃńŅņŒœŚśŠšŜŝŸŽžź][a-zA-Z]{3,}
# highlighted letters
\[[A-Z]\][a-z]+
[a-zA-Z]*[ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿĀāŁłŃńŅņŒœŚśŠšŜŝŸŽžź][a-zA-Z]{3}[a-zA-ZÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿĀāŁłŃńŅņŒœŚśŠšŜŝŸŽžź]*
# French
# This corpus only had capital letters, but you probably want lowercase ones as well.
\b[LN]'+[a-z]{2,}\b
# latex (check-spelling <= 0.0.21)
#\\(?:n(?:ew|ormal|osub)|r(?:enew)|t(?:able(?:of|)|he|itle))(?=[a-z]+)
# latex (check-spelling >= 0.0.22)
\\\w{2,}\{
# eslint
"varsIgnorePattern": ".+"
# Windows short paths
[/\\][^/\\]{5,6}~\d{1,2}[/\\]
# in check-spelling@v0.0.22+, printf markers aren't automatically consumed
# printf markers
#(?<!\\)\\[nrt](?=[a-z]{2,})
# alternate markers if you run into latex and friends
#(?<!\\)\\[nrt](?=[a-z]{2,})(?=.*['"`])
# apache
a2(?:en|dis)
# weak e-tag
W/"[^"]+"
# latex
\\(?:n(?:ew|ormal|osub)|r(?:enew)|t(?:able(?:of|)|he|itle))(?=[a-z]+)
# the negative lookahead here is to allow catching 'templatesz' as a misspelling
# but to otherwise recognize a Windows path with \templates\foo.template or similar:
#\\(?:necessary|r(?:eport|esolve[dr]?|esult)|t(?:arget|emplates?))(?![a-z])
\\(?:necessary|r(?:eport|esolve[dr]?|esult)|t(?:arget|emplates?))(?![a-z])
# ignore long runs of a single character:
\b([A-Za-z])\g{-1}{3,}\b
# Note that the next example is no longer necessary if you are using
# to match a string starting with a `#`, use a character-class:
[#]backwards
# version suffix <word>v#
(?:(?<=[A-Z]{2})V|(?<=[a-z]{2}|[A-Z]{2})v)\d+(?:\b|(?=[a-zA-Z_]))
# Compiler flags (Unix, Java/Scala)
# Use if you have things like `-Pdocker` and want to treat them as `docker`
#(?:^|[\t ,>"'`=(])-(?:(?:J-|)[DPWXY]|[Llf])(?=[A-Z]{2,}|[A-Z][a-z]|[a-z]{2,})
# Compiler flags (Windows / PowerShell)
# This is a subset of the more general compiler flags pattern.
# It avoids matching `-Path` to prevent it from being treated as `ath`
#(?:^|[\t ,"'`=(])-(?:[DPL](?=[A-Z]{2,})|[WXYlf](?=[A-Z]{2,}|[A-Z][a-z]|[a-z]{2,}))
# Compiler flags (Scala)
(?:^|[\t ,>"'`=(])-J-[DPWXY](?=[A-Z]{2,}|[A-Z][a-z]|[a-z]{2,})
# Compiler flags
#(?:^|[\t ,"'`=(])-[DPWXYLlf](?=[A-Z]{2,}|[A-Z][a-z]|[a-z]{2,})
# Compiler flags (linker)
,-B
# curl arguments
\b(?:\\n|)curl(?:\s+-[a-zA-Z]{1,2}\b)*(?:\s+-[a-zA-Z]{3,})(?:\s+-[a-zA-Z]+)*
# set arguments

View File

@@ -1,24 +1,21 @@
# See https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-excludes
(?:(?i)\.png$)
(?:^|/)(?i)COPYRIGHT
(?:^|/)(?i)LICEN[CS]E
(?:^|/)3rdparty/
(?:^|/)dirs$
(?:^|/)go\.mod$
(?:^|/)go\.sum$
(?:^|/)package(?:-lock|)\.json$
(?:^|/)Pipfile$
(?:^|/)pyproject.toml
(?:^|/)requirements(?:-dev|-doc|-test|)\.txt$
(?:^|/)sources(?:|\.dep)$
(?:^|/)vendor/
\.a$
\.ai$
\.all-contributorsrc$
\.avi$
\.bmp$
\.bz2$
\.cer$
\.class$
\.coveragerc$
\.crl$
\.crt$
\.csr$
@@ -30,15 +27,11 @@
\.eps$
\.exe$
\.gif$
\.git-blame-ignore-revs$
\.gitattributes$
\.gitignore$
\.gitkeep$
\.graffle$
\.gz$
\.icns$
\.ico$
\.ipynb$
\.jar$
\.jks$
\.jpeg$
@@ -48,62 +41,61 @@
\.lock$
\.map$
\.min\..
\.mo$
\.mod$
\.mp3$
\.mp4$
\.o$
\.ocf$
\.otf$
\.p12$
\.parquet$
\.pbxproj$
\.pdf$
\.pem$
\.pfx$
\.png$
\.psd$
\.pyc$
\.pylintrc$
\.qm$
\.runsettings$
\.s$
\.sig$
\.so$
\.svg$
\.svgz$
\.sys$
\.svgz?$
\.tar$
\.tgz$
\.tiff?$
\.ttf$
\.vcxproj\.filters$
\.vsdx$
\.wav$
\.webm$
\.webp$
\.woff
\.woff2?$
\.xcf$
\.xls
\.xlsx?$
\.xpm$
\.xz$
\.yml$
\.zip$
^\.github/actions/spelling/
^\.github/fabricbot.json$
^\.gitignore$
^\Q.git-blame-ignore-revs\E$
^\Q.github/workflows/spelling.yml\E$
^\Qbuild/config/release.gdnbaselines\E$
^\Qdoc/reference/windows-terminal-logo.ans\E$
^\Qsamples/ConPTY/EchoCon/EchoCon/EchoCon.vcxproj.filters\E$
^\Qsrc/host/exe/Host.EXE.vcxproj.filters\E$
^\Qsrc/host/ft_host/chafa.txt\E$
^\Qsrc/host/ft_uia/run.bat\E$
^\Qsrc/host/runft.bat\E$
^\Qsrc/tools/lnkd/lnkd.bat\E$
^\Qsrc/tools/pixels/pixels.bat\E$
^\Qsrc/tools/closetest/CloseTest.vcxproj.filters\E$
^\XamlStyler.json$
^build/config/
^consolegit2gitfilters\.json$
^dep/
^doc/reference/master-sequence-list\.csv$
^doc/reference/master-sequence-list.csv$
^doc/reference/UTF8-torture-test\.txt$
^doc/reference/windows-terminal-logo\.ans$
^oss/
^samples/PixelShaders/Screenshots/
^src/host/ft_uia/run\.bat$
^src/host/runft\.bat$
^src/host/runut\.bat$
^src/interactivity/onecore/BgfxEngine\.
^src/renderer/atlas/
^src/renderer/wddmcon/WddmConRenderer\.
@@ -114,16 +106,14 @@
^src/terminal/parser/ft_fuzzwrapper/run\.bat$
^src/terminal/parser/ut_parser/Base64Test.cpp$
^src/terminal/parser/ut_parser/run\.bat$
^src/tools/benchcat
^src/tools/ConsoleBench
^src/tools/integrity/dirs$
^src/tools/integrity/packageuwp/ConsoleUWP\.appxSources$
^src/tools/RenderingTests/main\.cpp$
^src/tools/lnkd/lnkd\.bat$
^src/tools/pixels/pixels\.bat$
^src/tools/RenderingTests/main.cpp$
^src/tools/texttests/fira\.txt$
^src/tools/U8U16Test/(?!en)..\.
^src/types/ColorFix\.cpp$
^src/types/ut_types/UtilsTests\.cpp$
^tools/ReleaseEngineering/ServicingPipeline\.ps1$
^XamlStyler\.json$
^src/tools/U8U16Test/(?:fr|ru|zh)\.txt$
^src/types/ColorFix.cpp
^src/types/ut_types/UtilsTests.cpp$
^tools/ReleaseEngineering/ServicingPipeline.ps1$
ignore$
Resources/(?!en)
SUMS$

View File

@@ -1,5 +0,0 @@
EOB
swrapped
wordi
wordiswrapped
wrappe

View File

@@ -21,7 +21,6 @@ BBBBCCCCC
BBGGRR
efg
EFG
efgh
EFGh
KLMNOQQQQQQQQQQ
QQQQQQQQQQABCDEFGHIJ

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
WCAG
winui
appshellintegration
mdtauk
gfycat
Guake
xkcd

View File

@@ -1,6 +1,4 @@
# reject `m_data` as VxWorks defined it and that breaks things if it's used elsewhere
# see [fprime](https://github.com/nasa/fprime/commit/d589f0a25c59ea9a800d851ea84c2f5df02fb529)
# and [Qt](https://github.com/qtproject/qt-solutions/blame/fb7bc42bfcc578ff3fa3b9ca21a41e96eb37c1c7/qtscriptclassic/src/qscriptbuffer_p.h#L46)
# reject `m_data` as there's a certain OS which has evil defines that break things if it's used elsewhere
# \bm_data\b
# If you have a framework that uses `it()` for testing and `fit()` for debugging a specific test,
@@ -8,72 +6,40 @@
# to use this:
#\bfit\(
# s.b. anymore
\bany more[,.]
# s.b. GitHub
(?<![&*.]|// |\btype )\bGithub\b(?![{)])
\bGithub\b
# s.b. GitLab
(?<![&*.]|// |\btype )\bGitlab\b(?![{)])
\bGitlab\b
# s.b. JavaScript
\bJavascript\b
# s.b. macOS or Mac OS X or ...
\bMacOS\b
# s.b. Microsoft
\bMicroSoft\b
# s.b. TypeScript
\bTypescript\b
# s.b. another
\ban[- ]other\b
# s.b. deprecation warning
\b[Dd]epreciation [Ww]arnings?\b
# s.b. greater than
\bgreater then\b
# s.b. in front of
\bin from of\b
# s.b. into
# when not phrasal and when `in order to` would be wrong:
# https://thewritepractice.com/into-vs-in-to/
#\sin to\s(?!if\b)
# s.b. is obsolete
\bis obsolescent\b
# s.b. it's or its
\bits[']
#\sin to\s
# s.b. opt-in
#(?<!\sfor)\sopt in\s
\sopt in\s
# s.b. less than
\bless then\b
# s.b. one of
\bon of\b
# s.b. otherwise
\bother[- ]wise\b
# s.b. or (more|less)
\bore (?:more|less)\b
# s.b. nonexistent
\bnon existing\b
\b[Nn]o[nt][- ]existent\b
# s.b. brief / details/ param / return / retval
(?:^\s*|(?:\*|//|/*)\s+`)[\\@](?:breif|(?:detail|detials)|(?:params(?!\.)|prama?)|ret(?:uns?)|retvl)\b
# s.b. preexisting
[Pp]re[- ]existing
@@ -83,37 +49,14 @@
# s.b. preemptively
[Pp]re[- ]emptively
# s.b. recently changed or recent changes
[Rr]ecent changed
# s.b. reentrancy
[Rr]e[- ]entrancy
# s.b. reentrant
[Rr]e[- ]entrant
# s.b. understand
\bunder stand\b
# s.b. workaround(s)
#\bwork[- ]arounds?\b
# s.b. workarounds
#\bwork[- ]arounds\b
# s.b. workaround
(?:(?:[Aa]|[Tt]he|ugly)\swork[- ]around\b|\swork[- ]around\s+for)
# s.b. (coarse|fine)-grained
\b(?:coarse|fine) grained\b
# s.b. neither/nor -- or reword
#\bnot\b[^.?!"/(]+\bnor\b
# probably a double negative
# s.b. neither/nor (plus rewording the beginning)
\bnot\b[^.?!"/]*\bneither\b[^.?!"/(]*\bnor\b
# In English, it is generally wrong to have the same word twice in a row without punctuation.
# Duplicated words are generally mistakes.
# There are a few exceptions where it is acceptable (e.g. "that that").
# If the highlighted doubled word pair is in a code snippet, you can write a pattern to mask it.
# If the highlighted doubled word pair is in prose, have someone read the English before you dismiss this error.
# Reject duplicate words
\s([A-Z]{3,}|[A-Z][a-z]{2,}|[a-z]{3,})\s\g{-1}\s

View File

@@ -0,0 +1,2 @@
\\native(?![a-z])
\\nihilist(?![a-z])

View File

@@ -0,0 +1,8 @@
\\registry(?![a-z])
\\release(?![a-z])
\\resources?(?![a-z])
\\result(?![a-z])
\\resultmacros(?![a-z])
\\rules(?![a-z])
\\renderer(?![a-z])
\\rectread(?![a-z])

View File

@@ -0,0 +1,13 @@
\\telemetry(?![a-z])
\\templates(?![a-z])
\\term(?![a-z])
\\terminal(?![a-z])
\\terminalcore(?![a-z])
\\terminalinput(?![a-z])
\\testlist(?![a-z])
\\testmd(?![a-z])
\\testpasses(?![a-z])
\\tests(?![a-z])
\\thread(?![a-z])
\\tools(?![a-z])
\\types?(?![a-z])

View File

@@ -7,6 +7,10 @@ Note: order of the contents of these files can matter.
Lines from an individual file are handled in file order.
Files are selected in alphabetical order.
* [n](0_n.txt), [r](0_r.txt), and [t](0_t.txt) are specifically to work around
a quirk in the spell checker:
it often sees C strings of the form "Hello\nwerld". And would prefer to
spot the typo of `werld`.
* [patterns](patterns.txt) is the main list -- there is nothing
particularly special about the file name (beyond the extension which is
important).

View File

@@ -3,7 +3,7 @@
https?://\S+
[Pp]ublicKeyToken="?[0-9a-fA-F]{16}"?
(?:[{"]|UniqueIdentifier>)[0-9a-fA-F]{8}-(?:[0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}(?:[}"]|</UniqueIdentifier)
(?:0[Xx]|\\x|U\+|#)[a-f0-9A-FGgRr]{2,}(?!\[)[Uu]?[Ll]{0,2}\b
(?:0[Xx]|\\x|U\+|#)[a-f0-9A-FGgRr]{2,}[Uu]?[Ll]{0,2}\b
microsoft/cascadia-code\@[0-9a-fA-F]{40}
\d+x\d+Logo
Scro\&ll
@@ -12,6 +12,7 @@ Scro\&ll
TestUtils::VerifyExpectedString\(tb, L"[^"]+"
(?:hostSm|mach)\.ProcessString\(L"[^"]+"
\b([A-Za-z])\g{-1}{3,}\b
0x[0-9A-Za-z]+
Base64::s_(?:En|De)code\(L"[^"]+"
VERIFY_ARE_EQUAL\(L"[^"]+"
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\+/"
@@ -23,129 +24,64 @@ ROY\sG\.\sBIV
!(?:(?i)ESC)!\[
!(?:(?i)CSI)!(?:\d+(?:;\d+|)m|[ABCDF])
# SSE intrinsics like "_mm_subs_epu16"
\b_mm(?:|256|512)_\w+\b
# ARM NEON intrinsics like "vsubq_u16"
\bv\w+_[fsu](?:8|16|32|64)\b
# color floating numbers
0x[0-9a-f](?:\.[0-9a-f]*p)[-+]\d+f
# AppX package
_\d[0-9a-z]{12}['\.]
# string test
equals_insensitive_ascii\("\w+", "\w+"
# Python stringprefix / binaryprefix
\b(?:B|BR|Br|F|FR|Fr|R|RB|RF|Rb|Rf|U|UR|Ur|b|bR|br|f|fR|fr|r|rB|rF|rb|rf|u|uR|ur)'
# Automatically suggested patterns
# hit-count: 3788 file-count: 599
# IServiceProvider / isAThing
\b(?:I|isA)(?=(?:[A-Z][a-z]{2,})+\b)
# hit-count: 3831 file-count: 582
# IServiceProvider
\bI(?=(?:[A-Z][a-z]{2,})+\b)
# hit-count: 314 file-count: 21
# hex runs
\b[0-9a-fA-F]{16,}\b
# hit-count: 71 file-count: 35
# Compiler flags
(?:^|[\t ,"'`=(])-[D](?=[A-Z]{2,}|[A-Z][a-z])
(?:^|[\t ,"'`=(])-[X](?!aml)(?=[A-Z]{2,}|[A-Z][a-z]|[a-z]{2,})
# hit-count: 47 file-count: 11
# special cased printf markers
\\r\\n(?=[a-z])|(?<!\\)\\[nrt](?=[a-z]{2,})(?=.*(?:<.*['"`]|"(?:[;,]|\);)$|\) \+$))
# ConsoleArgumentsTests
--headless\\.*?"
# hit-count: 109 file-count: 62
# Compiler flags (Unix, Java/Scala)
# Use if you have things like `-Pdocker` and want to treat them as `docker`
(?:^|[\t ,>"'`=(])-(?:D(?=[A-Z])|[WX]|f(?=[ms]))(?=[A-Z]{2,}|[A-Z][a-z]|[a-z]{2,})
# hit-count: 60 file-count: 35
# hit-count: 41 file-count: 28
# version suffix <word>v#
(?:(?<=[A-Z]{2})V|(?<=[a-z]{2}|[A-Z]{2})v)\d+(?:\b|(?=[a-zA-Z_]))
# hit-count: 2 file-count: 2
# This does not cover multiline strings, if your repository has them,
# you'll want to remove the `(?=.*?")` suffix.
# The `(?=.*?")` suffix should limit the false positives rate
# printf
%(?:s)(?!ize)(?=[a-z]{2,})
# hit-count: 20 file-count: 9
# hex runs
\b[0-9a-fA-F]{16,}\b
# hit-count: 16 file-count: 10
# hit-count: 10 file-count: 7
# uuid:
\b[0-9a-fA-F]{8}-(?:[0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}\b
# hit-count: 13 file-count: 4
# Non-English
[a-zA-Z]*[ÀÁÂÃÄÅÆČÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæčçèéêëìíîïðñòóôõöøùúûüýÿĀāŁłŃńŅņŒœŚśŠšŜŝŸŽžź][a-zA-Z]{3}[a-zA-ZÀÁÂÃÄÅÆČÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæčçèéêëìíîïðñòóôõöøùúûüýÿĀāŁłŃńŅņŒœŚśŠšŜŝŸŽžź]*|[a-zA-Z]{3,}[ÀÁÂÃÄÅÆČÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæčçèéêëìíîïðñòóôõöøùúûüýÿĀāŁłŃńŅņŒœŚśŠšŜŝŸŽžź]|[ÀÁÂÃÄÅÆČÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæčçèéêëìíîïðñòóôõöøùúûüýÿĀāŁłŃńŅņŒœŚśŠšŜŝŸŽžź][a-zA-Z]{3,}
# hit-count: 7 file-count: 5
# hex digits including css/html color classes:
(?:[\\0][xX]|\\u|[uU]\+|#x?|\%23)[0-9_a-fA-FgGrR]*?[a-fA-FgGrR]{2,}[0-9_a-fA-FgGrR]*(?:[uUlL]{0,3}|[iu]\d+)\b
# hit-count: 7 file-count: 1
# regex choice
\(\?:[^)]+\|[^)]+\)
# hit-count: 4 file-count: 4
# tar arguments
\b(?:\\n|)g?tar(?:\.exe|)(?:(?:\s+--[-a-zA-Z]+|\s+-[a-zA-Z]+|\s[ABGJMOPRSUWZacdfh-pr-xz]+\b)(?:=[^ ]*|))+
# hit-count: 4 file-count: 1
# ANSI color codes
(?:\\(?:u00|x)1[Bb]|\x1b|\\u\{1[Bb]\})\[\d+(?:;\d+|)m
# hit-count: 4 file-count: 1
# Update Lorem based on your content (requires `ge` and `w` from https://github.com/jsoref/spelling; and `review` from https://github.com/check-spelling/check-spelling/wiki/Looking-for-items-locally )
# grep '^[^#].*lorem' .github/actions/spelling/patterns.txt|perl -pne 's/.*i..\?://;s/\).*//' |tr '|' "\n"|sort -f |xargs -n1 ge|perl -pne 's/^[^:]*://'|sort -u|w|sed -e 's/ .*//'|w|review -
# Warning, while `(?i)` is very neat and fancy, if you have some binary files that aren't proper unicode, you might run into:
## Operation "substitution (s///)" returns its argument for non-Unicode code point 0x1C19AE (the code point will vary).
## You could manually change `(?i)X...` to use `[Xx]...`
## or you could add the files to your `excludes` file (a version after 0.0.19 should identify the file path)
# Lorem
(?:\w|\s|[,.])*\b(?i)(?:amet|consectetur|cursus|dolor|eros|ipsum|lacus|libero|ligula|lorem|magna|neque|nulla|suscipit|tempus)\b(?:\w|\s|[,.])*
# hit-count: 3 file-count: 3
# mailto urls
mailto:[-a-zA-Z=;:/?%&0-9+@.]{3,}
# hit-count: 4 file-count: 1
# ANSI color codes
(?:\\(?:u00|x)1b|\x1b)\[\d+(?:;\d+|)m
# hit-count: 2 file-count: 1
# Python string prefix / binary prefix
# Note that there's a high false positive rate, remove the `?=` and search for the regex to see if the matches seem like reasonable strings
(?<!')\b(?:B|BR|Br|F|FR|Fr|R|RB|RF|Rb|Rf|U|UR|Ur|b|bR|br|f|fR|fr|r|rB|rF|rb|rf|u|uR|ur)'(?=[A-Z]{3,}|[A-Z][a-z]{2,}|[a-z]{3,})
# latex
\\(?:n(?:ew|ormal|osub)|r(?:enew)|t(?:able(?:of|)|he|itle))(?=[a-z]+)
# hit-count: 1 file-count: 1
# Punycode
\bxn--[-0-9a-z]+
# hex digits including css/html color classes:
(?:[\\0][xX]|\\u|[uU]\+|#x?|\%23)[0-9_a-fA-FgGrR]*?[a-fA-FgGrR]{2,}[0-9_a-fA-FgGrR]*(?:[uUlL]{0,3}|u\d+)\b
# hit-count: 1 file-count: 1
# latex (check-spelling >= 0.0.22)
\\\w{2,}\{
# Non-English
[a-zA-Z]*[ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿĀāŁłŃńŅņŒœŚśŠšŜŝŸŽžź][a-zA-Z]{3}[a-zA-ZÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿĀāŁłŃńŅņŒœŚśŠšŜŝŸŽžź]*
# hit-count: 1 file-count: 1
# tput arguments -- https://man7.org/linux/man-pages/man5/terminfo.5.html -- technically they can be more than 5 chars long...
\btput\s+(?:(?:-[SV]|-T\s*\w+)\s+)*\w{3,5}\b
# Questionably acceptable forms of `in to`
# Personally, I prefer `log into`, but people object
# https://www.tprteaching.com/log-into-log-in-to-login/
\b(?:[Ll]og|[Ss]ign) in to\b
# to opt in
\bto opt in\b
# French
# This corpus only had capital letters, but you probably want lowercase ones as well.
\b[LN]'+[a-z]{2,}\b
# acceptable duplicates
# ls directory listings
[-bcdlpsw](?:[-r][-w][-Ssx]){3}\s+\d+\s+\S+\s+\S+\s+\d+\s+
# mount
\bmount\s+-t\s+(\w+)\s+\g{-1}\b
# C types and repeated CSS values
\s(auto|center|div|Guid|inherit|long|LONG|none|normal|solid|that|thin|transparent|very)(?: \g{-1})+\s
# C struct
\bstruct\s+(\w+)\s+\g{-1}\b
# go templates
\s(\w+)\s+\g{-1}\s+\`(?:graphql|inject|json|yaml):
# doxygen / javadoc / .net
(?:[\\@](?:brief|groupname|t?param|return|retval)|(?:public|private|\[Parameter(?:\(.+\)|)\])(?:\s+static|\s+override|\s+readonly)*)(?:\s+\{\w+\}|)\s+(\w+)\s+\g{-1}\s
[-bcdlpsw](?:[-r][-w][-sx]){3}\s+\d+\s+(\S+)\s+\g{-1}\s+\d+\s+
# C/idl types + English ...
\s(Guid|long|LONG|that) \g{-1}\s
# javadoc / .net
(?:[\\@](?:groupname|param)|(?:public|private)(?:\s+static|\s+readonly)*)\s+(\w+)\s+\g{-1}\s
# Commit message -- Signed-off-by and friends
^\s*(?:(?:Based-on-patch|Co-authored|Helped|Mentored|Reported|Reviewed|Signed-off)-by|Thanks-to): (?:[^<]*<[^>]*>|[^<]*)\s*$

View File

@@ -1,7 +1,6 @@
^attache$
^attacher$
^attachers$
^bellow$
benefitting
occurences?
^dependan.*

3156
.github/fabricbot.json vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,751 +0,0 @@
id:
name: GitOps.PullRequestIssueManagement
description: GitOps.PullRequestIssueManagement primitive
owner:
resource: repository
disabled: false
where:
configuration:
resourceManagementConfiguration:
scheduledSearches:
- description:
frequencies:
- hourly:
hour: 3
filters:
- isIssue
- isOpen
- hasLabel:
label: Needs-Author-Feedback
- hasLabel:
label: No-Recent-Activity
- noActivitySince:
days: 3
actions:
- closeIssue
- description:
frequencies:
- hourly:
hour: 3
filters:
- isIssue
- isOpen
- hasLabel:
label: Needs-Author-Feedback
- noActivitySince:
days: 4
- isNotLabeledWith:
label: No-Recent-Activity
actions:
- addLabel:
label: No-Recent-Activity
- addReply:
reply: This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **4 days**. It will be closed if no further activity occurs **within 3 days of this comment**.
- description:
frequencies:
- hourly:
hour: 3
filters:
- isIssue
- isOpen
- hasLabel:
label: Resolution-Duplicate
- noActivitySince:
days: 1
actions:
- addReply:
reply: This issue has been marked as duplicate and has not had any activity for **1 day**. It will be closed for housekeeping purposes.
- closeIssue
- description:
frequencies:
- hourly:
hour: 3
filters:
- isPullRequest
- isOpen
- hasLabel:
label: Needs-Author-Feedback
- hasLabel:
label: No-Recent-Activity
- noActivitySince:
days: 7
actions:
- closeIssue
- description:
frequencies:
- hourly:
hour: 3
filters:
- isPullRequest
- isOpen
- hasLabel:
label: Needs-Author-Feedback
- noActivitySince:
days: 7
- isNotLabeledWith:
label: No-Recent-Activity
actions:
- addLabel:
label: No-Recent-Activity
- addReply:
reply: This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **7 days**. It will be closed if no further activity occurs **within 7 days of this comment**.
eventResponderTasks:
- if:
- payloadType: Issues
- or:
- and:
- isAction:
action: Opened
- not:
hasLabel:
label: ⛺ Reserved
then:
- addLabel:
label: Needs-Triage
description:
- if:
- payloadType: Issue_Comment
- isAction:
action: Created
- isActivitySender:
issueAuthor: True
- hasLabel:
label: Needs-Author-Feedback
then:
- addLabel:
label: Needs-Attention
- removeLabel:
label: Needs-Author-Feedback
description:
- if:
- payloadType: Issues
- not:
isAction:
action: Closed
- hasLabel:
label: No-Recent-Activity
then:
- removeLabel:
label: No-Recent-Activity
description:
- if:
- payloadType: Issue_Comment
- hasLabel:
label: No-Recent-Activity
then:
- removeLabel:
label: No-Recent-Activity
description:
- if:
- payloadType: Pull_Request_Review
- isAction:
action: Submitted
- isReviewState:
reviewState: Changes_requested
then:
- addLabel:
label: Needs-Author-Feedback
description:
- if:
- payloadType: Pull_Request
- isActivitySender:
issueAuthor: True
- not:
isAction:
action: Closed
- hasLabel:
label: Needs-Author-Feedback
then:
- removeLabel:
label: Needs-Author-Feedback
description:
- if:
- payloadType: Issue_Comment
- isActivitySender:
issueAuthor: True
- hasLabel:
label: Needs-Author-Feedback
then:
- removeLabel:
label: Needs-Author-Feedback
description:
- if:
- payloadType: Pull_Request_Review
- isActivitySender:
issueAuthor: True
- hasLabel:
label: Needs-Author-Feedback
then:
- removeLabel:
label: Needs-Author-Feedback
description:
- if:
- payloadType: Pull_Request
- not:
isAction:
action: Closed
- hasLabel:
label: No-Recent-Activity
then:
- removeLabel:
label: No-Recent-Activity
description:
- if:
- payloadType: Issue_Comment
- hasLabel:
label: No-Recent-Activity
then:
- removeLabel:
label: No-Recent-Activity
description:
- if:
- payloadType: Pull_Request_Review
- hasLabel:
label: No-Recent-Activity
then:
- removeLabel:
label: No-Recent-Activity
description:
- if:
- payloadType: Pull_Request
- hasLabel:
label: AutoMerge
then:
- enableAutoMerge:
mergeMethod: Squash
description:
- if:
- payloadType: Pull_Request
- labelRemoved:
label: AutoMerge
then:
- disableAutoMerge
description:
- if:
- payloadType: Issues
- or:
- and:
- isLabeled
- hasLabel:
label: Mass-Chaos
- isOpen
- isLabeled
- not:
hasLabel:
label: Needs-Tag-Fix
- or:
- and:
- not:
hasLabel:
label: Area-Accessibility
- not:
hasLabel:
label: Area-Build
- not:
hasLabel:
label: Area-Extensibility
- not:
hasLabel:
label: Area-Fonts
- not:
hasLabel:
label: Area-Input
- not:
hasLabel:
label: Area-Interaction
- not:
hasLabel:
label: Area-Interop
- not:
hasLabel:
label: Area-Output
- not:
hasLabel:
label: Area-Performance
- not:
hasLabel:
label: Area-Rendering
- not:
hasLabel:
label: Area-Server
- not:
hasLabel:
label: Area-Settings
- not:
hasLabel:
label: Area-TerminalConnection
- not:
hasLabel:
label: Area-TerminalControl
- not:
hasLabel:
label: Area-User Interface
- not:
hasLabel:
label: Area-VT
- not:
hasLabel:
label: Area-CodeHealth
- not:
hasLabel:
label: Area-Quality
- not:
hasLabel:
label: Area-AzureShell
- not:
hasLabel:
label: Area-Schema
- not:
hasLabel:
label: Area-Commandline
- not:
hasLabel:
label: Area-ShellExtension
- not:
hasLabel:
label: Area-WPFControl
- not:
hasLabel:
label: Area-Settings UI
- not:
hasLabel:
label: Area-DefApp
- not:
hasLabel:
label: Area-Remoting
- not:
hasLabel:
label: Area-Windowing
- not:
hasLabel:
label: Area-Theming
- not:
hasLabel:
label: Area-Localization
- and:
- not:
hasLabel:
label: Issue-Bug
- not:
hasLabel:
label: Issue-Docs
- not:
hasLabel:
label: Issue-Feature
- not:
hasLabel:
label: Issue-Question
- not:
hasLabel:
label: Issue-Samples
- not:
hasLabel:
label: Issue-Task
- not:
hasLabel:
label: Issue-Scenario
- and:
- not:
hasLabel:
label: Product-Cmd.exe
- not:
hasLabel:
label: Product-Colortool
- not:
hasLabel:
label: Product-Conhost
- not:
hasLabel:
label: Product-Conpty
- not:
hasLabel:
label: Product-Meta
- not:
hasLabel:
label: Product-Powershell
- not:
hasLabel:
label: Product-Terminal
- not:
hasLabel:
label: Product-WSL
- and:
- not: isOpen
- and:
- not:
hasLabel:
label: Resolution-Answered
- not:
hasLabel:
label: Resolution-By-Design
- not:
hasLabel:
label: Resolution-Duplicate
- not:
hasLabel:
label: Resolution-External
- not:
hasLabel:
label: Resolution-Fix-Available
- not:
hasLabel:
label: Resolution-Fix-Committed
- not:
hasLabel:
label: Resolution-Won't-Fix
- not:
hasLabel:
label: Needs-Triage
- not:
hasLabel:
label: Resolution-Duplicate
- not:
hasLabel:
label: ⛺ Reserved
- not:
hasLabel:
label: Tracking-External
then:
- addLabel:
label: Needs-Tag-Fix
description:
- if:
- payloadType: Issues
- and:
- isLabeled
- hasLabel:
label: Needs-Tag-Fix
- and:
- or:
- hasLabel:
label: Area-Accessibility
- hasLabel:
label: Area-Build
- hasLabel:
label: Area-Extensibility
- hasLabel:
label: Area-Fonts
- hasLabel:
label: Area-Input
- hasLabel:
label: Area-Interaction
- hasLabel:
label: Area-Interop
- hasLabel:
label: Area-Output
- hasLabel:
label: Area-Performance
- hasLabel:
label: Area-Rendering
- hasLabel:
label: Area-Server
- hasLabel:
label: Area-Settings
- hasLabel:
label: Area-TerminalConnection
- hasLabel:
label: Area-TerminalControl
- hasLabel:
label: Area-User Interface
- hasLabel:
label: Area-VT
- hasLabel:
label: Area-CodeHealth
- hasLabel:
label: Area-Quality
- hasLabel:
label: Area-Schema
- hasLabel:
label: Area-AzureShell
- hasLabel:
label: Area-Commandline
- hasLabel:
label: Area-ShellExtension
- hasLabel:
label: Area-WPFControl
- hasLabel:
label: Area-Settings UI
- hasLabel:
label: Area-DefApp
- hasLabel:
label: Area-Localization
- hasLabel:
label: Area-Windowing
- hasLabel:
label: Area-Theming
- hasLabel:
label: Area-AtlasEngine
- hasLabel:
label: Area-CmdPal
- or:
- hasLabel:
label: Issue-Bug
- hasLabel:
label: Issue-Docs
- hasLabel:
label: Issue-Feature
- hasLabel:
label: Issue-Question
- hasLabel:
label: Issue-Samples
- hasLabel:
label: Issue-Task
- hasLabel:
label: Issue-Scenario
- or:
- hasLabel:
label: Product-Cmd.exe
- hasLabel:
label: Product-Colortool
- hasLabel:
label: Product-Conhost
- hasLabel:
label: Product-Conpty
- hasLabel:
label: Product-Meta
- hasLabel:
label: Product-Powershell
- hasLabel:
label: Product-Terminal
- hasLabel:
label: Product-WSL
- or:
- isOpen
- and:
- not: isOpen
- or:
- hasLabel:
label: Resolution-Answered
- hasLabel:
label: Resolution-By-Design
- hasLabel:
label: Resolution-Duplicate
- hasLabel:
label: Resolution-External
- hasLabel:
label: Resolution-Fix-Available
- hasLabel:
label: Resolution-Fix-Committed
- hasLabel:
label: Resolution-Won't-Fix
- hasLabel:
label: Tracking-External
then:
- removeLabel:
label: Needs-Tag-Fix
description:
- if:
- payloadType: Pull_Request
then:
- inPrLabel:
label: In-PR
description:
- if:
- payloadType: Issues
- hasLabel:
label: Needs-Tag-Fix
- hasLabel:
label: Resolution-Duplicate
then:
- removeLabel:
label: Needs-Tag-Fix
description:
- if:
- payloadType: Issues
- or:
- titleContains:
pattern: ^\s*Bug Report \(IF I DO NOT CHANGE THIS THE ISSUE WILL BE AUTO-CLOSED\)\s*$
isRegex: True
- titleContains:
pattern: ^\s*Bug Report\s*$
isRegex: True
- or:
- isAction:
action: Opened
- isAction:
action: Reopened
- not:
activitySenderHasPermission:
permission: Write
- not:
activitySenderHasPermission:
permission: Admin
then:
- closeIssue
- addLabel:
label: Needs-Author-Feedback
- addReply:
reply: Hi! Thanks for attempting to open an issue. Unfortunately, your title wasn't changed from the original template which makes it very hard for us to track and triage. You are welcome to fix up the title and try again with a new issue.
description:
- if:
- payloadType: Issues
- or:
- isAction:
action: Opened
- isAction:
action: Reopened
- or:
- not:
bodyContains:
pattern: .+
isRegex: True
then:
- closeIssue
- addLabel:
label: Needs-Author-Feedback
- addReply:
reply: "Hi! Thanks for attempting to open an issue. Unfortunately, you didn't write anything in the body which makes it impossible to understand your concern. You are welcome to fix up the issue and try again by opening another issue with the body filled out. "
description:
- if:
- payloadType: Pull_Request
- isLabeled
- hasLabel:
label: Needs-Second
- isOpen
then:
- requestReview:
reviewer: zadjii-msft
- requestReview:
reviewer: PankajBhojwani
- requestReview:
reviewer: carlos-zamora
- requestReview:
reviewer: dhowett
- requestReview:
reviewer: lhecker
description:
- if:
- payloadType: Pull_Request_Review
- not: isOpen
- hasLabel:
label: Needs-Second
then:
- removeLabel:
label: Needs-Second
description:
- if:
- payloadType: Issues
- hasLabel:
label: In-PR
- hasLabel:
label: Help Wanted
- isLabeled
then:
- removeLabel:
label: Help-Wanted
description:
- if:
- payloadType: Issue_Comment
- commentContains:
pattern: '\/dup(licate|e)?(\s+of)?\s+\#[\d]+'
isRegex: True
- or:
- activitySenderHasPermission:
permission: Admin
- activitySenderHasPermission:
permission: Write
then:
- addReply:
reply: Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!
- closeIssue
- removeLabel:
label: Needs-Triage
- addLabel:
label: Resolution-Duplicate
- removeLabel:
label: Needs-Tag-Fix
- removeLabel:
label: Needs-Attention
- removeLabel:
label: Needs-Author-Feedback
- removeLabel:
label: Needs-Repro
- removeLabel:
label: Needs-Second
description:
- if:
- payloadType: Issue_Comment
- commentContains:
pattern: '\/feedback'
isRegex: True
- or:
- activitySenderHasPermission:
permission: Admin
- activitySenderHasPermission:
permission: Write
then:
- addReply:
reply: >2-
Hi there!<br><br>Can you please send us feedback with the [Feedback Hub](https://support.microsoft.com/en-us/windows/send-feedback-to-microsoft-with-the-feedback-hub-app-f59187f8-8739-22d6-ba93-f66612949332) with this issue? Make sure to click the "Start recording" button, then reproduce the issue before submitting the feedback. Once it's submitted, paste the link here so we can more easily find your crash information on the back end?<br><br>Thanks!<br><br>![image](https://user-images.githubusercontent.com/18356694/140811502-a068f78b-89d2-4587-925a-73e19652b830.png)<br><br>![image](https://user-images.githubusercontent.com/18356694/140811557-cdc22a0f-fa6a-4f6a-953e-73b51f5548a3.png)<br><br>![image](https://user-images.githubusercontent.com/18221333/62478649-6de55400-b760-11e9-806e-5aab7e085a9f.png)
- addLabel:
label: Needs-Author-Feedback
description:
- if:
- payloadType: Issue_Comment
then:
- cleanEmailReply
description:
- if:
- payloadType: Pull_Request
then:
- labelSync:
pattern: Issue-
- labelSync:
pattern: Area-
- labelSync:
pattern: Priority-
- labelSync:
pattern: Product-
- labelSync:
pattern: Severity-
- labelSync:
pattern: Impact-
description:
- if:
- payloadType: Issue_Comment
- commentContains:
pattern: '\/dup(licate|e)?(\s+of)?\s+https'
isRegex: True
- or:
- activitySenderHasPermission:
permission: Admin
- activitySenderHasPermission:
permission: Write
then:
- addReply:
reply: Hi! We've identified this issue as a duplicate of one that exists on somebody else's Issue Tracker. Please make sure you subscribe to the referenced external issue for future updates. Thanks for your report!
- closeIssue
- removeLabel:
label: Needs-Triage
- addLabel:
label: Resolution-External
- removeLabel:
label: Needs-Attention
- removeLabel:
label: Needs-Author-Feedback
- removeLabel:
label: Needs-Bisect
- removeLabel:
label: Needs-Repro
- removeLabel:
label: Needs-Second
description:
- if:
- payloadType: Issue_Comment
- commentContains:
pattern: /?
isRegex: False
- or:
- activitySenderHasPermission:
permission: Admin
- activitySenderHasPermission:
permission: Write
then:
- removeLabel:
label: Needs-Attention
- addLabel:
label: Needs-Author-Feedback
description:
onFailure:
onSuccess:

View File

@@ -7,13 +7,13 @@ on:
- labeled
- unlabeled
permissions: {}
permissions: {}
jobs:
add-to-project:
name: Add issue to project
runs-on: ubuntu-latest
steps:
- uses: actions/add-to-project@v0.5.0
- uses: actions/add-to-project@v0.3.0
with:
project-url: https://github.com/orgs/microsoft/projects/159
github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}

View File

@@ -1,33 +0,0 @@
name: GitGudSimilarIssues comments
on:
issues:
types: [opened]
jobs:
getSimilarIssues:
runs-on: ubuntu-latest
outputs:
message: ${{ steps.getBody.outputs.message }}
steps:
- id: getBody
uses: craigloewen-msft/GitGudSimilarIssues@main
with:
issueTitle: ${{ github.event.issue.title }}
issueBody: ${{ github.event.issue.body }}
repo: ${{ github.repository }}
similaritytolerance: "0.75"
add-comment:
needs: getSimilarIssues
runs-on: ubuntu-latest
permissions:
issues: write
if: needs.getSimilarIssues.outputs.message != ''
steps:
- name: Add comment
run: gh issue comment "$NUMBER" --repo "$REPO" --body "$BODY"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NUMBER: ${{ github.event.issue.number }}
REPO: ${{ github.repository }}
BODY: ${{ needs.getSimilarIssues.outputs.message }}

View File

@@ -5,7 +5,7 @@ name: Spell checking
# https://github.com/check-spelling/check-spelling/wiki/Feature%3A-Restricted-Permissions
#
# `jobs.comment-push` runs when a push is made to a repository and the `jobs.spelling` job needs to make a comment
# (in odd cases, it might actually run just to collapse a comment, but that's fairly rare)
# (in odd cases, it might actually run just to collapse a commment, but that's fairly rare)
# it needs `contents: write` in order to add a comment.
#
# `jobs.comment-pr` runs when a pull_request is made to a repository and the `jobs.spelling` job needs to make a comment
@@ -34,29 +34,6 @@ name: Spell checking
#
# For background, see: https://github.com/check-spelling/check-spelling/wiki/Feature:-Update-with-deploy-key
# Sarif reporting
#
# Access to Sarif reports is generally restricted (by GitHub) to members of the repository.
#
# Requires enabling `security-events: write`
# and configuring the action with `use_sarif: 1`
#
# For information on the feature, see: https://github.com/check-spelling/check-spelling/wiki/Feature:-Sarif-output
# Minimal workflow structure:
#
# on:
# push:
# ...
# pull_request_target:
# ...
# jobs:
# # you only want the spelling job, all others should be omitted
# spelling:
# # remove `security-events: write` and `use_sarif: 1`
# # remove `experimental_apply_changes_via_bot: 1`
# ... otherwise adjust the `with:` as you wish
on:
push:
branches:
@@ -66,6 +43,8 @@ on:
pull_request_target:
branches:
- "**"
tags-ignore:
- "**"
types:
- 'opened'
- 'reopened'
@@ -81,11 +60,10 @@ jobs:
contents: read
pull-requests: read
actions: read
security-events: write
outputs:
followup: ${{ steps.spelling.outputs.followup }}
runs-on: ubuntu-latest
if: ${{ contains(github.event_name, 'pull_request') || github.event_name == 'push' }}
if: "contains(github.event_name, 'pull_request') || github.event_name == 'push'"
concurrency:
group: spelling-${{ github.event.pull_request.number || github.ref }}
# note: If you use only_check_changed_files, you do not want cancel-in-progress
@@ -93,50 +71,35 @@ jobs:
steps:
- name: check-spelling
id: spelling
uses: check-spelling/check-spelling@v0.0.22
uses: check-spelling/check-spelling@v0.0.21
with:
suppress_push_for_open_pull_request: ${{ github.actor != 'dependabot[bot]' && 1 }}
suppress_push_for_open_pull_request: 1
checkout: true
check_file_names: 1
spell_check_this: microsoft/terminal@main
spell_check_this: check-spelling/spell-check-this@prerelease
post_comment: 0
use_magic_file: 1
report-timing: 1
warnings: bad-regex,binary-file,deprecated-feature,ignored-expect-variant,large-file,limited-references,no-newline-at-eof,noisy-file,non-alpha-in-dictionary,token-is-substring,unexpected-line-ending,whitespace-in-dictionary,minified-file,unsupported-configuration,no-files-to-check
experimental_apply_changes_via_bot: ${{ github.repository_owner != 'microsoft' && 1 }}
use_sarif: ${{ (!github.event.pull_request || (github.event.pull_request.head.repo.full_name == github.repository)) && 1 }}
extra_dictionary_limit: 20
extra_dictionary_limit: 10
extra_dictionaries:
cspell:software-terms/dict/softwareTerms.txt
cspell:cpp/src/stdlib-cpp.txt
cspell:lorem-ipsum/dictionary.txt
cspell:cpp/src/stdlib-c.txt
cspell:php/dict/php.txt
cspell:filetypes/filetypes.txt
cspell:java/src/java.txt
cspell:python/src/common/extra.txt
cspell:node/dict/node.txt
cspell:java/src/java-terms.txt
cspell:aws/aws.txt
cspell:typescript/dict/typescript.txt
cspell:dotnet/dict/dotnet.txt
cspell:golang/dict/go.txt
cspell:fullstack/dict/fullstack.txt
cspell:cpp/src/compiler-msvc.txt
cspell:software-terms/src/software-terms.txt
cspell:python/src/python/python-lib.txt
cspell:mnemonics/src/mnemonics.txt
cspell:cpp/src/stdlib-cmath.txt
cspell:css/dict/css.txt
cspell:node/node.txt
cspell:cpp/src/stdlib-c.txt
cspell:cpp/src/stdlib-cpp.txt
cspell:fullstack/fullstack.txt
cspell:filetypes/filetypes.txt
cspell:html/html.txt
cspell:cpp/src/compiler-msvc.txt
cspell:python/src/common/extra.txt
cspell:powershell/powershell.txt
cspell:aws/aws.txt
cspell:cpp/src/lang-keywords.txt
cspell:django/dict/django.txt
cspell:npm/npm.txt
cspell:dotnet/dotnet.txt
cspell:python/src/python/python.txt
cspell:html/dict/html.txt
cspell:cpp/src/ecosystem.txt
cspell:cpp/src/compiler-clang-attributes.txt
cspell:npm/dict/npm.txt
cspell:r/src/r.txt
cspell:powershell/dict/powershell.txt
cspell:csharp/csharp.txt
cspell:css/css.txt
cspell:cpp/src/stdlib-cmath.txt
check_extra_dictionaries: ''
comment-push:
name: Report (Push)
@@ -148,10 +111,10 @@ jobs:
if: (success() || failure()) && needs.spelling.outputs.followup && github.event_name == 'push'
steps:
- name: comment
uses: check-spelling/check-spelling@v0.0.22
uses: check-spelling/check-spelling@v0.0.21
with:
checkout: true
spell_check_this: microsoft/terminal@main
spell_check_this: check-spelling/spell-check-this@prerelease
task: ${{ needs.spelling.outputs.followup }}
comment-pr:
@@ -160,38 +123,12 @@ jobs:
runs-on: ubuntu-latest
needs: spelling
permissions:
contents: read
pull-requests: write
if: (success() || failure()) && needs.spelling.outputs.followup && contains(github.event_name, 'pull_request')
steps:
- name: comment
uses: check-spelling/check-spelling@v0.0.22
uses: check-spelling/check-spelling@v0.0.21
with:
checkout: true
spell_check_this: microsoft/terminal@main
spell_check_this: check-spelling/spell-check-this@prerelease
task: ${{ needs.spelling.outputs.followup }}
experimental_apply_changes_via_bot: ${{ github.repository_owner != 'microsoft' && 1 }}
update:
name: Update PR
permissions:
contents: write
pull-requests: write
actions: read
runs-on: ubuntu-latest
if: ${{
github.repository_owner != 'microsoft' &&
github.event_name == 'issue_comment' &&
github.event.issue.pull_request &&
contains(github.event.comment.body, '@check-spelling-bot apply')
}}
concurrency:
group: spelling-update-${{ github.event.issue.number }}
cancel-in-progress: false
steps:
- name: apply spelling updates
uses: check-spelling/check-spelling@v0.0.22
with:
experimental_apply_changes_via_bot: ${{ github.repository_owner != 'microsoft' && 1 }}
checkout: true
ssh_key: "${{ secrets.CHECK_SPELLING }}"

29
.vscode/settings.json vendored
View File

@@ -1,28 +1,8 @@
{
"C_Cpp.default.browse.databaseFilename": "${workspaceFolder}\\.vscode\\.BROWSE.VC.DB",
"C_Cpp.default.browse.limitSymbolsToIncludedHeaders": true,
"C_Cpp.default.browse.path": [
"${workspaceFolder}"
],
"C_Cpp.default.cppStandard": "c++20",
"C_Cpp.default.cStandard": "c17",
"C_Cpp.default.defines": [
"_DEBUG",
"_UNICODE",
"BUILD_ONECORE_INTERACTIVITY",
"DBG",
"NT_SUCCESS",
"UNICODE",
"UNIT_TESTING",
"INLINE_TEST_METHOD_MARKUP",
],
"C_Cpp.default.includePath": [
"${workspaceFolder}/**",
"${workspaceFolder}/**/Generated Files",
"${workspaceFolder}/**/inc",
"${workspaceFolder}/**/include",
"${workspaceFolder}/**/Include"
],
"C_Cpp.loggingLevel": "None",
"files.associations": {
"xstring": "cpp",
@@ -118,13 +98,12 @@
"coroutine": "cpp",
"format": "cpp",
"forward_list": "cpp",
"latch": "cpp",
"gsl_assert": "cpp"
"latch": "cpp"
},
"files.exclude": {
"**/bin/**": true,
"**/Generated Files/**": true,
"**/obj/**": true,
"**/packages/**": true,
},
}
"**/Generated Files/**": true
}
}

View File

@@ -14,7 +14,7 @@ The point of doing all this work in public is to ensure that we are holding ours
The team triages new issues several times a week. During triage, the team uses labels to categorize, manage, and drive the project workflow.
We employ [a bot engine](./doc/bot.md) to help us automate common processes within our workflow.
We employ [a bot engine](https://github.com/microsoft/terminal/blob/main/doc/bot.md) to help us automate common processes within our workflow.
We drive the bot by tagging issues with specific labels which cause the bot engine to close issues, merge branches, etc. This bot engine helps us keep the repo clean by automating the process of notifying appropriate parties if/when information/follow-up is needed, and closing stale issues/PRs after reminders have remained unanswered for several days.
@@ -101,7 +101,7 @@ If you don't have any additional info/context to add but would like to indicate
If you're able & willing to help fix issues and/or implement features, we'd love your contribution!
The best place to start is the list of ["walkthroughs"](https://aka.ms/terminal-walkthroughs). This is a collection of issues where we've written a "walkthrough", little guides to help get started with a particular issue. These are usually good first issues, and are a great way to get familiar with the codebase. Additionally, the list of ["good first issue"](https://github.com/microsoft/terminal/issues?q=is%3Aopen+is%3Aissue+label%3A%22Help+Wanted%22++label%3A%22good+first+issue%22+)s is another set of issues that might be easier for first-time contributors. Once you're feeling more comfortable in the codebase, feel free to just use the ["Help Wanted"](https://github.com/microsoft/terminal/issues?q=is%3Aopen+is%3Aissue+label%3A%22Help+Wanted%22+) label, or just find any issue you're interested in and hop in!
The best place to start is the list of ["good first issue"](https://github.com/microsoft/terminal/issues?q=is%3Aopen+is%3Aissue+label%3A%22Help+Wanted%22++label%3A%22good+first+issue%22+)s. These are bugs or tasks that we on the team believe would be easier to implement for someone without any prior experience in the codebase. Once you're feeling more comfortable in the codebase, feel free to just use the ["Help Wanted"](https://github.com/microsoft/terminal/issues?q=is%3Aopen+is%3Aissue+label%3A%22Help+Wanted%22+) label, or just find an issue you're interested in and hop in!
Generally, we categorize issues in the following way, which is largely derived from our old internal work tracking system:
* ["Bugs"](https://github.com/microsoft/terminal/issues?q=is%3Aopen+is%3Aissue+label%3A%22Issue-Bug%22+) are parts of the Terminal & Console that are not quite working the right way. There's code to already support some scenario, but it's not quite working right. Fixing these is generally a matter of debugging the broken functionality and fixing the wrong code.

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,4 @@
![terminal-logos](https://github.com/microsoft/terminal/assets/91625426/333ddc76-8ab2-4eb4-a8c0-4d7b953b1179)
![terminal-logos](https://user-images.githubusercontent.com/48369326/115790869-4c852b00-a37c-11eb-97f1-f61972c7800c.png)
# Welcome to the Windows Terminal, Console and Command-Line repo
@@ -8,8 +8,8 @@ This repository contains the source code for:
* [Windows Terminal Preview](https://aka.ms/terminal-preview)
* The Windows console host (`conhost.exe`)
* Components shared between the two projects
* [ColorTool](./src/tools/ColorTool)
* [Sample projects](./samples)
* [ColorTool](https://github.com/microsoft/terminal/tree/main/src/tools/ColorTool)
* [Sample projects](https://github.com/microsoft/terminal/tree/main/samples)
that show how to consume the Windows Console APIs
Related repositories include:
@@ -21,8 +21,7 @@ Related repositories include:
## Installing and running Windows Terminal
> [!NOTE]
> Windows Terminal requires Windows 10 2004 (build 19041) or later
> **Note**: Windows Terminal requires Windows 10 2004 (build 19041) or later
### Microsoft Store [Recommended]
@@ -53,10 +52,9 @@ fails for any reason, you can try the following command at a PowerShell prompt:
Add-AppxPackage Microsoft.WindowsTerminal_<versionNumber>.msixbundle
```
> [!NOTE]
> If you install Terminal manually:
> **Note**: If you install Terminal manually:
>
> * You may need to install the [VC++ v14 Desktop Framework Package](https://docs.microsoft.com/troubleshoot/cpp/c-runtime-packages-desktop-bridge#how-to-install-and-update-desktop-framework-packages).
> * You may need to install the [VC++ v14 Desktop Framework Package](https://docs.microsoft.com/troubleshoot/cpp/c-runtime-packages-desktop-bridge#how-to-install-and-update-desktop-framework-packages).
> This should only be necessary on older builds of Windows 10 and only if you get an error about missing framework packages.
> * Terminal will not auto-update when new builds are released so you will need
> to regularly install the latest Terminal release to receive all the latest
@@ -72,9 +70,6 @@ package:
winget install --id Microsoft.WindowsTerminal -e
```
> [!NOTE]
> Dependency support is available in WinGet version [1.6.2631 or later](https://github.com/microsoft/winget-cli/releases). To install the Terminal stable release 1.18 or later, please make sure you have the updated version of the WinGet client.
#### Via Chocolatey (unofficial)
[Chocolatey](https://chocolatey.org) users can download and install the latest
@@ -118,31 +113,9 @@ repository.
---
## Installing Windows Terminal Canary
Windows Terminal Canary is a nightly build of Windows Terminal. This build has the latest code from our `main` branch, giving you an opportunity to try features before they make it to Windows Terminal Preview.
Windows Terminal Canary is our least stable offering, so you may discover bugs before we have had a chance to find them.
Windows Terminal Canary is available as an App Installer distribution and a Portable ZIP distribution.
The App Installer distribution supports automatic updates. Due to platform limitations, this installer only works on Windows 11.
The Portable ZIP distribution is a portable application. It will not automatically update and will not automatically check for updates. This portable ZIP distribution works on Windows 10 (19041+) and Windows 11.
| Distribution | Architecture | Link |
|---------------|:---------------:|------------------------------------------------------|
| App Installer | x64, arm64, x86 | [download](https://aka.ms/terminal-canary-installer) |
| Portable ZIP | x64 | [download](https://aka.ms/terminal-canary-zip-x64) |
| Portable ZIP | ARM64 | [download](https://aka.ms/terminal-canary-zip-arm64) |
| Portable ZIP | x86 | [download](https://aka.ms/terminal-canary-zip-x86) |
_Learn more about the [types of Windows Terminal distributions](https://learn.microsoft.com/windows/terminal/distributions)._
---
## Windows Terminal Roadmap
The plan for the Windows Terminal [is described here](/doc/roadmap-2023.md) and
The plan for the Windows Terminal [is described here](/doc/roadmap-2022.md) and
will be updated as the project proceeds.
## Project Build Status
@@ -262,8 +235,7 @@ Cause: You're launching the incorrect solution in Visual Studio.
Solution: Make sure you're building & deploying the `CascadiaPackage` project in
Visual Studio.
> [!NOTE]
> `OpenConsole.exe` is just a locally-built `conhost.exe`, the classic
> **Note**: `OpenConsole.exe` is just a locally-built `conhost.exe`, the classic
> Windows Console that hosts Windows' command-line infrastructure. OpenConsole
> is used by Windows Terminal to connect to and communicate with command-line
> applications (via
@@ -286,7 +258,7 @@ enhance Windows Terminal\!
***BEFORE you start work on a feature/fix***, please read & follow our
[Contributor's
Guide](./CONTRIBUTING.md) to
Guide](https://github.com/microsoft/terminal/blob/main/CONTRIBUTING.md) to
help avoid any wasted or duplicate effort.
## Communicating with the Team
@@ -299,10 +271,10 @@ similar open/closed preexisting issues before creating a new issue.**
If you would like to ask a question that you feel doesn't warrant an issue
(yet), please reach out to us via Twitter:
* Christopher Nguyen, Product Manager:
[@nguyen_dows](https://twitter.com/nguyen_dows)
* Kayla Cinnamon, Program Manager:
[@cinnamon\_msft](https://twitter.com/cinnamon_msft)
* Dustin Howett, Engineering Lead: [@dhowett](https://twitter.com/DHowett)
* Mike Griese, Senior Developer: [@zadjii@mastodon.social](https://mastodon.social/@zadjii)
* Mike Griese, Senior Developer: [@zadjii](https://twitter.com/zadjii)
* Carlos Zamora, Developer: [@cazamor_msft](https://twitter.com/cazamor_msft)
* Pankaj Bhojwani, Developer
* Leonard Hecker, Developer: [@LeonardHecker](https://twitter.com/LeonardHecker)
@@ -387,10 +359,10 @@ Please review these brief docs below about our coding practices.
This is a work in progress as we learn what we'll need to provide people in
order to be effective contributors to our project.
* [Coding Style](./doc/STYLE.md)
* [Code Organization](./doc/ORGANIZATION.md)
* [Exceptions in our legacy codebase](./doc/EXCEPTIONS.md)
* [Helpful smart pointers and macros for interfacing with Windows in WIL](./doc/WIL.md)
* [Coding Style](https://github.com/microsoft/terminal/blob/main/doc/STYLE.md)
* [Code Organization](https://github.com/microsoft/terminal/blob/main/doc/ORGANIZATION.md)
* [Exceptions in our legacy codebase](https://github.com/microsoft/terminal/blob/main/doc/EXCEPTIONS.md)
* [Helpful smart pointers and macros for interfacing with Windows in WIL](https://github.com/microsoft/terminal/blob/main/doc/WIL.md)
---

View File

@@ -14,4 +14,4 @@ Support for Windows Terminal is limited to the resources listed above.
[gh-bug]: https://github.com/microsoft/terminal/issues/new?assignees=&labels=Issue-Bug&template=bug_report.md&title=
[gh-feature]: https://github.com/microsoft/terminal/issues/new?assignees=&labels=Issue-Feature&template=Feature_Request.md&title=
[docs]: https://docs.microsoft.com/windows/terminal
[contributor]: ./CONTRIBUTING.md
[contributor]: https://github.com/microsoft/terminal/blob/main/CONTRIBUTING.md

View File

@@ -20,7 +20,9 @@ Param(
$helixResultsContainerUri = $Env:HELIX_RESULTS_CONTAINER_URI
$helixResultsContainerRsas = $Env:HELIX_RESULTS_CONTAINER_RSAS
$rerunPassesRequiredToAvoidFailure = $env:rerunPassesRequiredToAvoidFailure
Add-Type -Language CSharp -ReferencedAssemblies System.Xml,System.Xml.Linq,System.Runtime.Serialization,System.Runtime.Serialization.Json (Get-Content $PSScriptRoot\HelixTestHelpers.cs -Raw)
$testResultParser = [HelixTestHelpers.TestResultParser]::new($TestNamePrefix, $helixResultsContainerUri, $helixResultsContainerRsas)
$testResultParser.ConvertWttLogToXUnitLog($WttInputPath, $WttSingleRerunInputPath, $WttMultipleRerunInputPath, $XUnitOutputPath)
$testResultParser.ConvertWttLogToXUnitLog($WttInputPath, $WttSingleRerunInputPath, $WttMultipleRerunInputPath, $XUnitOutputPath, $rerunPassesRequiredToAvoidFailure)

View File

@@ -20,13 +20,32 @@ namespace HelixTestHelpers
public string Name { get; set; }
public string SourceWttFile { get; set; }
public bool Passed { get; set; }
public bool Skipped { get; set; }
public bool CleanupPassed { get; set; }
public TimeSpan ExecutionTime { get; set; }
public string Details { get; set; }
public List<string> Screenshots { get; private set; }
public List<TestResult> RerunResults { get; private set; }
// Returns true if the test pass rate is sufficient to avoid being counted as a failure.
public bool PassedOrUnreliable(int requiredNumberOfPasses)
{
if(Passed)
{
return true;
}
else
{
if(RerunResults.Count == 1)
{
return RerunResults[0].Passed;
}
else
{
return RerunResults.Where(r => r.Passed).Count() >= requiredNumberOfPasses;
}
}
}
}
//
@@ -202,9 +221,7 @@ namespace HelixTestHelpers
testsExecuting--;
// If any inner test fails, we'll still fail the outer
var value = element.Attribute("Result").Value;
currentResult.Passed = value == "Pass";
currentResult.Skipped = value == "Skipped";
currentResult.Passed &= element.Attribute("Result").Value == "Pass";
// Only gather execution data if this is the outer test we ran initially
if (testsExecuting == 0)
@@ -481,7 +498,7 @@ namespace HelixTestHelpers
return subResultsJsonByMethod;
}
public void ConvertWttLogToXUnitLog(string wttInputPath, string wttSingleRerunInputPath, string wttMultipleRerunInputPath, string xunitOutputPath)
public void ConvertWttLogToXUnitLog(string wttInputPath, string wttSingleRerunInputPath, string wttMultipleRerunInputPath, string xunitOutputPath, int requiredPassRateThreshold)
{
TestPass testPass = TestPass.ParseTestWttFileWithReruns(wttInputPath, wttSingleRerunInputPath, wttMultipleRerunInputPath, cleanupFailuresAreRegressions: true, truncateTestNames: false);
var results = testPass.TestResults;
@@ -493,8 +510,8 @@ namespace HelixTestHelpers
// If the test failed sufficiently often enough for it to count as a failed test (determined by a property on the
// Azure DevOps job), we'll later mark it as failed during test results processing.
int failedCount = results.Where(r => !r.Passed).Count();
int skippedCount = results.Where(r => (!r.Passed && r.Skipped)).Count();
int failedCount = results.Where(r => !r.PassedOrUnreliable(requiredPassRateThreshold)).Count();
int skippedCount = results.Where(r => !r.Passed && r.PassedOrUnreliable(requiredPassRateThreshold)).Count();
var root = new XElement("assemblies");
@@ -540,13 +557,12 @@ namespace HelixTestHelpers
string resultString = string.Empty;
if (result.Passed && !result.Skipped)
if (result.Passed)
{
resultString = "Pass";
}
else if (result.Skipped)
else if(result.PassedOrUnreliable(requiredPassRateThreshold))
{
resultString = "Skip";
}
else
@@ -555,25 +571,31 @@ namespace HelixTestHelpers
}
test.SetAttributeValue("result", resultString);
if (!result.Passed)
{
if (result.Skipped)
// If a test failed, we'll have rerun it multiple times.
// We'll save the subresults to a JSON text file that we'll upload to the helix results container -
// this allows it to be as long as we want, whereas the reason field in Azure DevOps has a 4000 character limit.
string subResultsFileName = methodName + "_subresults.json";
string subResultsFilePath = Path.Combine(Path.GetDirectoryName(wttInputPath), subResultsFileName);
if (result.PassedOrUnreliable(requiredPassRateThreshold))
{
var reason = new XElement("reason");
reason.Add(new XCData("Test skipped"));
reason.Add(new XCData(GetUploadedFileUrl(subResultsFileName, helixResultsContainerUri, helixResultsContainerRsas)));
test.Add(reason);
}
else {
else
{
var failure = new XElement("failure");
var message = new XElement("message");
message.Add(new XCData("Test failed"));
message.Add(new XCData(GetUploadedFileUrl(subResultsFileName, helixResultsContainerUri, helixResultsContainerRsas)));
failure.Add(message);
test.Add(failure);
}
}
test.SetAttributeValue("result", resultString);
collection.Add(test);
}

View File

@@ -1,38 +0,0 @@
Param(
[Parameter(Mandatory = $true)]
[string]$XUnitOutputPath
)
# This script is used to parse the XUnit output from the test runs and print out
# the tests that failed.
#
# Why you might ask? Well, it sure seems like Azure DevOps doesn't like the fact
# that we just call our tests in a powershell script. It can't seemingly find
# the actual errors in the TAEF logs. That means when you just go to the
# "Checks" page on GitHub, the Azure DevOps integration doesn't have anything
# meaningful to say other than "PowerShell exited with code '1'". If we however,
# just manually emit the test names formatted with "#[error]" in front of them,
# well, then the integration will all work like magic.
# Load the test results as a XML object
$testResults = [xml](Get-Content -Path $XUnitOutputPath)
# Our XML looks like:
# <assemblies>
# <assembly name="MUXControls.Test.dll" test-framework="TAEF" run-date="2023-08-14" run-time="11:38:01" total="524" passed="520" failed="4" skipped="1" time="8943" errors="0">
# <collection total="524" passed="520" failed="4" skipped="1" name="Test collection" time="8943">
# <test name="ControlCoreTests::TestSimpleClickSelection" type="ControlCoreTests" method="TestSimpleClickSelection" time="0.016" result="Fail">
# Iterate over all the assemblies and print all the tests that failed
foreach ($assembly in $testResults.assemblies.assembly) {
foreach ($collection in $assembly.collection) {
foreach ($test in $collection.test) {
if ($test.result -eq "Fail") {
# This particular format is taken from the Azure DevOps documentation:
# https://github.com/microsoft/azure-pipelines-tasks/blob/master/docs/authoring/commands.md
# This will treat this line as an error message
Write-Output "##vso[task.logissue type=error]$($test.name) Failed"
}
}
}
}

View File

@@ -1,7 +1,7 @@
[
{
"MatchedPath": [
"Microsoft.Terminal.Control/Microsoft.Terminal.Control.dll"
"PublicTerminalCore.dll"
],
"SigningInfo": {
"Operations": [

View File

@@ -1,38 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<AppInstaller
xmlns="http://schemas.microsoft.com/appx/appinstaller/2017/2"
Version="1.0.0.0"
Uri="$$ROOT$$$$NAME$$.appinstaller">
<MainBundle
Name="$$NAME$$"
Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US"
Version="$$VERSION$$"
Uri="$$ROOT$$$$PACKAGE$$" />
<Dependencies>
<Package
Name="Microsoft.UI.Xaml.2.8"
Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US"
Version="8.2305.5001.0"
ProcessorArchitecture="x64"
Uri="https://github.com/microsoft/microsoft-ui-xaml/releases/download/v2.8.4/Microsoft.UI.Xaml.2.8.x64.appx" />
<Package
Name="Microsoft.UI.Xaml.2.8"
Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US"
Version="8.2305.5001.0"
ProcessorArchitecture="x86"
Uri="https://github.com/microsoft/microsoft-ui-xaml/releases/download/v2.8.4/Microsoft.UI.Xaml.2.8.x86.appx" />
<Package
Name="Microsoft.UI.Xaml.2.8"
Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US"
Version="8.2305.5001.0"
ProcessorArchitecture="arm64"
Uri="https://github.com/microsoft/microsoft-ui-xaml/releases/download/v2.8.4/Microsoft.UI.Xaml.2.8.arm64.appx" />
</Dependencies>
<UpdateSettings>
<OnLaunch
HoursBetweenUpdateChecks="6" />
</UpdateSettings>
</AppInstaller>

View File

@@ -9,7 +9,7 @@
<PropertyGroup>
<!-- Optional, defaults to main. Name of the branch which will be used for calculating branch point. -->
<PGOBranch>main</PGOBranch>
<PGOBranch>release-1.18</PGOBranch>
<!-- Mandatory. Name of the NuGet package which will contain PGO databases for consumption by build system. -->
<PGOPackageName>Microsoft.Internal.Windows.Terminal.PGODatabase</PGOPackageName>

View File

@@ -4,7 +4,6 @@ trigger:
include:
- main
- feature/*
- gh-readonly-queue/*
paths:
exclude:
- doc/*
@@ -103,7 +102,7 @@ stages:
- ${{ if ne(variables['Build.Reason'], 'PullRequest') }}:
- stage: CodeIndexer
displayName: GitHub CodeNav Indexer
displayName: Github CodeNav Indexer
dependsOn: []
jobs:
- template: ./templates-v2/job-index-github-codenav.yml

View File

@@ -75,7 +75,6 @@ steps:
rm LocOutputMunged.tar
rm -r -fo LocOutput
& ./build/scripts/Copy-ContextMenuResourcesToCascadiaPackage.ps1
& ./build/scripts/Generate-PseudoLocalizations.ps1
displayName: Move Loc files to the right places
- pwsh: |-

View File

@@ -0,0 +1,23 @@
trigger: none
pr: none
schedules:
- cron: "30 3 * * 2-6" # Run at 03:30 UTC Tuesday through Saturday (After the work day in Pacific, Mon-Fri)
displayName: "Nightly Terminal Build"
branches:
include:
- main
always: false # only run if there's code changes!
name: $(BuildDefinitionName)_$(date:yyMM).$(date:dd)$(rev:rrr)
extends:
template: templates-v2\pipeline-full-release-build.yml
parameters:
branding: Canary
buildTerminal: true
pgoBuildMode: Optimize
codeSign: true
generateSbom: true
publishSymbolsToPublic: true
publishVpackToWindows: false
symbolExpiryTime: 15 # Nightly builds do not keep symbols for very long!

View File

@@ -35,13 +35,9 @@ extends:
symbolExpiryTime: 15
${{ if eq(true, parameters.publishToAzure) }}:
extraPublishJobs:
- template: build/pipelines/templates-v2/job-deploy-to-azure-storage.yml@self
- template: job-deploy-to-azure-storage.yml
parameters:
pool: { type: windows }
variables:
ob_git_checkout: false # This job checks itself out
ob_git_skip_checkout_none: true
ob_outputDirectory: "$(Build.SourcesDirectory)/_none"
dependsOn: [PublishSymbols]
storagePublicRootURL: $(AppInstallerRootURL)
subscription: $(AzureSubscriptionName)

View File

@@ -0,0 +1,84 @@
trigger: none
pr: none
# Expose all of these parameters for user configuration.
parameters:
- name: branding
displayName: "Branding (Build Type)"
type: string
default: Release
values:
- Release
- Preview
- Dev
- name: buildTerminal
displayName: "Build Windows Terminal MSIX"
type: boolean
default: true
- name: buildConPTY
displayName: "Build ConPTY NuGet"
type: boolean
default: false
- name: buildWPF
displayName: "Build Terminal WPF Control"
type: boolean
default: false
- name: pgoBuildMode
displayName: "PGO Build Mode"
type: string
default: Optimize
values:
- Optimize
- Instrument
- None
- name: buildConfigurations
displayName: "Build Configurations"
type: object
default:
- Release
- name: buildPlatforms
displayName: "Build Platforms"
type: object
default:
- x64
- x86
- arm64
- name: codeSign
displayName: "Sign all build outputs"
type: boolean
default: true
- name: generateSbom
displayName: "Generate a Bill of Materials"
type: boolean
default: true
- name: terminalInternalPackageVersion
displayName: "Terminal Internal Package Version"
type: string
default: '0.0.8'
- name: publishSymbolsToPublic
displayName: "Publish Symbols to MSDL"
type: boolean
default: true
- name: publishVpackToWindows
displayName: "Publish VPack to Windows"
type: boolean
default: false
name: $(BuildDefinitionName)_$(date:yyMM).$(date:dd)$(rev:rrr)
extends:
template: templates-v2/pipeline-full-release-build.yml
parameters:
branding: ${{ parameters.branding }}
buildTerminal: ${{ parameters.buildTerminal }}
buildConPTY: ${{ parameters.buildConPTY }}
buildWPF: ${{ parameters.buildWPF }}
pgoBuildMode: ${{ parameters.pgoBuildMode }}
buildConfigurations: ${{ parameters.buildConfigurations }}
buildPlatforms: ${{ parameters.buildPlatforms }}
codeSign: ${{ parameters.codeSign }}
generateSbom: ${{ parameters.generateSbom }}
terminalInternalPackageVersion: ${{ parameters.terminalInternalPackageVersion }}
publishSymbolsToPublic: ${{ parameters.publishSymbolsToPublic }}
publishVpackToWindows: ${{ parameters.publishVpackToWindows }}

View File

@@ -92,11 +92,6 @@ jobs:
# Yup.
BuildTargetParameter: ' '
SelectedSigningFragments: ' '
# When building the unpackaged distribution, build it in portable mode if it's Canary-branded
${{ if eq(parameters.branding, 'Canary') }}:
UnpackagedBuildArguments: -PortableMode
${{ else }}:
UnpackagedBuildArguments: ' '
JobOutputDirectory: $(Terminal.BinDir)
JobOutputArtifactName: build-$(BuildPlatform)-$(BuildConfiguration)${{ parameters.artifactStem }}
${{ insert }}: ${{ parameters.variables }}
@@ -122,7 +117,7 @@ jobs:
$SignFragments += "wpfdotnet"
}
If ([bool]::Parse("${{ parameters.buildWPF }}")) {
$BuildTargets += "Terminal\Control\Microsoft_Terminal_Control"
$BuildTargets += "Terminal\wpf\PublicTerminalCore"
$SignFragments += "wpf"
}
If ([bool]::Parse("${{ parameters.buildConPTY }}")) {
@@ -152,7 +147,6 @@ jobs:
/p:WindowsTerminalOfficialBuild=true;WindowsTerminalBranding=${{ parameters.branding }};PGOBuildMode=${{ parameters.pgoBuildMode }}
${{ parameters.additionalBuildOptions }}
/bl:$(Build.SourcesDirectory)\msbuild.binlog
/graph
$(BuildTargetParameter)
platform: $(BuildPlatform)
configuration: $(BuildConfiguration)
@@ -275,7 +269,7 @@ jobs:
- pwsh: |-
$XamlAppxPath = (Get-Item "src\cascadia\CascadiaPackage\AppPackages\*\Dependencies\$(BuildPlatform)\Microsoft.UI.Xaml*.appx").FullName
$outDir = New-Item -Type Directory "$(Terminal.BinDir)/_unpackaged" -ErrorAction:Ignore
& .\build\scripts\New-UnpackagedTerminalDistribution.ps1 $(UnpackagedBuildArguments) -TerminalAppX $(WindowsTerminalPackagePath) -XamlAppX $XamlAppxPath -Destination $outDir.FullName
& .\build\scripts\New-UnpackagedTerminalDistribution.ps1 -TerminalAppX $(WindowsTerminalPackagePath) -XamlAppX $XamlAppxPath -Destination $outDir.FullName
displayName: Build Unpackaged Distribution (from MSIX)
condition: and(succeeded(), ne(variables.WindowsTerminalPackagePath, ''))

View File

@@ -1,92 +0,0 @@
parameters:
- name: buildConfiguration
type: string
- name: buildPlatforms
type: object
- name: pool
type: object
default: []
- name: dependsOn
type: object
default: null
- name: artifactStem
type: string
default: ''
- name: variables
type: object
default: {}
- name: environment
type: string
- name: storagePublicRootURL
type: string
- name: subscription
type: string
- name: storageAccount
type: string
- name: storageContainer
type: string
jobs:
- job: DeployAzure
${{ if ne(length(parameters.pool), 0) }}:
pool: ${{ parameters.pool }}
displayName: Publish to Azure Storage (Prod)
dependsOn: ${{ parameters.dependsOn }}
variables:
${{ insert }}: ${{ parameters.variables }}
steps:
- download: none
- checkout: self
clean: true
fetchDepth: 1
fetchTags: false # Tags still result in depth > 1 fetch; we don't need them here
submodules: true
persistCredentials: True
- task: DownloadPipelineArtifact@2
displayName: Download MSIX Bundle Artifact
inputs:
artifactName: appxbundle-${{ parameters.buildConfiguration }}${{ parameters.artifactStem }}
downloadPath: '$(Build.SourcesDirectory)/_out'
itemPattern: '**/*.msixbundle'
- ${{ each platform in parameters.buildPlatforms }}:
- task: DownloadPipelineArtifact@2
displayName: Download unpackaged build for ${{ platform }} ${{ parameters.buildConfiguration }}
inputs:
artifactName: build-${{ platform }}-${{ parameters.buildConfiguration }}${{ parameters.artifactStem }}
downloadPath: '$(Build.SourcesDirectory)/_unpackaged'
itemPattern: '**/_unpackaged/*.zip'
- pwsh: |-
$b = Get-Item _out/*.msixbundle
./build/scripts/New-AppInstallerFromTemplateAndBundle.ps1 -BundlePath $b.FullName -AppInstallerTemplatePath ./build/config/template.appinstaller -AppInstallerRoot "${{ parameters.storagePublicRootURL }}" -OutputPath _out/Microsoft.WindowsTerminalCanary.appinstaller
displayName: "Produce AppInstaller for MSIX bundle"
- pwsh: |-
$zips = Get-ChildItem -Recurse -Filter *.zip _unpackaged
$zips | ForEach-Object {
$name = $_.Name
$parts = $name.Split('_')
$parts[1] = "latest"
$name = [String]::Join('_', $parts)
$_ | Move-Item -Destination (Join-Path "_out" $name)
}
displayName: "Wrangle Unpackaged builds into place, rename"
- powershell: |-
Get-PackageProvider -Name NuGet -ForceBootstrap
Install-Module -Verbose -AllowClobber -Force Az.Accounts, Az.Storage, Az.Network, Az.Resources, Az.Compute
displayName: Install Azure Module Dependencies
- task: AzureFileCopy@5
displayName: Publish to Storage Account
inputs:
sourcePath: _out/*
Destination: AzureBlob
azureSubscription: ${{ parameters.subscription }}
storage: ${{ parameters.storageAccount }}
ContainerName: ${{ parameters.storageContainer }}
AdditionalArgumentsForBlobCopy: "--content-type application/octet-stream"

View File

@@ -1,6 +1,6 @@
jobs:
- job: CodeNavIndexer
displayName: Run GitHub CodeNav Indexer
displayName: Run Github CodeNav Indexer
pool: { vmImage: windows-2022 }
steps:

View File

@@ -51,8 +51,6 @@ jobs:
BundleStemName: Microsoft.WindowsTerminal
${{ elseif eq(parameters.branding, 'Preview') }}:
BundleStemName: Microsoft.WindowsTerminalPreview
${{ elseif eq(parameters.branding, 'Canary') }}:
BundleStemName: Microsoft.WindowsTerminalCanary
${{ else }}:
BundleStemName: WindowsTerminalDev
JobOutputDirectory: '$(System.ArtifactsDirectory)/bundle'

View File

@@ -56,7 +56,6 @@ jobs:
- task: PowerShell@2
displayName: 'Run PGO Tests'
inputs:
pwsh: true
targetType: filePath
filePath: build\scripts\Run-Tests.ps1
arguments: >-

View File

@@ -44,7 +44,6 @@ jobs:
- task: PowerShell@2
displayName: 'Run Unit Tests'
inputs:
pwsh: true
targetType: filePath
filePath: build\scripts\Run-Tests.ps1
arguments: -MatchPattern '*unit.test*.dll' -Platform '$(OutputBuildPlatform)' -Configuration '$(BuildConfiguration)' -LogPath '${{ parameters.testLogPath }}' -Root "$(Terminal.BinDir)"
@@ -53,7 +52,6 @@ jobs:
- task: PowerShell@2
displayName: 'Run Feature Tests'
inputs:
pwsh: true
targetType: filePath
filePath: build\scripts\Run-Tests.ps1
arguments: -MatchPattern '*feature.test*.dll' -Platform '$(OutputBuildPlatform)' -Configuration '$(BuildConfiguration)' -LogPath '${{ parameters.testLogPath }}' -Root "$(Terminal.BinDir)"
@@ -66,14 +64,6 @@ jobs:
filePath: build\Helix\ConvertWttLogToXUnit.ps1
arguments: -WttInputPath '${{ parameters.testLogPath }}' -WttSingleRerunInputPath 'unused.wtl' -WttMultipleRerunInputPath 'unused2.wtl' -XUnitOutputPath 'onBuildMachineResults.xml' -TestNamePrefix '$(BuildConfiguration).$(BuildPlatform)'
- task: PowerShell@2
displayName: 'Manually log test failures'
condition: always()
inputs:
targetType: filePath
filePath: build\Helix\OutputTestErrorsForAzureDevops.ps1
arguments: -XUnitOutputPath 'onBuildMachineResults.xml'
- task: PublishTestResults@2
displayName: 'Upload converted test logs'
condition: always()

View File

@@ -51,9 +51,6 @@ parameters:
type: boolean
default: false
- name: extraPublishJobs
type: object
default: []
- name: pool
type: object
default:
@@ -173,5 +170,4 @@ stages:
includePublicSymbolServer: ${{ parameters.publishSymbolsToPublic }}
symbolExpiryTime: ${{ parameters.symbolExpiryTime }}
- ${{ parameters.extraPublishJobs }}
...

View File

@@ -46,9 +46,6 @@ parameters:
- name: publishSymbolsToPublic
type: boolean
default: true
- name: symbolExpiryTime
type: string
default: 36530 # This is the default from PublishSymbols@2
- name: publishVpackToWindows
type: boolean
default: false
@@ -78,9 +75,6 @@ extends:
cloudvault: # https://aka.ms/obpipelines/cloudvault
enabled: false
globalSdl: # https://aka.ms/obpipelines/sdl
asyncSdl:
enabled: true
tsaOptionsFile: 'build/config/tsa.json'
tsa:
enabled: true
configFile: '$(Build.SourcesDirectory)\build\config\tsa.json'
@@ -204,15 +198,10 @@ extends:
generateSbom: false # Handled by onebranch
codeSign: ${{ parameters.codeSign }}
afterBuildSteps:
# This directory has to exist, even if we aren't using createvpack, because the Guardian rules demand it.
- pwsh: |-
New-Item "$(JobOutputDirectory)/vpack" -Type Directory
displayName: Make sure the vpack directory exists
- ${{ if parameters.publishVpackToWindows }}:
- pwsh: |-
Copy-Item -Verbose -Path "$(MsixBundlePath)" -Destination (Join-Path "$(JobOutputDirectory)/vpack" 'Microsoft.WindowsTerminal_8wekyb3d8bbwe.msixbundle')
displayName: Stage msixbundle for vpack
$d = New-Item "$(JobOutputDirectory)/vpack" -Type Directory
Copy-Item -Verbose -Path "$(MsixBundlePath)" -Destination (Join-Path $d 'Microsoft.WindowsTerminal_8wekyb3d8bbwe.msixbundle')
displayName: Stage msixbundle for vpack
- ${{ if eq(parameters.buildConPTY, true) }}:
- template: ./build/pipelines/templates-v2/job-package-conpty.yml@self
@@ -246,14 +235,13 @@ extends:
- stage: Publish
displayName: Publish
dependsOn: [Build]
dependsOn: [Build, Package]
jobs:
- template: ./build/pipelines/templates-v2/job-publish-symbols.yml@self
parameters:
pool: { type: windows }
includePublicSymbolServer: ${{ parameters.publishSymbolsToPublic }}
symbolPatGoesInTaskInputs: true # onebranch tries to muck with the PAT variable, so we need to change how it get the PAT
symbolExpiryTime: ${{ parameters.symbolExpiryTime }}
variables:
ob_git_checkout: false # This job checks itself out
ob_git_skip_checkout_none: true

View File

@@ -1,2 +1,2 @@
variables:
WindowsContainerImage: 'onebranch.azurecr.io/windows/ltsc2022/vse2022:1.0.02566.28'
WindowsContainerImage: 'onebranch.azurecr.io/windows/ltsc2022/vse2022:latest'

View File

@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<_WTBrandingPreprocessorToken Condition="'$(WindowsTerminalBranding)'=='Canary'">WT_BRANDING_CANARY</_WTBrandingPreprocessorToken>
<_WTBrandingPreprocessorToken Condition="'$(WindowsTerminalBranding)'=='Preview'">WT_BRANDING_PREVIEW</_WTBrandingPreprocessorToken>
<_WTBrandingPreprocessorToken Condition="'$(WindowsTerminalBranding)'=='Release'">WT_BRANDING_RELEASE</_WTBrandingPreprocessorToken>
<_WTBrandingPreprocessorToken Condition="'$(_WTBrandingPreprocessorToken)'==''">WT_BRANDING_DEV</_WTBrandingPreprocessorToken>

View File

@@ -30,7 +30,6 @@
<IntermediateOutputPath>$(SolutionDir)obj\$(Configuration)\GenerateFeatureFlags\</IntermediateOutputPath>
<OpenConsoleCommonOutDir>$(SolutionDir)bin\$(Configuration)\</OpenConsoleCommonOutDir>
<_WTBrandingName Condition="'$(WindowsTerminalBranding)'=='Canary'">Canary</_WTBrandingName>
<_WTBrandingName Condition="'$(WindowsTerminalBranding)'=='Preview'">Preview</_WTBrandingName>
<_WTBrandingName Condition="'$(WindowsTerminalBranding)'=='Release'">Release</_WTBrandingName>
<_WTBrandingName Condition="'$(_WTBrandingName)'==''">Dev</_WTBrandingName>

View File

@@ -30,7 +30,7 @@
DependsOnTargets="_ConsoleMapWinmdsToManifestFiles">
<!-- This target is batched and a new Exec is spawned for each entry in _ConsoleWinmdManifest. -->
<Exec Command="mt.exe -winmd:&quot;%(_ConsoleWinmdManifest.WinMDPath)&quot; -dll:%(_ConsoleWinmdManifest.Implementation) -out:&quot;%(_ConsoleWinmdManifest.Identity)&quot;" />
<Exec Command="mt.exe -winmd:%(_ConsoleWinmdManifest.WinMDPath) -dll:%(_ConsoleWinmdManifest.Implementation) -out:%(_ConsoleWinmdManifest.Identity)" />
<ItemGroup>
<!-- Emit the generated manifest into the Link inputs. -->

View File

@@ -1,16 +0,0 @@
Get-ChildItem -Recurse -Filter *.resw
| Where-Object { $_.Directory.Name.StartsWith("qps-ploc") }
| ForEach-Object {
$source = Join-Path $_.Directory "../en-US/$($_.Name)"
$target = $_
$ploc = ./tools/ConvertTo-PseudoLocalization.ps1 -Path $source
$writerSettings = [System.Xml.XmlWriterSettings]::new()
$writerSettings.NewLineChars = "`r`n"
$writerSettings.Indent = $true
$writer = [System.Xml.XmlWriter]::Create($target, $writerSettings)
$ploc.Save($writer)
$writer.Flush()
$writer.Close()
}

View File

@@ -10,7 +10,7 @@ function Invoke-CheckBadCodeFormatting() {
# returns a non-zero exit code if there are any diffs in the tracked files in the repo
git diff-index --quiet HEAD --
if ($LASTEXITCODE -eq 1) {
if ($lastExitCode -eq 1) {
# Write the list of files that need updating to the log
git diff-index --name-only HEAD

View File

@@ -1,42 +0,0 @@
[CmdletBinding()]
Param(
[Parameter(Mandatory,
HelpMessage="Path to the .msixbundle")]
[string]
$BundlePath,
[Parameter(Mandatory,
HelpMessage="Path to the .appinstaller template")]
[string]
$AppInstallerTemplatePath,
[string]
$AppInstallerRoot,
[Parameter(Mandatory,
HelpMessage="Output Path")]
[string]
$OutputPath
)
$ErrorActionPreference = "Stop"
$sentinelFile = New-TemporaryFile
$directory = New-Item -Type Directory "$($sentinelFile.FullName)_Package"
Remove-Item $sentinelFile -Force -EA:Ignore
$bundle = (Get-Item $BundlePath)
& tar.exe -x -f $bundle.FullName -C $directory AppxMetadata/AppxBundleManifest.xml
$xml = [xml](Get-Content (Join-Path $directory "AppxMetadata\AppxBundleManifest.xml"))
$name = $xml.Bundle.Identity.Name
$version = $xml.Bundle.Identity.Version
$doc = (Get-Content -ReadCount 0 $AppInstallerTemplatePath)
$doc = $doc -Replace '\$\$ROOT\$\$',$AppInstallerRoot
$doc = $doc -Replace '\$\$NAME\$\$',$name
$doc = $doc -Replace '\$\$VERSION\$\$',$version
$doc = $doc -Replace '\$\$PACKAGE\$\$',$bundle.Name
$doc | Out-File -Encoding utf8NoBOM $OutputPath
Get-Item $OutputPath

View File

@@ -25,12 +25,7 @@ Param(
[Parameter(HelpMessage="Path to makeappx.exe", ParameterSetName='Layout')]
[ValidateScript({Test-Path $_ -Type Leaf})]
[string]
$MakeAppxPath = "C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x64\MakeAppx.exe",
[Parameter(HelpMessage="Include the portable mode marker file by default", ParameterSetName='AppX')]
[Parameter(HelpMessage="Include the portable mode marker file by default", ParameterSetName='Layout')]
[switch]
$PortableMode = $PSCmdlet.ParameterSetName -eq 'Layout'
$MakeAppxPath = "C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x64\MakeAppx.exe"
)
$filesToRemove = @("*.xml", "*.winmd", "Appx*", "Images/*Tile*", "Images/*Logo*") # Remove from Terminal
@@ -133,11 +128,6 @@ $finalTerminalPriFile = Join-Path $terminalAppPath "resources.pri"
# Packaging
########
$portableModeMarkerFile = Join-Path $terminalAppPath ".portable"
If ($PortableMode) {
"" | Out-File $portableModeMarkerFile
}
If ($PSCmdlet.ParameterSetName -Eq "AppX") {
# We only produce a ZIP when we're combining two AppX directories.
New-Item -ItemType Directory -Path $Destination -ErrorAction:SilentlyContinue | Out-Null

View File

@@ -16,48 +16,22 @@ Param(
# Find test DLLs based on the provided root, match pattern, and recursion
$testDlls = Get-ChildItem -Path $Root -Recurse -Filter $MatchPattern
$teArgs = @()
$args = @()
# Check if the LogPath parameter is provided and enable WTT logging
if ($LogPath) {
$teArgs += '/enablewttlogging'
$teArgs += '/appendwttlogging'
$teArgs += "/logFile:$LogPath"
$args += '/enablewttlogging'
$args += '/appendwttlogging'
$args += "/logFile:$LogPath"
Write-Host "WTT Logging Enabled"
}
$rootTe = "$Root\te.exe"
# Invoke the te.exe executable with arguments and test DLLs
& "$Root\te.exe" $args $testDlls.FullName $AdditionalTaefArguments
# Some of our test fixtures depend on resources.pri in the same folder as the .exe hosting them.
# Unfortunately, that means that we need to run the te.exe *next to* each test DLL we discover.
# This code establishes a mapping from te.exe to test DLL (or DLLs)
$testDllTaefGroups = $testDlls | % {
$localTe = Get-Item (Join-Path (Split-Path $_ -Parent) "te.exe") -EA:Ignore
If ($null -eq $localTe) {
$finalTePath = $rootTe
} Else {
$finalTePath = $localTe.FullName
}
[PSCustomObject]@{
TePath = $finalTePath;
TestDll = $_;
}
}
# Invoke the te.exe executables with arguments and test DLLs
$anyFailed = $false
$testDllTaefGroups | Group-Object TePath | % {
$te = $_.Group[0].TePath
$dlls = $_.Group.TestDll
Write-Verbose "Running $te (for $($dlls.Name))"
& $te $teArgs $dlls.FullName $AdditionalTaefArguments
if ($LASTEXITCODE -ne 0) {
$anyFailed = $true
}
}
if ($anyFailed) {
Exit 1
# Check the exit code of the te.exe process and exit accordingly
if ($LASTEXITCODE -ne 0) {
Exit $LASTEXITCODE
}
Exit 0

View File

@@ -3,9 +3,9 @@
<!-- This file is read by XES, which we use in our Release builds. -->
<PropertyGroup Label="Version">
<XesUseOneStoreVersioning>true</XesUseOneStoreVersioning>
<XesBaseYearForStoreVersion>2024</XesBaseYearForStoreVersion>
<XesBaseYearForStoreVersion>2023</XesBaseYearForStoreVersion>
<VersionMajor>1</VersionMajor>
<VersionMinor>21</VersionMinor>
<VersionMinor>18</VersionMinor>
<VersionInfoProductName>Windows Terminal</VersionInfoProductName>
</PropertyGroup>
</Project>

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,4 @@
# CLI11
Taken from [release v2.4.1](https://github.com/CLIUtils/CLI11/releases/tag/v2.4.1), source commit
[f4d0731](https://github.com/CLIUtils/CLI11/commit/f4d0731cebb123ff0ace712c099dffbcd2c58e5a)
Taken from [release v1.9.1](https://github.com/CLIUtils/CLI11/releases/tag/v1.9.1), source commit
[5cb3efa](https://github.com/CLIUtils/CLI11/commit/5cb3efabce007c3a0230e4cc2e27da491c646b6c)

View File

@@ -6,7 +6,7 @@
"type": "git",
"git": {
"repositoryUrl": "https://github.com/CLIUtils/CLI11",
"commitHash": "88e9bb17418ee730817d5942894d99a4bdd78fb3"
"commitHash": "5cb3efabce007c3a0230e4cc2e27da491c646b6c"
}
}
}

View File

@@ -9,7 +9,7 @@
<package id="Microsoft.VisualStudio.Setup.Configuration.Native" version="2.3.2262" targetFramework="native" developmentDependency="true" />
<package id="Microsoft.UI.Xaml" version="2.8.4" targetFramework="native" />
<package id="Microsoft.Web.WebView2" version="1.0.1661.34" targetFramework="native" />
<package id="Microsoft.Windows.ImplementationLibrary" version="1.0.240122.1" targetFramework="native" developmentDependency="true" />
<package id="Microsoft.Windows.ImplementationLibrary" version="1.0.220201.1" targetFramework="native" developmentDependency="true" />
<!-- Managed packages -->
<package id="Appium.WebDriver" version="3.0.0.2" targetFramework="net45" />

View File

@@ -5,10 +5,10 @@
`.../console/published/wincon.w` in the OS repo when you submit the PR.
The branch won't build without it.
* For now, you can update winconp.h with your consumable changes.
* Define registry name (ex: `CONSOLE_REGISTRY_CURSORCOLOR`)
* Add the setting to `CONSOLE_STATE_INFO`.
* Define registry name (ex `CONSOLE_REGISTRY_CURSORCOLOR`)
* Add the setting to `CONSOLE_STATE_INFO`
* Define the property key ID and the property key itself.
- Yes, the large majority of the `DEFINE_PROPERTYKEY` defs are the same, it's only the last byte of the guid that changes.
- Yes, the large majority of the `DEFINE_PROPERTYKEY` defs are the same, it's only the last byte of the guid that changes
2. Add matching fields to Settings.hpp
- Add getters, setters, the whole drill.
@@ -17,9 +17,9 @@
- We need to add it to *reading and writing* the registry from the propsheet, and *reading* the link from the propsheet. Yes, that's weird, but the propsheet is smart enough to re-use ShortcutSerialization::s_SetLinkValues, but not smart enough to do the same with RegistrySerialization.
- `src/propsheet/registry.cpp`
- `propsheet/registry.cpp@InitRegistryValues` should initialize the default value for the property.
- `propsheet/registry.cpp@GetRegistryValues` should make sure to read the property from the registry.
- `propsheet/registry.cpp@GetRegistryValues` should make sure to read the property from the registry
4. Add the field to the propslib registry map.
4. Add the field to the propslib registry map
5. Add the value to `ShortcutSerialization.cpp`
- Read the value in `ShortcutSerialization::s_PopulateV2Properties`
@@ -30,11 +30,11 @@ Now, your new setting should be stored just like all the other properties.
7. Update the feature test properties to get add the setting as well
- `ft_uia/Common/NativeMethods.cs@WinConP`:
- `Wtypes.PROPERTYKEY PKEY_Console_`.
- `NT_CONSOLE_PROPS`.
- `Wtypes.PROPERTYKEY PKEY_Console_`
- `NT_CONSOLE_PROPS`
8. Add the default value for the setting to `win32k-settings.man`
- If the setting shouldn't default to 0 or `nullptr`, then you'll need to set the default value of the setting in `win32k-settings.man`.
9. Update `Settings::InitFromStateInfo` and `Settings::CreateConsoleStateInfo` to get/set the value in a CONSOLE_STATE_INFO appropriately.
9. Update `Settings::InitFromStateInfo` and `Settings::CreateConsoleStateInfo` to get/set the value in a CONSOLE_STATE_INFO appropriately

View File

@@ -1,96 +0,0 @@
# COOKED_READ_DATA, aka conhost's readline implementation
## Test instructions
All of the following ✅ marks must be fulfilled during manual testing:
* ASCII input
* Chinese input (中文維基百科) ❔
* Resizing the window properly wraps/unwraps wide glyphs ❌
Broken due to `TextBuffer::Reflow` bugs
* Surrogate pair input (🙂) ❔
* Resizing the window properly wraps/unwraps surrogate pairs ❌
Broken due to `TextBuffer::Reflow` bugs
* In cmd.exe
* Create 2 file: "a😊b.txt" and "a😟b.txt"
* Press tab: Autocomplete to "a😊b.txt" ✅
* Navigate the cursor right past the "a"
* Press tab twice: Autocomplete to "a😟b.txt" ✅
* Execute `printf(" "); gets(buffer);` in C (or equivalent)
* Press Tab, A, Ctrl+V, Tab, A ✅
* The prompt is " A^V A" ✅
* Cursor navigation works ✅
* Backspacing/Deleting random parts of it works ✅
* It never deletes the initial 4 spaces ✅
* Backspace deletes preceding glyphs ✅
* Ctrl+Backspace deletes preceding words ✅
* Escape clears input ✅
* Home navigates to start ✅
* Ctrl+Home deletes text between cursor and start ✅
* End navigates to end ✅
* Ctrl+End deletes text between cursor and end ✅
* Left navigates over previous code points ✅
* Ctrl+Left navigates to previous word-starts ✅
* Right and F1 navigate over next code points ✅
* Pressing right at the end of input copies characters
from the previous command ✅
* Ctrl+Right navigates to next word-ends ✅
* Insert toggles overwrite mode ✅
* Delete deletes next code point ✅
* Up and F5 cycle through history ✅
* Doesn't crash with no history ✅
* Stops at first entry ✅
* Down cycles through history ✅
* Doesn't crash with no history ✅
* Stops at last entry ✅
* PageUp retrieves the oldest command ✅
* PageDown retrieves the newest command ✅
* F2 starts "copy to char" prompt ✅
* Escape dismisses prompt ✅
* Typing a character copies text from the previous command up
until that character into the current buffer (acts identical
to F3, but with automatic character search) ✅
* F3 copies the previous command into the current buffer,
starting at the current cursor position,
for as many characters as possible ✅
* Doesn't erase trailing text if the current buffer
is longer than the previous command ✅
* Puts the cursor at the end of the copied text ✅
* F4 starts "copy from char" prompt ✅
* Escape dismisses prompt ✅
* Erases text between the current cursor position and the
first instance of a given char (but not including it) ✅
* F6 inserts Ctrl+Z ✅
* F7 without modifiers starts "command list" prompt ✅
* Escape dismisses prompt ✅
* Minimum size of 40x10 characters ✅
* Width expands to fit the widest history command ✅
* Height expands up to 20 rows with longer histories ✅
* F9 starts "command number" prompt ✅
* Left/Right paste replace the buffer with the given command ✅
* And put cursor at the end of the buffer ✅
* Up/Down navigate selection through history ✅
* Stops at start/end with <10 entries ✅
* Stops at start/end with >20 entries ✅
* Wide text rendering during pagination with >20 entries ✅
* Shift+Up/Down moves history items around ✅
* Home navigates to first entry ✅
* End navigates to last entry ✅
* PageUp navigates by 20 items at a time or to first ✅
* PageDown navigates by 20 items at a time or to last ✅
* Alt+F7 clears command history ✅
* F8 cycles through commands that start with the same text as
the current buffer up until the current cursor position ✅
* Doesn't crash with no history ✅
* F9 starts "command number" prompt ✅
* Escape dismisses prompt ✅
* Ignores non-ASCII-decimal characters ✅
* Allows entering between 1 and 5 digits ✅
* Pressing Enter fetches the given command from the history ✅
* Alt+F10 clears doskey aliases ✅
* In cmd.exe, with an empty prompt in an empty directory:
Pressing tab produces an audible bing and prints no text ✅
* When Narrator is enabled, in cmd.exe:
* Typing individual characters announces only
exactly each character that is being typed ✅
* Backspacing at the end of a prompt announces
only exactly each deleted character ✅

View File

@@ -27,8 +27,6 @@ I would highly recommend that Gulp convert to using PowerShell scripts and that
Original Source: https://github.com/microsoft/terminal/issues/217#issuecomment-404240443
_Addendum_: cmd.exe is the literal embodiment of [xkcd#1172]([url](https://xkcd.com/1172/)). Every change, no matter how small, will break _someone_.
## <a name="screenPerf"></a>Why is typing-to-screen performance better than every other app?
I really do not mind when someone comes by and decides to tell us that we're doing a good job at something. We hear so many complaints every day that a post like this is a breath of fresh air. Thanks for your thanks!
@@ -51,7 +49,7 @@ Will this UI enhancement come to other apps on Windows? Almost certainly not. Th
Will we try to keep it from regressing? Yes! Right now it's sort of a manual process. We identify that something is getting slow and then we go haul out [WPR](https://docs.microsoft.com/en-us/windows-hardware/test/wpt/windows-performance-recorder) and start taking traces. We stare down the hot paths and try to reason out what is going on and then improve them. For instance, in the last cycle or two, we focused on heap allocations as a major area where we could improve our end-to-end performance, changing a ton of our code to use stack-constructed iterator-like facades over the underlying request buffer instead of translating and allocating it into a new heap space for each level of processing.
As an aside, @bitcrazed wants us to automate performance tests in some conhost specific way, but I haven't quite figured out a controlled environment to do this in yet. The Windows Engineering System runs performance tests each night that give us a coarse-grained way of knowing if we messed something up for the whole operating system, and they technically offer a fine-grained way for us to insert our own performance tests... but I just haven't got around to that yet. If you have an idea for a way for us to do this in an automated fashion, I'm all ears.
As an aside, @bitcrazed wants us to automate performance tests in some conhost specific way, but I haven't quite figured out a controlled environment to do this in yet. The Windows Engineering System runs performance tests each night that give us a coarse grained way of knowing if we messed something up for the whole operating system, and they technically offer a fine grained way for us to insert our own performance tests... but I just haven't got around to that yet. If you have an idea for a way for us to do this in an automated fashion, I'm all ears.
If there's anything else you'd like to know, let me know. I could go on all day. I deleted like 15 tangents from this reply before posting it....

View File

@@ -32,6 +32,7 @@
* `/src/cascadia/TerminalApp` - This DLL represents the implementation of the Windows Terminal application. This includes parsing settings, hosting tabs & panes with Terminals in them, and displaying other UI elements. This DLL is almost entirely UWP-like code, and shouldn't be doing any Win32-like UI work.
* `/src/cascadia/WindowsTerminal` - This EXE provides Win32 hosting for the TerminalApp. It will set up XAML islands, and is responsible for drawing the window, either as a standard window or with content in the titlebar (non-client area).
* `/src/cascadia/CascadiaPackage` - This is a project for packaging the Windows Terminal and its dependencies into an .appx/.msix for deploying to the machine.
* `/src/cascadia/PublicTerminalCore` - This is a DLL wrapper for the TerminalCore and Renderer, similar to `TermControl`, which exposes some exported functions that so the Terminal can be used from C#.
* `/src/cascadia/WpfTerminalControl` - A DLL implementing a WPF version of the Terminal Control.
* `/src/host` The meat of the windows console host. This includes buffer, input, output, windowing, server management, clipboard, and most interactions with the console host window that arent stated anywhere else. Were trying to pull things out that are reusable into other libraries, but its a work in progress
* `/src/host/lib` Builds the reusable LIB copy of the host
@@ -125,6 +126,8 @@
* Private calls into the Windows Window Manager to perform privileged actions related to the console process (working to eliminate) or for High DPI stuff (also working to eliminate)
* `Userprivapi.cpp`
* `Windowdpiapi.cpp`
* New UTF8 state machine in progress to improve Bash (and other apps) support for UTF-8 in console
* `Utf8ToWideCharParser.cpp`
* Window resizing/layout/management/window messaging loops and all that other stuff that has us interact with Windows to create a visual display surface and control the user interaction entry point
* `Window.cpp`
* `Windowproc.cpp`

View File

@@ -154,47 +154,3 @@ popd
The `bx` will build just the Terminal package, critically, populating the `CascadiaPackage.build.appxrecipe` file. Once that's been built, then the `DeployAppRecipe.exe` command can be used to deploy a loose layout in the same way that Visual Studio does.
Notably, this method of building the Terminal package can't leverage the FastUpToDate check in Visual Studio, so the builds end up being considerably slower for the whole package, as cppwinrt does a lot of work before confirming that it's up to date and doing nothing.
### Are you seeing `DEP0700: Registration of the app failed`?
Once in a blue moon, I get a `DEP0700: Registration of the app failed.
[0x80073CF6] error 0x80070020: Windows cannot register the package because of an
internal error or low memory.` when trying to deploy in VS. For us, that can
happen if the `OpenConsoleProxy.dll` gets locked up, in use by some other
terminal package.
Doing the equivalent command in powershell can give us more info:
```pwsh
Add-AppxPackage -register "Z:\dev\public\OpenConsole\src\cascadia\CascadiaPackage\bin\x64\Debug\AppX\AppxManifest.xml"
```
That'll suggest `NOTE: For additional information, look for [ActivityId]
dbf551f1-83d0-0007-43e7-9cded083da01 in the Event Log or use the command line
Get-AppPackageLog -ActivityID dbf551f1-83d0-0007-43e7-9cded083da01`. So do that:
```pwsh
Get-AppPackageLog -ActivityID dbf551f1-83d0-0007-43e7-9cded083da01
```
which will give you a lot of info. In my case, that revealed that the platform
couldn't delete the packaged com entries. The key line was: `AppX Deployment
operation failed with error 0x0 from API Logging data because access was denied
for file:
C:\ProgramData\Microsoft\Windows\AppRepository\Packages\WindowsTerminalDev_0.0.1.0_x64__8wekyb3d8bbwe,
user SID: S-1-5-18`
Take that path, and
```pwsh
sudo start C:\ProgramData\Microsoft\Windows\AppRepository\Packages\WindowsTerminalDev_0.0.1.0_x64__8wekyb3d8bbwe
```
(use `sudo`, since the path is otherwise locked down). From there, go into the
`PackagedCom` folder, and open [File
Locksmith](https://learn.microsoft.com/en-us/windows/powertoys/file-locksmith)
(or Process Explorer, if you're more familiar with that) on
`OpenConsoleProxy.dll`. Just go ahead and immediately re-launch it as admin,
too. That should list off a couple terminal processes that are just hanging
around. Go ahead and end them all. You should be good to deploy again after
that.

View File

@@ -85,41 +85,6 @@
}
]
},
"BuiltinSuggestionSource": {
"type": "string",
"anyOf": [
{
"type": "string"
},
{
"enum": [
"commandHistory",
"tasks",
"all"
]
}
]
},
"SuggestionSource": {
"default": "all",
"description": "Either a single suggestion source, or an array of sources to concatenate. Built-in sources include `commandHistory`, `directoryHistory`, and `tasks`. The special value `all` indicates all suggestion sources should be included",
"$comment": "`tasks` and `local` are sources that would be added by the Tasks feature, as a follow-up",
"oneOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/BuiltinSuggestionSource"
},
{
"type": "array",
"items": {
"$ref": "#/$defs/BuiltinSuggestionSource"
},
"uniqueItems": true
}
]
},
"AppearanceConfig": {
"properties": {
"colorScheme": {
@@ -210,6 +175,10 @@
"desktopWallpaper"
]
}
],
"type": [
"string",
"null"
]
},
"backgroundImageOpacity": {
@@ -274,17 +243,6 @@
"experimental.pixelShaderPath": {
"description": "Use to set a path to a pixel shader to use with the Terminal when unfocused. Overrides `experimental.retroTerminalEffect`. This is an experimental feature, and its continued existence is not guaranteed.",
"type": "string"
},
"useAcrylic": {
"description": "When set to true, the window will have an acrylic material background when unfocused. When set to false, the window will have a plain, untextured background when unfocused.",
"type": "boolean"
},
"opacity": {
"default": 100,
"description": "Sets the opacity of the window for the profile when unfocused. Accepts values from 0-100.",
"maximum": 100,
"minimum": 0,
"type": "number"
}
},
"type": "object"
@@ -390,12 +348,8 @@
},
"ShortcutActionName": {
"enum": [
"addMark",
"adjustFontSize",
"adjustOpacity",
"clearAllMarks",
"clearBuffer",
"clearMark",
"closeOtherPanes",
"closeOtherTabs",
"closePane",
@@ -406,7 +360,6 @@
"copy",
"duplicateTab",
"expandSelectionToWord",
"experimental.colorSelection",
"exportBuffer",
"find",
"findMatch",
@@ -414,60 +367,62 @@
"globalSummon",
"identifyWindow",
"identifyWindows",
"markMode",
"moveFocus",
"movePane",
"swapPane",
"markMode",
"moveTab",
"multipleActions",
"newTab",
"newWindow",
"nextTab",
"openAbout",
"openNewTabDropdown",
"openSettings",
"openSystemMenu",
"openTabColorPicker",
"openTabRenamer",
"openWindowRenamer",
"paste",
"prevTab",
"quakeMode",
"quit",
"renameTab",
"renameWindow",
"openSystemMenu",
"openTabRenamer",
"quakeMode",
"resetFontSize",
"resizePane",
"restoreLastClosed",
"renameWindow",
"scrollDown",
"scrollDownPage",
"scrollToBottom",
"scrollToMark",
"scrollToTop",
"scrollUp",
"scrollUpPage",
"searchWeb",
"selectAll",
"scrollToBottom",
"scrollToTop",
"sendInput",
"setColorScheme",
"setFocusMode",
"setFullScreen",
"setMaximized",
"setTabColor",
"showSuggestions",
"splitPane",
"swapPane",
"switchSelectionEndpoint",
"switchToTab",
"tabSearch",
"toggleAlwaysOnTop",
"toggleBlockSelection",
"toggleFocusMode",
"selectAll",
"setFocusMode",
"switchSelectionEndpoint",
"toggleFullscreen",
"setFullScreen",
"setMaximized",
"togglePaneZoom",
"toggleSplitOrientation",
"toggleReadOnlyMode",
"toggleShaderEffects",
"toggleSplitOrientation",
"wt",
"quit",
"adjustOpacity",
"restoreLastClosed",
"addMark",
"scrollToMark",
"clearMark",
"clearAllMarks",
"experimental.colorSelection",
"unbound"
],
"type": "string"
@@ -657,7 +612,6 @@
"$ref": "#/$defs/NewTabMenuEntry"
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
@@ -700,7 +654,6 @@
"$ref": "#/$defs/NewTabMenuEntry"
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
@@ -717,7 +670,6 @@
"$ref": "#/$defs/NewTabMenuEntry"
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
@@ -739,7 +691,6 @@
"$ref": "#/$defs/NewTabMenuEntry"
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
@@ -756,7 +707,6 @@
"$ref": "#/$defs/NewTabMenuEntry"
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
@@ -797,7 +747,6 @@
]
},
"ShortcutAction": {
"type": "object",
"properties": {
"action": {
"description": "The action to execute",
@@ -806,7 +755,8 @@
},
"required": [
"action"
]
],
"type": "object"
},
"AdjustFontSizeAction": {
"description": "Arguments corresponding to an Adjust Font Size Action",
@@ -815,7 +765,6 @@
"$ref": "#/$defs/ShortcutAction"
},
{
"type": "object",
"properties": {
"action": {
"type": "string",
@@ -840,7 +789,6 @@
"$ref": "#/$defs/ShortcutAction"
},
{
"type": "object",
"properties": {
"action": {
"type": "string",
@@ -851,11 +799,6 @@
"default": false,
"description": "If true, the copied content will be copied as a single line (even if there are hard line breaks present in the text). If false, newlines persist from the selected text."
},
"dismissSelection": {
"type": "boolean",
"default": true,
"description": "If false, the copied content will be copied and the selection will not be dismissed. If true, the selection will be dismissed."
},
"copyFormatting": {
"default": null,
"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. Not setting this value inherits the behavior of the `copyFormatting` global setting.",
@@ -882,7 +825,6 @@
"$ref": "#/$defs/NewTerminalArgs"
},
{
"type": "object",
"properties": {
"action": {
"type": "string",
@@ -899,7 +841,6 @@
"$ref": "#/$defs/ShortcutAction"
},
{
"type": "object",
"properties": {
"action": {
"type": "string",
@@ -924,7 +865,6 @@
"$ref": "#/$defs/ShortcutAction"
},
{
"type": "object",
"properties": {
"action": {
"type": "string",
@@ -949,7 +889,6 @@
"$ref": "#/$defs/ShortcutAction"
},
{
"type": "object",
"properties": {
"action": {
"type": "string",
@@ -974,7 +913,6 @@
"$ref": "#/$defs/ShortcutAction"
},
{
"type": "object",
"properties": {
"action": {
"type": "string",
@@ -999,7 +937,6 @@
"$ref": "#/$defs/ShortcutAction"
},
{
"type": "object",
"properties": {
"action": {
"type": "string",
@@ -1024,7 +961,6 @@
"$ref": "#/$defs/ShortcutAction"
},
{
"type": "object",
"properties": {
"action": {
"type": "string",
@@ -1049,7 +985,6 @@
"$ref": "#/$defs/ShortcutAction"
},
{
"type": "object",
"properties": {
"action": {
"type": "string",
@@ -1077,7 +1012,6 @@
"$ref": "#/$defs/NewTerminalArgs"
},
{
"type": "object",
"properties": {
"action": {
"type": "string",
@@ -1110,7 +1044,6 @@
"$ref": "#/$defs/ShortcutAction"
},
{
"type": "object",
"properties": {
"action": {
"type": "string",
@@ -1148,7 +1081,6 @@
"$ref": "#/$defs/ShortcutAction"
},
{
"type": "object",
"properties": {
"action": {
"type": "string",
@@ -1176,7 +1108,6 @@
"$ref": "#/$defs/ShortcutAction"
},
{
"type": "object",
"properties": {
"action": {
"type": "string",
@@ -1198,7 +1129,6 @@
"$ref": "#/$defs/ShortcutAction"
},
{
"type": "object",
"properties": {
"action": {
"type": "string",
@@ -1220,7 +1150,6 @@
"$ref": "#/$defs/ShortcutAction"
},
{
"type": "object",
"properties": {
"action": {
"type": "string",
@@ -1245,7 +1174,6 @@
"$ref": "#/$defs/ShortcutAction"
},
{
"type": "object",
"properties": {
"action": {
"type": "string",
@@ -1266,7 +1194,6 @@
"$ref": "#/$defs/ShortcutAction"
},
{
"type": "object",
"properties": {
"action": {
"type": "string",
@@ -1287,7 +1214,6 @@
"$ref": "#/$defs/ShortcutAction"
},
{
"type": "object",
"properties": {
"action": {
"type": "string",
@@ -1308,7 +1234,6 @@
"$ref": "#/$defs/ShortcutAction"
},
{
"type": "object",
"properties": {
"action": {
"type": "string",
@@ -1333,7 +1258,6 @@
"$ref": "#/$defs/ShortcutAction"
},
{
"type": "object",
"properties": {
"action": {
"type": "string",
@@ -1362,7 +1286,6 @@
"$ref": "#/$defs/ShortcutAction"
},
{
"type": "object",
"properties": {
"action": {
"type": "string",
@@ -1391,7 +1314,6 @@
"$ref": "#/$defs/ShortcutAction"
},
{
"type": "object",
"properties": {
"action": {
"type": "string",
@@ -1420,7 +1342,6 @@
"$ref": "#/$defs/ShortcutAction"
},
{
"type": "object",
"properties": {
"action": {
"type": "string",
@@ -1445,7 +1366,6 @@
"$ref": "#/$defs/ShortcutAction"
},
{
"type": "object",
"properties": {
"action": {
"type": "string",
@@ -1470,7 +1390,6 @@
"$ref": "#/$defs/ShortcutAction"
},
{
"type": "object",
"properties": {
"action": {
"type": "string",
@@ -1494,7 +1413,6 @@
"$ref": "#/$defs/ShortcutAction"
},
{
"type": "object",
"properties": {
"action": {
"type": "string",
@@ -1520,7 +1438,6 @@
"$ref": "#/$defs/ShortcutAction"
},
{
"type": "object",
"properties": {
"action": {
"type": "string",
@@ -1542,7 +1459,6 @@
"$ref": "#/$defs/ShortcutAction"
},
{
"type": "object",
"properties": {
"action": {
"type": "string",
@@ -1570,7 +1486,6 @@
"$ref": "#/$defs/NewTerminalArgs"
},
{
"type": "object",
"properties": {
"action": {
"type": "string",
@@ -1587,7 +1502,6 @@
"$ref": "#/$defs/ShortcutAction"
},
{
"type": "object",
"properties": {
"action": {
"type": "string",
@@ -1609,7 +1523,6 @@
"$ref": "#/$defs/ShortcutAction"
},
{
"type": "object",
"properties": {
"action": {
"type": "string",
@@ -1631,7 +1544,6 @@
"$ref": "#/$defs/ShortcutAction"
},
{
"type": "object",
"properties": {
"action": {
"type": "string",
@@ -1653,7 +1565,6 @@
"$ref": "#/$defs/ShortcutAction"
},
{
"type": "object",
"properties": {
"action": {
"type": "string",
@@ -1675,7 +1586,6 @@
"$ref": "#/$defs/ShortcutAction"
},
{
"type": "object",
"properties": {
"action": {
"type": "string",
@@ -1698,7 +1608,6 @@
"$ref": "#/$defs/ShortcutAction"
},
{
"type": "object",
"properties": {
"action": {
"type": "string",
@@ -1720,7 +1629,6 @@
"$ref": "#/$defs/ShortcutAction"
},
{
"type": "object",
"properties": {
"action": {
"type": "string",
@@ -1742,7 +1650,6 @@
"$ref": "#/$defs/ShortcutAction"
},
{
"type": "object",
"properties": {
"action": {
"type": "string",
@@ -1794,7 +1701,6 @@
"$ref": "#/$defs/ShortcutAction"
},
{
"type": "object",
"properties": {
"action": {
"type": "string",
@@ -1804,30 +1710,6 @@
}
]
},
"SearchWebAction": {
"description": "Search the web for selected text",
"allOf": [
{
"$ref": "#/$defs/ShortcutAction"
},
{
"type": "object",
"properties": {
"action": {
"type": "string",
"const": "searchWeb"
},
"queryUrl": {
"type": "string",
"description": "URL of the web page to launch, %s is replaced with the selected text"
}
}
}
],
"required": [
"queryUrl"
]
},
"AdjustOpacityAction": {
"description": "Changes the opacity of the active Terminal window. If `relative` is specified, then this action will increase/decrease relative to the current opacity.",
"allOf": [
@@ -1835,7 +1717,6 @@
"$ref": "#/$defs/ShortcutAction"
},
{
"type": "object",
"properties": {
"action": {
"type": "string",
@@ -1857,31 +1738,6 @@
}
]
},
"ShowSuggestionsAction": {
"description": "Arguments corresponding to a Open Suggestions Action",
"allOf": [
{
"$ref": "#/$defs/ShortcutAction"
},
{
"type": "object",
"properties": {
"action": {
"type": "string",
"const": "showSuggestions"
},
"source": {
"$ref": "#/$defs/SuggestionSource",
"description": "Which suggestion sources to filter."
},
"useCommandline": {
"default": false,
"description": "When set to `true`, the current commandline the user has typed will pre-populate the filter of the Suggestions UI. This requires that the user has enabled shell integration in their shell's config. When set to false, the filter will start empty."
}
}
}
]
},
"ShowCloseButton": {
"enum": [
"always",
@@ -1951,30 +1807,13 @@
"properties": {
"applicationTheme": {
"description": "Which UI theme the Terminal should use for controls",
"enum": [
"light",
"dark",
"system"
],
"enum": [ "light", "dark", "system" ],
"type": "string"
},
"useMica": {
"description": "True if the Terminal should use a Mica backdrop for the window. This will apply underneath all controls (including the terminal panes and the titlebar)",
"type": "boolean",
"default": false
},
"experimental.rainbowFrame": {
"description": "When enabled, the frame of the window will cycle through all the colors. Enabling this will override the `frame` and `unfocusedFrame` settings.",
"type": "boolean",
"default": false
},
"frame": {
"description": "The color of the window frame when the window is inactive. This only works on Windows 11",
"$ref": "#/$defs/ThemeColor"
},
"unfocusedFrame": {
"description": "The color of the window frame when the window is inactive. This only works on Windows 11",
"$ref": "#/$defs/ThemeColor"
}
}
},
@@ -1986,11 +1825,7 @@
"type": "string",
"description": "The name of the theme. This will be displayed in the settings UI.",
"not": {
"enum": [
"light",
"dark",
"system"
]
"enum": [ "light", "dark", "system" ]
}
},
"tab": {
@@ -2007,7 +1842,6 @@
"ThemePair": {
"additionalProperties": false,
"description": "A pair of Theme names, to allow the Terminal to switch theme based on the OS theme",
"type": "object",
"properties": {
"light": {
"type": "string",
@@ -2158,12 +1992,6 @@
{
"$ref": "#/$defs/ColorSelectionAction"
},
{
"$ref": "#/$defs/SearchWebAction"
},
{
"$ref": "#/$defs/ShowSuggestionsAction"
},
{
"type": "null"
}
@@ -2189,16 +2017,16 @@
},
"name": {
"description": "The name that will appear in the command palette. If one isn't provided, the terminal will attempt to automatically generate a name.\nIf name is a string, it will be the name of the command.\nIf name is a object, the key property of the object will be used to lookup a localized string resource for the command",
"type": [
"string",
"object",
"null"
],
"properties": {
"key": {
"type": "string"
}
}
},
"type": [
"string",
"object",
"null"
]
},
"iterateOn": {
"type": "string",
@@ -2235,7 +2063,6 @@
"Globals": {
"additionalProperties": true,
"description": "Properties that affect the entire window, regardless of the profile settings.",
"type": "object",
"properties": {
"alwaysOnTop": {
"default": false,
@@ -2247,11 +2074,6 @@
"description": "When set to true, tabs are always displayed. When set to false and \"showTabsInTitlebar\" is set to false, tabs only appear after opening a new tab.",
"type": "boolean"
},
"compatibility.enableUnfocusedAcrylic": {
"default": true,
"description": "When set to true, unfocused windows can have acrylic instead of opaque.",
"type": "boolean"
},
"centerOnLaunch": {
"default": false,
"description": "When set to `true`, the terminal window will auto-center itself on the display it opens on. The terminal will use the \"initialPosition\" to determine which display to open on.",
@@ -2332,20 +2154,12 @@
},
"type": "array"
},
"rendering.graphicsAPI": {
"description": "Direct3D 11 provides a more performant and feature-rich experience, whereas Direct2D is more stable. The default option \"Automatic\" will pick the API that best fits your graphics hardware. If you experience significant issues, consider using Direct2D.",
"type": "string",
"enum": [
"direct2d",
"direct3d11"
]
},
"rendering.disablePartialInvalidation": {
"description": "By default, the text renderer uses a FLIP_SEQUENTIAL Swap Chain and declares dirty rectangles via the Present1 API. When this setting is enabled, a FLIP_DISCARD Swap Chain will be used instead, and no dirty rectangles will be declared. Whether one or the other is better depends on your hardware and various other factors.",
"experimental.rendering.forceFullRepaint": {
"description": "When set to true, we will redraw the entire screen each frame. When set to false, we will render only the updates to the screen between frames.",
"type": "boolean"
},
"rendering.software": {
"description": "When enabled, the terminal will use a software rasterizer (WARP). This setting should be left disabled under almost all circumstances.",
"experimental.rendering.software": {
"description": "When set to true, we will use the software renderer (a.k.a. WARP) instead of the hardware one.",
"type": "boolean"
},
"experimental.input.forceVT": {
@@ -2458,17 +2272,10 @@
"theme": {
"default": "dark",
"description": "Sets the theme of the application. This value should be the name of one of the themes defined in `themes`. The Terminal also includes the themes `dark`, `light`, and `system`.",
"anyOf": [
"oneOf": [
{
"type": "string"
},
{
"enum": [
"dark",
"light",
"system"
]
},
{
"$ref": "#/$defs/ThemePair"
}
@@ -2578,12 +2385,12 @@
},
"required": [
"defaultProfile"
]
],
"type": "object"
},
"Profile": {
"description": "Properties specific to a unique profile.",
"additionalProperties": false,
"type": "object",
"properties": {
"acrylicOpacity": {
"default": 0.5,
@@ -2635,7 +2442,7 @@
},
"backgroundImage": {
"description": "Sets the file location of the image to draw over the window background.",
"anyOf": [
"oneOf": [
{
"type": [
"string",
@@ -2647,6 +2454,10 @@
"desktopWallpaper"
]
}
],
"type": [
"string",
"null"
]
},
"backgroundImageAlignment": {
@@ -2777,6 +2588,10 @@
"description": "When set to true, prompts will automatically be marked.",
"type": "boolean"
},
"experimental.connection.passthroughMode": {
"description": "When set to true, directs the PTY for this connection to use pass-through mode instead of the original Conhost PTY simulation engine. This is an experimental feature, and its continued existence is not guaranteed.",
"type": "boolean"
},
"experimental.retroTerminalEffect": {
"description": "When set to true, enable retro terminal effects. This is an experimental feature, and its continued existence is not guaranteed.",
"type": "boolean"
@@ -2786,15 +2601,15 @@
"description": "When set to true, marks added to the buffer via the addMark action will appear on the scrollbar.",
"type": "boolean"
},
"experimental.repositionCursorWithMouse": {
"default": false,
"description": "When set to true, you can move the text cursor by clicking with the mouse on the current commandline. This is an experimental feature - there are lots of edge cases where this will not work as expected.",
"type": "boolean"
},
"experimental.pixelShaderPath": {
"description": "Use to set a path to a pixel shader to use with the Terminal. Overrides `experimental.retroTerminalEffect`. This is an experimental feature, and its continued existence is not guaranteed.",
"type": "string"
},
"useAtlasEngine": {
"description": "Windows Terminal 1.16 and later ship with a new, performant text renderer. Set this to false to revert back to the old text renderer.",
"type": "boolean",
"default": true
},
"fontFace": {
"default": "Cascadia Mono",
"description": "[deprecated] Define 'face' within the 'font' object instead.",
@@ -2979,7 +2794,8 @@
"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"
}
}
},
"type": "object"
},
"ProfileList": {
"description": "A list of profiles and the properties specific to each.",
@@ -2994,7 +2810,6 @@
},
"ProfilesObject": {
"description": "A list of profiles and default settings that apply to all of them",
"type": "object",
"properties": {
"list": {
"$ref": "#/$defs/ProfileList"
@@ -3003,12 +2818,12 @@
"description": "The default settings that apply to every profile.",
"$ref": "#/$defs/Profile"
}
}
},
"type": "object"
},
"SchemeList": {
"description": "Properties are specific to each color scheme. ColorTool is a great tool you can use to create and explore new color schemes. All colors use hex color format.",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
@@ -3097,7 +2912,8 @@
"$ref": "#/$defs/Color",
"description": "Sets the color used as ANSI yellow."
}
}
},
"type": "object"
},
"type": "array"
}
@@ -3107,7 +2923,6 @@
"$ref": "#/$defs/Globals"
},
{
"type": "object",
"additionalItems": true,
"properties": {
"profiles": {

View File

@@ -1,9 +1,5 @@
# Terminal 2022 Roadmap
> **NOTE**
>
> This document has been superseded by the [Terminal 2023 Roadmap]. Please refer to that document for the updated roadmap.
## Overview
This document outlines the roadmap of features we're planning for the Windows Terminal during 2022. This serves as a successor to the [Terminal v2 Roadmap], to reflect changes to our planning going forward.
@@ -115,7 +111,7 @@ Incoming issues/asks/etc. are triaged several times a week, labeled appropriatel
[Up Next]: https://github.com/microsoft/terminal/milestone/37
[Backlog]: https://github.com/microsoft/terminal/milestone/45
[Terminal v2 Roadmap]: ./terminal-v2-roadmap.md
[Terminal v2 Roadmap]: https://github.com/microsoft/terminal/tree/main/doc/terminal-v2-roadmap.md
[Windows Terminal Preview 1.2 Release]: https://devblogs.microsoft.com/commandline/windows-terminal-preview-1-2-release/
[Windows Terminal Preview 1.3 Release]: https://devblogs.microsoft.com/commandline/windows-terminal-preview-1-3-release/
@@ -130,5 +126,3 @@ Incoming issues/asks/etc. are triaged several times a week, labeled appropriatel
[Windows Terminal Preview 1.12 Release]: https://devblogs.microsoft.com/commandline/windows-terminal-preview-1-12-release/
[Windows Terminal Preview 1.13 Release]: https://devblogs.microsoft.com/commandline/windows-terminal-preview-1-13-release/
[Windows Terminal Preview 1.14 Release]: https://devblogs.microsoft.com/commandline/windows-terminal-preview-1-14-release/
[Terminal 2023 Roadmap]: ./roadmap-2023.md

View File

@@ -1,76 +0,0 @@
# Terminal 2023 Roadmap
## Overview
This document outlines the roadmap of features we're planning for the Windows Terminal during 2023. This serves as a successor to the [2022 Roadmap], to reflect changes to our planning going forward.
## Release cadence
We've settled on a roughly quarterly release cycle - about once every three months. In May we released [Terminal 1.18]. We're targeting 1.19 for sometime in late September, and 1.20 likely in early January 2024. (These timelines are rough estimates, not strict rules. For example, 1.18's release was pushed back slightly to better align with Build 2023.)
New features will go into [Windows Terminal Preview](https://aka.ms/terminal-preview) first. Typically, one release after they've been in Preview, those features will move into [Windows Terminal](https://aka.ms/terminal) ("Terminal Stable"). In the case of some more risky or experimental features, we might hold them to only Preview builds for an extended period[^1].
| Quarter | Date | Release Version | Preview Release Blog Post |
| --------|------------|---------------- | ------------------------- |
| CY23 Q1 | 2023-01-24 | [Terminal 1.17] | [Windows Terminal Preview 1.17 Release] |
| CY23 Q2 | 2023-05-23 | [Terminal 1.18] | [Windows Terminal Preview 1.18 Release] |
| CY23 Q3 | | [Terminal 1.19] | [Windows Terminal Preview 1.19 Release] |
| CY23 Q4 | | [Terminal 1.20] | [Windows Terminal Preview 1.20 Release] |
Within a single milestone, we typically reserve the last month as "bake time", to polish off bugfixes and get the release ready to ship. In this last month, we'll likely slow down our ingestion of community PRs just to stabilize what's already in `main`. For example, a given release might look like:
```mermaid
gantt
title Proposed Terminal Releases 1.14-1.18
dateFormat YYYY-MM-DD
axisFormat %d %b
section Terminal 1.18
Lock down & bake :l18, 2023-05-09 , 2w
Release 1.18 :milestone, 2023-05-23, 0
1.18 becomes Stable :milestone, after l19, 0
section Terminal 1.19
Features :f19, after l18, 10w
Bugfix :b19, after f19 , 4w
Lock down & bake :l19, after b19 , 2w
Release 1.19 :milestone, after l19, 0
```
_informative, not normative_
## Up next in the Terminal
### Terminal 1.19
* Canary builds. Nightly builds of the Terminal from `main`. More unstable, but quicker access to experimental features.
* Terminal AI. While this will only be shipping in Canary builds to begin with, the v0 implementation will be available roughly at the same time as 1.19.
* The Suggestions UI. This is the starting point for shell completions [#3121], tasks [#1595], and probably Terminal AI at some point too.
* Unicode input for `cmd.exe` (and any other console app using "cooked reads"). See [#15567]
* Miscellaneous performance improvements. Conhost should be a _lot_ faster now.
* Broadcast input mode, for sending text to multiple panes at once.
## Team member "north stars"
For a more fluid take on what each of the team's personal goals are, head on over to [Core team North Stars]. This has a list of more long-term goals that each team member is working towards, but not things that are necessarily committed work.
[^1]: A conclusive list of these features can be found at [../src/features.xml](../src/features.xml). Note that this is a raw XML doc used to light up specific parts of the codebase, and not something authored for human consumption.
[2022 Roadmap]: ./roadmap-2022.md
[Terminal 1.17]: https://github.com/microsoft/terminal/releases/tag/v1.17.1023
[Terminal 1.18]: https://github.com/microsoft/terminal/releases/tag/v1.18.1462.0
[Windows Terminal Preview 1.17 Release]: https://devblogs.microsoft.com/commandline/windows-terminal-preview-1-17-release/
[Windows Terminal Preview 1.18 Release]: https://devblogs.microsoft.com/commandline/windows-terminal-preview-1-18-release/
[@DHowett]: https://github.com/DHowett
[@zadjii-msft]: https://github.com/zadjii-msft
[@lhecker]: https://github.com/lhecker
[@carlos-zamora]: https://github.com/carlos-zamora
[@PankajBhojwani]: https://github.com/PankajBhojwani
[Core team North Stars]: https://github.com/microsoft/terminal/wiki/Core-team-North-Stars
[#1595]: https://github.com/microsoft/terminal/issues/1595
[#3121]: https://github.com/microsoft/terminal/issues/3121
[#15567]: https://github.com/microsoft/terminal/issues/15567

View File

@@ -1,499 +0,0 @@
---
author: Mike Griese
created on: 2022-03-28
last updated: 2023-07-19
issue id: 11000, 1527, 6232
---
##### [Original issue: [#1527]] [experimental PR [#12948]] [remaining marks [#14341]]
# Windows Terminal - Shell Integration (Marks)
## Abstract
_"Shell integration" refers to a broad category of ways by which a commandline
shell can drive richer integration with the terminal. This spec in particular is
most concerned with "marks" and other semantic markup of the buffer._
Marks are a new buffer-side feature that allow the commandline application or
user to add a bit of metadata to a range of text. This can be used for marking a
region of text as a prompt, marking a command as succeeded or failed, quickly
marking errors in the output. These marks can then be exposed to the user as
pips on the scrollbar, or as icons in the margins. Additionally, the user can
quickly scroll between different marks, to allow easy navigation between
important information in the buffer.
Marks in the Windows Terminal are a combination of functionality from a variety
of different terminal emulators. "Marks" attempts to unify these different, but
related pieces of functionality.
## Background
There's a large amount of prior art on this subject. I've attempted to collect
as much as possible in the ["Relevant external docs"](#Relevant-external-docs)
section below. "Marks" have been used in different scenarios by different
emulators for different purposes. The common thread running between them of
marking a region of text in the buffer with a special meaning.
* iTerm2, ConEmu, FinalTerm et.al. support emitting a VT sequence to indicate
that a line is a "prompt" line. This is often used for quick navigation
between these prompts.
* FinalTerm (and xterm.js) also support marking up more than just the prompt.
They go so far as to differentiate the start/end of the prompt, the start of
the commandline input, and the start/end of the command output.
`FTCS_COMMAND_FINISHED` is even designed to include metadata indicating
whether a command succeeded or failed.
* Additionally, Terminal.app allows users to "bookmark" lines via the UI. That
allows users to quickly come back to something they feel is important.
* Consider also editors like Visual Studio. VS also uses little marks on the
scrollbar to indicate where other matches are for whatever the given search
term is.
### "Elevator" pitch
The Terminal provides a way for command line shells to semantically mark parts
of the command-line output. By marking up parts of the output, the Terminal can
provide richer experiences. The Terminal will know where each command starts and
stops, what the actual command was and what the output of that command is. This
allows the terminal to expose quick actions for:
* Quickly navigating the history by scrolling between commands
* Re-running a previous command in the history
* Copying all the output of a single command
* A visual indicator to separate out one command-line from the next, for quicker
mental parsing of the output of the command-line.
* Collapsing the output of a command, as to reduce noise
* Visual indicators that highlight commands that succeeded or failed.
* Jumping to previously used directories
### User Stories
This is a bit of a unusual section, as this feature was already partially
implemented when this spec was written.
Story | Size | Description
--|-----------|--
A | ✅ Done | The user can use mark each prompt and have a mark displayed on the scrollbar
B | ✅ Done | The user can perform an action to scroll between marks
C | ✅ Done | The user can manually add marks to the buffer
D | ✅ Done | The shell can emit different marks to differentiate between prompt, command, and output
E | ✅ Done | Clearing the buffer clears marks
F | 🐣 Crawl | Marks stay in the same place you'd expect after resizing the buffer.
G | ✅ Done | Users can perform an action to select the previous command's output
H | 🚶 Walk | The find dialog can display marks on the scrollbar indicating the position of search matches
I | 🏃‍♂️ Run | The terminal can display icons in the gutter, with quick actions for that command (re-run, copy output, etc)
J | 🏃‍♂️ Run | The terminal can display a faint horizontal separator between commands in the buffer.
K | 🚀 Sprint | The terminal can "collapse" content between two marks.
L | 🚀 Sprint | The terminal can display a sticky header above the control which displays the most recent command
M | 🚀 Sprint | The user can open a dialog to manually bookmark a line with a custom comment
## Solution Design
### Supported VT sequences
* [x] iTerm2's OSC `SetMark` (in [#12948])
* [x] FinalTerm prompt markup sequences
- [x] **FTCS_PROMPT** was added in [#13163]
- [x] The rest in [#14341]
* [ ] additionally, VsCode's FinalTerm prompt markup variant, `OSC 663`
* [ ] [ConEmu's
`OSC9;12`](https://conemu.github.io/en/AnsiEscapeCodes.html#ConEmu_specific_OSC)
* [ ] Any custom OSC we may want to author ourselves.
The FinalTerm prompt sequences are probably the most complicated version of all
these, so it's important to give these a special callout. Almost all the other
VT sequences are roughly equivalent to **FTCS_PROMPT**. The xterm.js / VsCode
version has additional cases, that they ironically added to work around conpty
not understanding these sequences originally.
#### FinalTerm sequences
The relevant FinalTerm sequences for marking up the prompt are as follows.
![image](FTCS-diagram.png)
* **FTCS_PROMPT**: `OSC 133 ; A ST`
- The start of a prompt. Internally, this sets a marker in the buffer
indicating we started a prompt at the current cursor position, and that
marker will be used when we get a **FTCS_COMMAND_START**
* **FTCS_COMMAND_START**: `OSC 133 ; B ST`
- The start of a commandline (READ: the end of the prompt). When it follows a
**FTCS_PROMPT**, it creates a mark in the buffer from the location of the
**FTCS_PROMPT** to the current cursor position, with the category of
`prompt`
* **FTCS_COMMAND_EXECUTED**: `OSC 133 ; C ST`
- The start of the command output / the end of the commandline.
* **FTCS_COMMAND_FINISHED**: `OSC 133 ; D ; [Ps] ST`
- the end of a command.
Same deal for the **FTCS_COMMAND_EXECUTED**/**FTCS_COMMAND_FINISHED** ones.
**FTCS_COMMAND_EXECUTED** does nothing until we get a **FTCS_COMMAND_FINISHED**,
and the `[Ps]` parameter determines the category.
- `[Ps] == 0`: success
- anything else: error
This whole sequence will get turned into a single mark.
When we get the **FTCS_COMMAND_FINISHED**, set the category of the prompt mark
that preceded it, so that the `prompt` becomes an `error` or a `success`.
### Buffer implementation
In the initial PR ([#12948]), marks were stored simply as a `vector<Mark>`,
where a mark had a start and end point. These wouldn't reflow on resize, and
didn't support all of the FTCS sequences.
There's ultimately three types of region here we need to mark:
* The prompt (starting from A)
* the command (starting from B)
* the output (starting from C)
That intuitively feels a bit like a text attribute almost. Additionally, the
prompt should be connected to its subsequent command and output, s.t. we can
* Select command output
* re-run command
easily. Supposedly, we could do this by iterating through the whole buffer to
find the previous/next {whatever}[[1](#footnote-1)]. Additionally, the prompt
needs to be able to contain the status / category, and a `133;D` needs to be
able to change the category of the previous prompt/command.
If we instead do a single mark for each command, from `133;A` to `133;A`, and
have sub-points for elements within the command
* `133;A` starts a mark on the current line, at the current position.
* `133;B` sets the end of the mark to the current position.
* `133;C` updates the mark's `commandStart` to the current end, then sets the
end of the mark to the current position.
* `133;D` updates the mark's `outputStart` to the current end, then sets the end
of the mark to the current position. It also updates the category of the mark,
if needed.
Each command then only shows up as a single mark on the scrollbar. Jumping
between commands is easy, `scrollToMark` operates on `mark.start`, which is
where the prompt started. "Bookmarks", i.e. things started by the user wouldn't
have `commandStart` or `outputStart` in them. Getting the text of the command,
of the output is easy - it's just the text between sub-points.
Reflow still sucks though - we'd need to basically iterate over all the marks as
we're reflowing, to make sure we put them into the right place in the new
buffer. This is annoying and tedious, but shouldn't realistically be a
performance problem.
#### Cmd.exe considerations
`cmd.exe` is generally a pretty bad shell, and doesn't have a lot of the same
hooks that other shells do, that might allow for us to emit the
**FTCS_COMMAND_EXECUTED** sequence. However, cmd.exe also doesn't allow
multiline prompts, so we can be relatively certain that when the user presses
<kbd>enter</kbd>, that's the end of the prompt. We will treat the
`autoMarkPrompts` setting (which auto-marks <kbd>enter</kbd>) as the _end of the
prompt_. That would at least allow cmd.exe to emit a {command finished}{prompt
start}{prompt...}{command start} in the prompt, and have us add the command
executed. It is not perfect (we wouldn't be able to get error information), but
it does work well enough.
```cmd
PROMPT $e]133;D$e\$e]133;A$e\$e]9;9;$P$e\%PROMPT%$e]133;B$e\
```
## Settings proposals
The below are the proposed additions to the settings for supporting marks and
interacting with them. Some of these have already been added as experimental
settings - these would be promoted to no longer be experimental.
Many of the sub-points on these settings are definitely "Future Consideration"
level settings. For example, the `scrollToMark` `"highlight"` property. That one
is certainly not something we need to ship with.
### Actions
In addition to driving marks via the output, we will also want to support adding
marks manually. These can be thought of like "bookmarks" - a user indicated
region that means something to the user.
* [ ] `addMark`: add a mark to the buffer. If there's a selection, place the
mark covering at the selection. Otherwise, place the mark on the cursor row.
- [x] `color`: a color for the scrollbar mark. (in [#12948])
- [ ] `category`: one of `{"prompt", "error", "warning", "success", "info"}`
* [ ] `scrollToMark`
- [x] `direction`: `["first", "previous", "next", "last"]` (in [#12948])
- [ ] `category`: `flags({categories}...)`, default `"all"`. Only scroll to
one of the categories specified (e.g. only scroll to the previous error,
only the previous prompt, or just any mark)
- [ ] [#13449] - `center` or some other setting that controls how the mark is scrolled in.
- Maybe `top` (current) /`center` (as proposed) /`nearestEdge` (when
scrolling down, put the mark at the bottom line of viewport , up -> top
line)?
- [ ] [#13455] - `highlight`: `bool`, default true. Display a temporary
highlight around the mark when scrolling to it. ("Highlight" != "select")
- If the mark has prompt/command/output sections, only select the prompt and command.
- If the mark has zero width (i.e. the user just wanted to bookmark a line),
then highlight the entire row.
* [x] `clearMark`: Remove any marks in the selected region (or at the cursor
position) (in [#12948])
* [x] `clearAllMarks`: Remove all the marks from the buffer. (in [#12948])
#### Selecting commands & output
_Inspired by a long weekend of manually copying .csv output from the Terminal to
a spreadsheet, only to discover that we rejected [#4588] some years ago._
* [x] `selectCommand(direction=[prev, next])`: Starting at the active selection
anchor, (or the cursor if there's no selection), select the command that
starts before/after this point (exclusive). Probably shouldn't wrap around
the buffer.
* Since this will create a selection including the start of the command,
performing this again will select the _next_ command (in whatever
direction).
* [x] `selectOutput(direction=[prev, next])`: same as above, but with command outputs.
A convenient workflow might be a `multipleActions([selectOutput(prev),
copy()])`, to quickly select the previous commands output.
### Per-profile settings
* [x] `autoMarkPrompts`: `bool`, default `false`. (in [#12948])
* [ ] `showFindMatchesOnScrollbar`: `bool`, default `true`.
* [ ] `showMarksOnScrollbar`: `bool` or `flags({categories}...)`
* As an example: `"showMarksOnScrollbar": ["error", "success"]`).
* Controls if marks should be displayed on the scrollbar.
* If `true`/`"all"`, then all marks are displayed.
* If `false`/`"none"`, then no marks are displayed.
* If a set of categories are provided, only display marks from those categories.
* [x] the bool version is (in [#12948])
* [ ] The `flags({categories}...)` version is not done yet.
* [ ] `showGutterIcons`, for displaying gutter icons.
## UX Design
An example of what colored marks look like:
![Select the entire output of a command](https://user-images.githubusercontent.com/18356694/207696859-a227abe2-ccd4-4b81-8a2c-8a22219cd0dd.gif)
This gif demos both prompt marks and marks for search results:
![](https://user-images.githubusercontent.com/18356694/191330278-3f6bc207-1bd5-4ebd-bb0e-1f84b0170f49.gif)
### Gutter icons
![](vscode-shell-integration-gutter-mark.png)
_An example of what the icons in the VsCode gutter look like_
### Multiple marks on the same line
When it comes to displaying marks on the scrollbar, or in the margins, the
relative priority of these marks matters. Marks are given the following
priority, with errors being the highest priority.
* Error
* Warning
* Success
* Prompt
* Info (default)
## Work needed to get marks to v1
* [x] Clearing the screen leaves marks behind
* [x] Make sure `ED2` works to clear/move marks
* [x] Same with `ED3`
* [x] Same with `cls` / `Clear-Host`
* [x] Clear Buffer action too.
* [X] Circling doesn't update scrollbar
* I think this was fixed in [#14341], or in [#14045]
* [ ] Resizing / reflowing marks
* [x] marks should be stored in the `TextBuffer`
## Future Considerations
* adding a timestamp for when a line was marked?
* adding a comment to the mark. How do we display that comment? a TeachingTip on
the scrollbar maybe (actually that's a cool idea)
* adding a shape to the mark? Terminal.app marks prompt lines with brackets in
the margins
* Marks are currently just displayed as "last one in wins", they should have a
real sort order
* Should the height of a mark on the scrollbar be dependent on font size &
buffer height? I think I've got it set to like, a static 2dip, but maybe it
should represent the actual height of the row (down to a min 1dip)
* [#13455] - highlight a mark when scrolled to with the `scrollToMark` action.
This is left as a future consideration to figure out what kind of UI we want
here. Do we want to highlight
- the prompt?
- the whole row of the prompt?
- the prompt and the command?
- The whole prompt & command & output?
* an `addBookmark` action: This one's basically just `addMark`, but opens a prompt
(like the window renamer) to add some text as a comment. Automatically
populated with the selected text (if there was some).
- A dedicated transient pane for displaying non-terminal content might be
useful for such a thing.
- This might just make more sense as a parameter to `addMark`.
* Other ideas for `addMark` parameters:
- `icon`: This would require us to better figure out how we display gutter
icons. This would probably be like, a _shape_ rather than an arbitrary
image.
- `note`: a note to stick on the mark, as a comment. Might be more valuable
with something like `addBookmark`.
### Gutter icons
VsCode implements a set of gutter icons to the left of the buffer lines, to
provide a UI element for exposing some quick actions to perform, powered by
shell integration.
Gutter icons don't need to implement app-level actions at all. They _should_ be
part of the control. At least, part of the UWP `TermControl`. These are some
basic "actions" we could add to that menu. Since these are all attached to a
mark anyways, we already know what mark the user interacted with, and where the
start/end already is.
* Copy command
* Copy output
* Re-run command
* Save as task
* Explain this (for errors)
To allow comments in marks (ala "bookmarks"), we can use
the gutter flyout to display the comment, and have the tooltip display that
comment.
This is being left as a future consideration for now. We need to really sit and
consider what the UX is like for this.
* Do we just stick the gutter icons in the margin/padding?
* Have it be a separate space in the "buffer"
- If it's in the buffer itself, we can render it with the renderer, which by
all accounts, we probably should.
### Edge cases where these might not work as expected
Much of the benefits of shell integration come from literal buffer text parsing.
This can lead to some rough edge cases, such as:
* the user presses <kbd>Ctrl+V</kbd><kbd>Escape</kbd> to input an ESC character
and the shell displays it as `^[`
* the user presses <kbd>Ctrl+V</kbd><kbd>Ctrl+J</kbd> to input an LF character
and the shell displays it as a line break
* the user presses <kbd>Enter</kbd> within a quoted string and the shell
displays a continuation prompt
* the user types a command including an exclamation point, and the shell invokes
history expansion and echoes the result of expansion before it runs the
command
* The user has a prompt with a right-aligned status, ala
![](https://user-images.githubusercontent.com/189190/254475719-5007df07-6cc3-42e8-baf7-2572579eb2b9.png)
In these cases, the effects of shell integration will likely not work as
intended. There are various possible solutions that are being explored. We might
want to in the future also use [VsCode's extension to the FTCS sequences] to
enable the shell to tell the terminal the literal resulting commandline.
There's been [other proposals] to extend shell integration features as well.
### Rejected ideas
There was originally some discussion as to whether this is a design that should
be unified with generic pattern matchers. Something like the URL detection,
which identifies part of the buffer and then "marks" it. Prototypes for both of
these features are going in very different directions, however. Likely best to
leave them separate.
## Resources
### Other related issues
Not necessarily marks related, but could happily leverage this functionality.
* [#5916] and [#12366], which are likely to be combined into a single thread
- Imagine a trigger that automatically detects `error:.*` and then marks the line
* [#9583]
- Imagine selecting some text, colorizing & marking it all at once
- `addMark(selection:false)`, above, was inspired by this.
* [#7561] (and broadly, [#3920])
- Search results should maybe show up here on the scrollbar too.
* [#13455]
* [#13449]
* [#4588]
* [#14754] - A "sticky header" for the `TermControl` that could display the
previous command at the top of the buffer.
* [#2226] - a scrollable "minimap" in te scrollbar, as opposed to marks
### Relevant external docs
* **GREAT** summary of the state of the ecosystem: https://gitlab.freedesktop.org/terminal-wg/specifications/-/issues/28
* https://iterm2.com/documentation-escape-codes.html
- `OSC 1337 ; SetMark ST` under "Set Mark"
- under "Shell Integration/FinalTerm
* https://support.apple.com/en-ca/guide/terminal/trml135fbc26/mac
- discusses auto-marked lines on `enter`/`^C`/`^D`
- allows bookmarking lines with selection
- bookmarks can have a name (maybe not super important)
* [How to Use Marks in OS Xs Terminal for Easier Navigation](https://www.howtogeek.com/256548/how-to-use-marks-in-os-xs-terminal-for-easier-navigation/)
* [Terminal: The \[ Marks the Spot](https://scriptingosx.com/2017/03/terminal-the-marks-the-spot/)
* Thread with VsCode (xterm.js) implementation notes: https://github.com/microsoft/terminal/issues/1527#issuecomment-1076455642
* [xterm.js prompt markup sequences](https://github.com/microsoft/vscode/blob/39cc1e1c42b2e53e83b1846c2857ca194848cc1d/src/vs/workbench/contrib/terminal/browser/xterm/shellIntegrationAddon.ts#L50-L52)
* [VsCode command tracking release notes](https://code.visualstudio.com/updates/v1_22#_command-tracking), also [Terminal shell integration](https://code.visualstudio.com/updates/v1_65#_terminal-shell-integration)
* ConEMU:
Sequence | Description
-- | --
ESC ] 9 ; 12 ST | Let ConEmu treat current cursor position as prompt start. Useful with PS1.
* https://iterm2.com/documentation-one-page.html#documentation-triggers.html"
### Footnotes
<a name="footnote-1"><a>[1]: Intuitively, this feels prohibitively expensive,
but you'd be mistaken.
An average device right now (I mean something that was alright about 5 years
ago, like an 8700k with regular DDR4) does about 4GB/s of random, un-cached
memory access. While low-end devices are probably a bit slower, I think 4GB/s is
a good estimate regardless. That's because non-random memory access is way way
faster than that at around 20GB/s (DDR4 2400 - what most laptops had for the
last decade).
Assuming a 120 column * 32k line buffer (our current maximum), the buffer would
be about 21MB large. Going through the entire buffer linearly at 20GB/s would
take just 1ms (including all text and metadata). If we assume that each row has
a mark, that marks are 36 byte large and assuming the worst case of random
access, we can go through all 32k within about 0.3ms.
_(Thanks lhecker for these notes)_
[#1527]: https://github.com/microsoft/terminal/issues/1527
[#12948]: https://github.com/microsoft/terminal/issues/12948
[#1527]: https://github.com/microsoft/terminal/issues/1527
[#6232]: https://github.com/microsoft/terminal/issues/6232
[#2226]: https://github.com/microsoft/terminal/issues/2226
[#12948]: https://github.com/microsoft/terminal/issues/12948
[#13163]: https://github.com/microsoft/terminal/issues/13163
[#12948]: https://github.com/microsoft/terminal/issues/12948
[#12948]: https://github.com/microsoft/terminal/issues/12948
[#12948]: https://github.com/microsoft/terminal/issues/12948
[#13455]: https://github.com/microsoft/terminal/issues/13455
[#13449]: https://github.com/microsoft/terminal/issues/13449
[#12948]: https://github.com/microsoft/terminal/issues/12948
[#12948]: https://github.com/microsoft/terminal/issues/12948
[#4588]: https://github.com/microsoft/terminal/issues/4588
[#5804]: https://github.com/microsoft/terminal/issues/5804
[#12948]: https://github.com/microsoft/terminal/issues/12948
[#12948]: https://github.com/microsoft/terminal/issues/12948
[#13455]: https://github.com/microsoft/terminal/issues/13455
[#5916]: https://github.com/microsoft/terminal/issues/5916
[#12366]: https://github.com/microsoft/terminal/issues/12366
[#9583]: https://github.com/microsoft/terminal/issues/9583
[#7561]: https://github.com/microsoft/terminal/issues/7561
[#3920]: https://github.com/microsoft/terminal/issues/3920
[#13455]: https://github.com/microsoft/terminal/issues/13455
[#13449]: https://github.com/microsoft/terminal/issues/13449
[#4588]: https://github.com/microsoft/terminal/issues/4588
[#14341]: https://github.com/microsoft/terminal/issues/14341
[#14045]: https://github.com/microsoft/terminal/issues/14045
[#14754]: https://github.com/microsoft/terminal/issues/14754
[#14341]: https://github.com/microsoft/terminal/issues/14341
[VsCode's extension to the FTCS sequences]: https://code.visualstudio.com/docs/terminal/shell-integration#_vs-code-custom-sequences-osc-633-st
[other proposals]: https://gitlab.freedesktop.org/terminal-wg/specifications/-/merge_requests/6#f6de1e5703f5806d0821d92b0274e895c4b6d850

Binary file not shown.

Before

Width:  |  Height:  |  Size: 201 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

View File

@@ -435,7 +435,7 @@ ultimately deemed it to be out of scope for the initial spec review.
<!-- Footnotes -->
[#2046]: https://github.com/microsoft/terminal/issues/2046
[Command Palette, Addendum 1]: ../%232046%20-%20Unified%20keybindings%20and%20commands%2C%20and%20synthesized%20action%20names.md
[Command Palette, Addendum 1]: https://github.com/microsoft/terminal/blob/main/doc/specs/%232046%20-%20Unified%20keybindings%20and%20commands%2C%20and%20synthesized%20action%20names.md
[#3337]: https://github.com/microsoft/terminal/issues/3337
[#6899]: https://github.com/microsoft/terminal/issues/6899

Binary file not shown.

Before

Width:  |  Height:  |  Size: 585 KiB

View File

@@ -1,744 +0,0 @@
---
author: Mike Griese
created on: 2022-08-22
last updated: 2023-08-03
issue id: 1595
---
# Windows Terminal - Suggestions UI
## Abstract
Multiple related scenarios have come up where it would be beneficial to display
actionable UI to the user within the context of the active terminal itself. This
UI would be akin to the Intellisense UI in Visual Studio. It appears right where
the user is typing, and can help provide immediate content for the user, based
on some context. The "Suggestions UI" is this new ephemeral UI within the
Windows Terminal that can display different types of actions, from different
sources.
## Background
The Suggestions UI is the singular UI by which the Terminal can display a
variety of suggestions to the user. These include:
* Recent commands the user has executed in this terminal, powered by shell integration.
* Recent directories, similarly powered by shell integration
* Completions from the shell itself (like the shell completions in PowerShell)
* Tasks, which are `sendInput` actions from the user's settings
* Buffer Completions, which is a dumb type of autocomplete based on words in the buffer
* and more (as provided via extensions)
All of these scenarios are places where it makes sense to present the user a
menu at the point of text insertion in the terminal control itself.
### Inspiration
Primarily, the inspiration is any Intellisense-like experience, in any app.
Visual Studio, VsCode, PowerShell, vim, Sublime any JetBrains IDE - there's more
than enough examples in the wild.
Ultimately, the inspiration for the Suggestions UI came from a bunch of places
all at once. In the course of a few months though, it became clear that we'd
need a unified UI for displaying a variety of suggestion-like experiences in the
Terminal. Our work with the PowerShell and VsCode teams helped refine these
requests all into the unified design below.
### User Stories
Size | Description
-----------|--
🐣 Crawl | The user can bring up the Suggestions UI with recent commands, powered by shell integration
🐣 Crawl | [#12863] The user can bring up the Suggestions UI with recent directories, powered by shell integration
🚶 Walk | The user can bring up the Suggestions UI with tasks from their settings
🚶 Walk | CLI apps can invoke the Suggestions UI with a new VT sequence
🚶 Walk | The Suggestions UI can be opened using the current typed commandline as a filter
🚶 Walk | Recent commands and directories are stored in `state.json`, across sessions
🏃‍♂️ Run | Suggestions can have descriptions presented in / alongside the UI
🏃‍♂️ Run | The Suggestions UI can be opened without any nesting
🏃‍♂️ Run | The Suggestions UI can be opened, nested by `source` of the suggestion
🚀 Sprint | Extensions can provide suggestion sources for the Suggestions UI
🚀 Sprint | The Suggestions UI can be opened in "inline" mode, only showing the text of the first suggestion
### Elevator Pitch
The Suggestions UI is a UI element displayed in the Terminal for providing
different types of text suggestions to the user - anything from recently run
commands, to saved commands, to tab-completion suggestions from the shell
itself.
## Business Justification
It will delight developers.
Furthermore, our partners on the Visual Studio team have been requesting similar
functionality for some time now. The way autocompletion menus in PowerShell
currently interact with UIA clients leaves much to be desired. They'd like a way
to provide richer context to screen readers. Something to enable the terminal to
more specifically describe the context of what's being presented to the user.
## Scenario Details
### UI/UX Design
#### Prototypes
The following gif was a VsCode prototype of [shell-driven autocompletion]. This
is the point of reference we're starting from when talking about what the
suggestions UI might look like.
![](vscode-shell-suggestions.gif)
These suggestions are populated by logic within PowerShell itself, and
communicated to the Terminal. The Terminal can then display them in the
Suggestions UI.
The following demonstrate a prototype of what that might look like for the
Terminal. These are meant to be informative, not normative, representations of
what the UI would look like.
![](shell-autocomplete-july-2022-000.gif)
A prototype of the recent commands UI, powered by shell integration:
![](command-history-suggestions.gif)
A prototype of the tasks UI, powered by the user's settings:
![](tasks-suggestions.gif)
(admittedly, the `TeachingTip` in that gif is a prototype and was later replaced
with a better version.)
In general, the Suggestions UI will present a list of elements to select from,
near the text cursor. This control might be contain a text box for filtering
these items (a "**palette**"), or it might not (a "**menu**").
![An example of the menu mode](3121-suggestion-menu-2023-000.gif)
#### Palette vs Menu
Depending on how the suggestions UI is invoked, we may or may not want to
display a text box for filtering these suggestions. Consider the Intellisense
menu in Visual Studio. That's a UI that only allows for up/down for navigation
(and enter/tab for selecting the suggestion).
For suggestions driven by the Terminal, we'll display a filtering text box in
the Suggestions UI. This is similar to the command palette's search - a fuzzy
search to filter the contents. This is the "**palette**" style of the
suggestions dialog.
For completions driven by the shell, we should probably not display the
filtering text box. This is the "**menu**" style of the suggestion dialog. The
user is primarily interacting with the shell here, not the Terminal.
> **Warning**
> TODO! For discussion, possibly with a real UX designer.
How should we handle completions here? Tab? Enter? Right-Arrow? Should we have
an element selected when we open the menu, or should tab/enter only work once
the user has used the arrows at least once? Sublime allows for <kbd>tab</kbd> to
complete the suggestion immediately.
Consider also that these suggestions might be provided by the shell, as the user
is typing at a commandline shell. For something like PowerShell, the user might
want to start typing a command and have it tab-complete based off the shell's
tab expansion rules. PowerShell's inline suggestions use right-arrow to
differentiate "use this suggestion" vs tab for "tab expand what I'm typing at
the prompt". We should probably preserve this behavior.
We probably don't want to provide different experiences for the **menu** version
of the Suggestions UI vs. the **palette** version. In the palette version, the
user won't be pressing tab to tab-complete at the shell - the focus is out of
the of terminal and in the Suggestions UI. With the menu version, the focus is
still "in the terminal", and users would expect tab to tab-complete.
We will want to make sure that there's some semblance of consistency across our
implementation for the Suggestions UI, our own Command Palette, VsCode's
intellisense and their own implementation of shell-completions in the Terminal.
> **Note**
> In my prototype, for the "Menu" mode, I accepted ALL of right-arrow, tab, and
> enter as "accept completion", and any other key dismissed the UI. This _felt_
> right for that mode. I'm not sure we could make the same call for "palette"
> mode, where we'd need tab for navigating focus.
### Implementation Details
#### Fork the Command Palette
We're largely going to start with the Command Palette to build the Suggestions
UI[[1](#footnote-1)]. The Command Palette is already a control we've built for displaying a
transient list of commands and dispatching them to the rest of the app.
Currently, the Command Palette is a single static control, at the top-center of
the Terminal window, and occupying a decent portion of the screen. For the
Suggestions UI, we'll instead want to make sure that the control appears
relative to the current cursor position.
We'll start by taking the command palette, and copying it over to a new control.
This will allow us to remove large chunks of code dealing with different modes
(i.e. the tab switcher), and code dealing with prefix characters to switch
modes.
We'll need to make some small modifications to enable the Suggestions UI to
* work as a text cursor-relative control
* exist as a Flyout outside the bounds of the Terminal window
* If the Suggestions UI is too close to the bottom of the screen, we'll need it to open
"upwards", with the search box at the _bottom_ and the list extending above it
* prevent it from switching to command-line mode
* display tooltips / `TeachingTip`s / some secondary flyout with a description
of the suggestion (if provided)
#### Completion sources
The Suggestions UI will support suggestions from a variety of different
"sources". As an example, consider the following actions:
```json
{ "command": { "action":"suggestions", "source": "commandHistory" } },
{ "command": { "action":"suggestions", "source": "directoryHistory" } },
{ "command": { "action":"suggestions", "source": "tasks" } },
{ "command": { "action":"suggestions", "source": "local" } },
{ "command": { "action":"suggestions", "source": ["local", "tasks", "commandHistory"] } },
{ "command": { "action":"suggestions", "source": "Microsoft.Terminal.Extensions.BufferComplete" } },
```
Each of these `suggestions` actions would open the Suggestions UI with a
different set of actions.
* `commandHistory`: Use commands from this session, as identified via shell
integration. This won't be able to return any suggestions if the user has not
configured their shell to support shell integration sequences yet.
* `directoryHistory`: Populate the list with a series of `cd {path}` commands,
where the paths are populated via shell integration. Paths are in MRU order.
* `tasks`: Populate the list with all `sendInput` actions in the user's settings
file. The command structure should remain unchanged. For example, if they have
`sendInput` actions nested under a "git" command, then the "git" entry will
remain in this tasks view with their `sendInput` actions nested inside it. For
more details, see the [Tasks] spec.
* `local`: Populate the list with tasks that are located in the CWD, in a file
named `.wt.json`. For more details, see the [Tasks] spec.
* `Microsoft.Terminal.Extensions.BufferComplete`: As an example, this
demonstrates how an action might be authored to reference a suggestion source
from an extension[[2](#footnote-2)].
Each of these different sources will build a different set of `Command`s,
primarily populated with `sendInput` actions. We'll load those `Command`s into
the Suggestions UI control, and open it at the text cursor.
To drill in on a single example - the `commandHistory` source. In that
particular case, the TerminalPage will query the active TermControl for a list
of its recent commands. If it knows these (via shell integration), then the
TerminalPage will use that list of commands to build a list of `sendInput`
actions. Those will then get fed to the suggestions UI.
Not listed above is [shell-driven autocompletion]. These aren't something that
the Terminal can invoke all on its own - these are something the shell would
need to invoke themselves.
#### Pre-populate the current commandline context
Consider the following scenario. A user has typed `git c` in their shell, and
has [shell integration] enabled for their shell. They want to open the
Suggestions UI filtered to their recent history, but starting with what they've
already typed. To support this scenario, we'll add an additional property:
* `"useCommandline"`: `bool` (**default**: `true`)
* `true`: the current commandline the user has typed will pre-populate the
filter of the Suggestions UI. This requires that the user has enabled shell
integration in their shell's config.
* `false`: the filter will start empty, regardless of what the user has typed.
With that setting, the user can achieve their desired UX with the following action:
```json
{ "command": { "action":"suggestions", "source": "commandHistory", "useCommandline": true } },
```
Now, when they type `git c` and invoke the Suggestions UI, they can immediately
start searching for recent commands that started with `git c`.
The primary use case for `useCommandline: false` was for `"nesting": "source"`.
When filtering a list of ["Tasks...", "Recent commands...", "Recent
directories...", "Docker...", "Git..."], then there's minimal value to start by
filtering to "git c".
#### Default actions
I propose adding the following actions to the Terminal by default:
```json
{ "command": { "action":"suggestions", "source": "commandHistory", "useCommandline": true } },
{ "command": { "action":"suggestions", "source": "directoryHistory" } },
{ "command": { "action":"suggestions", "source": ["local", "tasks", "commandHistory"], "useCommandline": true, "nesting": "disabled" } },
{ "command": { "action":"suggestions", "source": ["all"], "useCommandline": false, "nesting": "source" } },
```
These actions are colloquially:
* Give me suggestions from my recent commands, using what I've typed
* Give me suggestions of directories I've recently been in
* _(After [Tasks] are implemented)_ Give me suggestions from recent commands,
commands I've saved, and commands for this project. Don't nest any, so they're
all in the top-level menu. Use what I've typed already to start filtering.
* Just open the Suggestions UI with all suggestions sources, and group them by
the source of the suggestions.
This should cover most of the basic use cases for suggestions.
#### Who owns this menu?
There was some discussion of who should own the suggestions menu. The control
itself? Or the app hosting the control?
A main argument for hosting this UI in the control itself is that any consumer
of the `TermControl` should be able to display the [shell-driven autocompletion]
menu. And they should get the UI from us "for free". Consumers shouldn't need to
reimplement it themselves. This probably could be done without many changes:
* Instead of operating on `Command`s and actions from the terminal settings,
the control could just know that all the entries in the menu are "send
input" "actions".
* The control could offer a method to manually invoke the Suggestions UI for a
list of {suggestion, name, description} objects.
* The app layer could easily translate between sendInput actions and these
pseudo-actions.
A big argument in favor of having the app layer host the control: Consider an
app like Visual Studio. When they embed the control, they'll want to style the
shell-completions UI in their own way. They already have their own intellisense
menu, and their own UI paradigm.
For now, we'll leave this as something that's owned by the app layer. When we
get around to finalizing the [shell-driven autocompletion] design, we can
iterate on ideas for supporting both consumers that want to use a pre-built
suggestions control, or consumers who want to bring their own.
## Tenets
<table>
<tr><td><strong>Compatibility</strong></td><td>
This shouldn't break any existing flows. This is a general purpose UI element,
to be extended in a variety of ways. Those customizations will all be opt-in by
the user, so I'm not expecting any breaking compatibility changes here.
</td></tr>
<tr><td><strong>Accessibility</strong></td><td>
The Suggestions UI was designed with the goal of making commandline shell
suggestions _more_ accessible. As Carlos previously wrote:
> Screen readers struggle with this because the entire menu is redrawn every time, making it harder to understand what exactly is "selected" (as the concept of selection in this instance is a shell-side concept represented by visual manipulation).
>
> ...
>
> _\[Shell driven suggestions\]_ can then be leveraged by Windows Terminal to create UI elements. Doing so leverages WinUI's accessible design.
This will allow the Terminal to provide more context-relevant information to
screen readers.
</td></tr>
<tr><td><strong>Sustainability</strong></td><td>
No sustainability changes expected.
</td></tr>
<tr><td><strong>Localization</strong></td><td>
The localization needs of the Suggestions UI will be effectively the same as the
needs of the Command Palette.
The Terminal will have no way to localize suggestions that are provided via
[shell-driven autocompletion]. These are just verbatim strings that the shell
told us to use. We don't consider this to be something to worry about, however.
This is no different than the fact that Terminal cannot localize the `Get-Help`
(or any other) output of PowerShell.
</td></tr>
</table>
## Implementation Plan
This is more of an informative outline, rather than a normative one. Many of the
things from Crawl, Walk, and Run are all already in PRs as of the time of this
spec's review.
### 🐣 Crawl
* [ ] Fork the Command palette to a new UI element, the `SuggestionsControl`
* [ ] Enable previewing `sendInput` actions in the Command Palette and `SuggestionsControl`
* [ ] Enable the `SuggestionsControl` to open top-down (aligned to the bottom of the cursor row) or bottom-up (aligned to the top of the cursor row).
* [ ] Disable sorting on the `SuggestionsControl` - elements should presumably be pre-sorted by the source.
* [ ] Expose the recent commands as a accessor on `TermControl`
* [ ] Add a `suggestions` action which accepts a single option `recentCommands`. These should be fed in MRU order to the `SuggestionsControl`.
* [ ] Expose the recent directories as an accessor on `TermControl`, and add a `recentDirectories` source.
### 🚶 Walk
* [ ] Add a `tasks` source to `suggestions` which opens the Suggestions UI with
a tree of all `sendInput` commands
* [ ] Enable the `SuggestionsControl` to open with or without a search box
* [ ] Plumb support for shell-driven completions through the core up to the app
* [ ] Expose the _current_ commandline from the `TermControl`
* [ ] Add a `useCommandline` property to `suggestions`, to pre-populate the search with the current commandline.
* [ ] Persist recent commands / directories accordingly
### 🏃‍♂️ Run
* [ ] Add a `description` field to `Command`
* [ ] Add a `TeachingTip` (or similar) to the Suggestions UI to display
descriptions (when available)
* [ ] Use the `ToolTip` property of shell-driven suggestions as the description
* [ ] Add a boolean `nesting` property which can be used to disable nesting on the `tasks` source.
* [ ] Add the ability for `nesting` to accept `enabled`/`disabled` as `true`/`false` equivalents
* [ ] Add the ability for `nesting` to accept `source`, which instead groups all
commands to the Suggestions UI by the source of that suggestion.
### 🚀 Sprint
The two "sprint" tasks here are much more ambitious than the other listed
scenarios, so breaking them down to atomic tasks sees less reasonable. We'd have
to spend a considerable amount more time figuring out _how_ to do each of these
first.
For example - extensions. We have yet to fully realize what extensions _are_.
Determining how extensions will provide suggestions is left as something we'll
need to do as a part of the Extensions spec.
## Conclusion
Here's a sample json schema for the settings discussed here.
```json
"OpenSuggestionsAction": {
"description": "Arguments corresponding to a Open Suggestions Action",
"allOf": [
{
"$ref": "#/$defs/ShortcutAction"
},
{
"properties": {
"action": {
"type": "string",
"const": "suggestions"
},
"source": {
"$ref": "#/$defs/SuggestionSource",
"description": "Which suggestion sources to filter."
},
"useCommandline": {
"default": false,
"description": "When set to `true`, the current commandline the user has typed will pre-populate the filter of the Suggestions UI. This requires that the user has enabled shell integration in their shell's config. When set to false, the filter will start empty."
},
"nesting": {
"default": true,
"description": "When set to `true`, suggestions will follow the provided nesting structure. For Tasks, these will follow the structure of the Command Palette. When set to `false`, no nesting will be used (and all suggestions will be in the top-level menu.",
"$comment": "This setting is a possible follow-up setting, not required for v1. "
}
}
}
]
},
"BuiltinSuggestionSource": {
"enum": [
"commandHistory",
"directoryHistory",
"tasks",
"local",
"all"
],
"type": "string"
},
"SuggestionSource": {
"default": "all",
"description": "Either a single suggestion source, or an array of sources to concatenate. Built-in sources include `commandHistory`, `directoryHistory`, `tasks`, and `local`. Extensions may provide additional values. The special value `all` indicates all suggestion sources should be included",
"$comment": "`tasks` and `local` are sources that would be added by the Tasks feature, as a follow-up"
"oneOf": [
{
"type": [ "string", "null", "BuiltinSuggestionSource" ]
},
{
"type": "array",
"items": { "type": "BuiltinSuggestionSource" }
},
{
"type": "array",
"items": { "type": "string" }
}
]
},
```
### Future Considerations
* Another extension idea: `WithFig.FigCompletions`. Imagine an extension that
could parse existing [Fig] completion specs, and provide those as suggestions
in this way.
* This might be a good example of an async suggestion source. The current
commandline is used as the starting filter, and the suggestions would be
populated by some `fig` process / thread / async operation that returns the
suggestions.
* If the user hasn't enabled shell completion, we could add text to the
`commandHistory` or `directoryHistory` menus to inform the user how they could
go enable shell integration. We already have a docs page dedicated to this, so
we could start by linking to that page. More notes on this in [Automatic shell
integration](#Automatic-shell-integration).
* Maybe there could be a per-profile setting for automatic suggestions after
some timeout. Like, as you type, a menu version of the Suggestions UI appears.
So you could just start typing `git c`, and it would automatically give you a
menu with suggestions, implicitly using the typed command as the "filter".
* Maybe we could do this as an `implicit` property on the `suggestions` action
#### Description Tooltips
> **Note**: _This is left as a future consideration for the initial draft of
> this spec. I'd like to flesh out [shell-driven autocompletion] more before
> committing any plans here._
It would be beneficial for the Suggestions UI to display additional context to
the user. Consider a extension that provides some commands for the user, like a
hypothetical "Docker" extension. The extension author might be able to give the
commands simplified names, but also want to expose a more detailed description
of the commands to the user.
Or consider the Suggestions UI when invoked by [shell-driven autocompletion].
The shell might want to provide help text to the user with each of the
suggestions. This would allow a user to browse through the suggestions that they
might not know about, and learn how they work before committing to one.
Only the help text for the currently hovered command should be presented to the
user. To support this kind of UX, we'll add an optional flyout of some sort to
display with the Suggestions UI. This flyout will only appear if there's more
information provided to the Terminal.
This might be in the form of a `TeachingTip`, as in this example:
![TeachingTip with description](https://user-images.githubusercontent.com/18356694/222244568-243a6482-92d9-4c3c-bffc-54ad97f01f69.gif)
Actions in the settings could also accept an optional `description` property, to
specify the string that would be presented in that flyout.
#### Automatic shell integration
A large portion of these features all rely on shell integration being enabled by
the user. However, this is not a trivial thing for the Terminal to do on behalf
of the user. Shell integration relies on changes to the user's shell config. If
the Terminal were to try and configure those itself, we may accidentally destroy
configuration that the user has already set up. Hence why the Terminal can't
just have a "Light up all the bells and whistles" toggle in the Settings UI.
This is a non-trivial problem to solve, so it is being left as a future
consideration, for a later spec. It deserves its own spec to sort out how we
should expose this to users and safely implement it.
#### Pre-filtering the UI & filter by source
> **Note**: _This is a brainstorm I considered while writing this spec. I would
> not include it in the v1 of this spec. Rather, I'd like to leave it for
> where we might go with this UX in the future._
Do want to support different _types_ of nesting? So instead of just the default,
there could be something like `nesting: "source"`, to create a menu structured
like:
```
Suggestions UI
├─ Recent Commands...
│ ├─ git checkout main
│ ├─ git fetch
│ └─ git pull
├─ Recent Directories...
│ ├─ d:\dev
│ ├─ d:\dev\public
│ └─ d:\dev\public\terminal
├─ Saved tasks...
│ ├─ Git...
│ │ └─ git commit -m "
│ │ └─ git log...
│ └─ bx & runut
└─ Docker
├─ docker build --platform linux/amd64 <path>
└─ docker logs -f --tail <lines_count> <container_name>
```
> **Note**
> I'm using `Docker` as an example fragment extension that provides
> some `docker` commands. When grouping by `"source"`, we could pull those into
> a separate top-level entry. When not grouping by `"source"`, those would still
> show up with the rest of `tasks`. )
#### Store recent commands across sessions
> **Note**
> _I'm not sure we really want to put this in this spec or not, hence
> why it is in the "Future considerations" section. I think it is worth
> mentioning. This might be better served in the [shell integration] doc._
We'll probably want a way for recent commands to be saved across sessions. That way, your `cmd.exe` command history could persist across sessions. We'd need:
* A setting to enable this behavior
* A setting to control the context of these saved commandlines.
* Do we want them saved per-profile, or globally?
* If they're saved per-profile, maybe a profile can opt-in to loading all the commands?
* How does defterm play with this? Do we "layer" by concatenating per-profile commands with `profiles.defaults` ones?
* A button in the Settings UI for clearing these commands
* Should fragments be able to pre-populate "recent commands"?
* I'm just gonna say _no_. That would be a better idea for Tasks (aka just a `sendInput` Action that we load from the fragment normally as a Task), or a specific suggestion source for the fragment extension.
#### Inline mode
> **Note**
> _This is a half-baked idea with some potential. However, I don't
> think it needs to be a part of the v1 of the Suggestions UI, so I'm leaving it
> under future considerations for a future revision._
Do we want to have a suggestions UI "mode", that's just **one** inline
suggestion, "no" UI? Some UX ala the `PsReadline` recent command suggestion
feature. Imagine, we just display the IME ghost text thing for the first result,
given the current prompt?
Take the following action as an example:
```json
{ "command": { "action":"suggestions", "source": "commandHistory", "useCommandline": true, "inline": true } },
```
Type the start of some command at the prompt, and press that key. Presto, we do
the `pwsh` thing. Ghost text appears for the first match in the `commandHistory`
for what the user has typed. If they press another key, ~they've typed into the
"hidden" Suggestions UI, which filters the (hidden) list more, and updates the
one inline suggestion.~
Or, instead, typed keys go to the shell, and then we re-query the commandline,
and update the filter accordingly. That would allow tab-completion to still
work. We'd use <kbd>right arrow</kbd> to accept the suggestion (and dismiss the
ghost text preview).
This would seemingly SUPER conflict with PowerShell's own handler. Probably not
something someone should enable for PowerShell 7 profiles if they're using that
feature.
### Rejected ideas
These are musings from earlier versions of the spec.
* **Asynchronous prompting**: This was rejected because it was so fundamentally
different from the rest of the UX of the Suggestions UI, it didn't make sense
to try and also do that behavior.
* ...
#### REJECTED: Asynchronous prompting
Certain suggestion sources might want to provide results asynchronously.
Consider a source that might want to make a web request to populate what strings
to suggest. That source might want to prompt the user for input first, then
dispatch the request, then populate the UI. Or something like a `fig`-like
suggestion source, which would need to parse some files from the disk to
generate the list of suggestions.
The easiest way to do this would be to provide a secondary UI element for
prompting the user for input, doing the request in the background, then opening
the UI later. However, that feels a little disjointed. Could we instead provide
a more continuous experience?
The following is a proposal for using the Suggestions UI itself as the control
to prompt the user for input.
```c++
TerminalPage::SetUpSuggestionsUI()
{
const auto& asyncSource{ AsyncSuggestions() };
suggestionsUI.OnInputChanged({ asyncSource, AsyncSuggestions::InputChangedHandler});
// In this example, we don't want the UI to filter item based on the input
// string - the source has already determined the list of relevant matches.
suggestionsUI.FilterByInput(false);
asyncSource.SuggestionsChanged([](const auto& newCommands){
suggestionsUI.Loading(false);
suggestionsUI.Commands(newCommands);
})
}
void AsyncSuggestions::InputChangedHandler(FilterChangedArgs args)
{
// kick off a trailing ThrottledFunc to do a new query
_loadNewResults->Run(args.NewInputText());
// If we get another request, we might want to cancel the pending throttled
// func entirely, and start the timeout fresh. Just so that we only make a
// query for the final string they type.
args.RequestLoading(true); // pass a boolean back up in the args, so that
// the Suggestions UI can clear out the current commands, and start displaying an
// indeterminate progress wheel.
}
```
That would basically _have_ to be special cased for this source, at least for
now. We could refactor that later to better deal with extensions.
Let's make sure this would work for something `fig`-like, where the "prompt" is
literally the prompt, what the user has already typed at the commandline.
After some discussion:
* How do we differentiate the prompting version of the Suggestions UI from the
filtering version?
* The prompting version _doesn't_ filter results
* Async modes wouldn't work with sync ones at all. E.g. if you did `source:
["tasks", "myAsyncSource"]`. It doesn't make sense to start with a list of
`tasks`, then type, find no tasks, but then oh! the UI fills in some other
suggestions too. That's weird.
## Resources
These are some other work streams that have a lot of tie-in to the Suggestions
UI. These are all being spec'd at roughly the same time, so links may not be
fully up to date.
* [Shell integration]
* [Shell-driven autocompletion]
* [Tasks]
### Footnotes
<a name="footnote-1"><a>[1]: We've had discussion in the past ([#7285]) about
possibly creating a more abstract "Live filtering list view" to replace the
Command Palette. We could most certainly use that here too. We've decided to
initially go with a fork for now.
<a name="footnote-2"><a>[2]: Obviously, we're not having a real discussion about
extensions in this doc. This example is solely to show that there's room for
extensions to work with the "source" property in this design. What the final
shape of extensions will be is very much still to be determined.
[Fig]: https://github.com/withfig/autocomplete
[Warp]: https://www.warp.dev/
[workflows]: https://docs.warp.dev/features/workflows
[also working on workflows]: https://fig.io/user-manual/workflows
[winget script]: https://github.com/microsoft/PowerToys/blob/main/.github/workflows/package-submissions.yml
[#1595]: https://github.com/microsoft/terminal/issues/1595
[#7039]: https://github.com/microsoft/terminal/issues/7039
[#3121]: https://github.com/microsoft/terminal/issues/3121
[#10436]: https://github.com/microsoft/terminal/issues/10436
[#12927]: https://github.com/microsoft/terminal/issues/12927
[#12863]: https://github.com/microsoft/terminal/issues/12863
[#7285]: https://github.com/microsoft/terminal/issues/7285
[#14939]: https://github.com/microsoft/terminal/issues/7285
[#keep]: https://github.com/zadjii/keep
[VsCode Tasks]: ../../../.vscode/tasks.json
<!-- Note: This is its own spec in progress, but for the time being #12862 will do -->
[Tasks]: https://github.com/microsoft/terminal/issues/12862
<!-- Note: This is just a link to the PR that introduced the shell integration spec -->
[shell integration]: https://github.com/microsoft/terminal/pull/14792
<!-- Note: If I ever write a spec for this, go ahead and replace this link -->
[shell-driven autocompletion]: https://github.com/microsoft/terminal/issues/3121

Binary file not shown.

Before

Width:  |  Height:  |  Size: 965 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 431 KiB

View File

@@ -605,4 +605,4 @@ as well as 3 schemes: "Scheme 1", "Scheme 2", and "Scheme 3".
<!-- Footnotes -->
[Command Palette Spec]: ./%232046%20-%20Command%20Palette.md
[Command Palette Spec]: https://github.com/microsoft/terminal/blob/main/doc/specs/%232046%20-%20Command%20Palette.md

View File

@@ -612,8 +612,8 @@ You could have a profile that layers on an existing profile, with elevated-speci
[#8514]: https://github.com/microsoft/terminal/issues/8514
[#10276]: https://github.com/microsoft/terminal/issues/10276
[Process Model 2.0 Spec]: ../%235000%20-%20Process%20Model%202.0.md
[Configuration object for profiles]: ../%233062%20-%20Appearance configuration object for profiles.md
[Session Management Spec]: ./%234472%20-%20Windows%20Terminal%20Session%20Management.md
[Process Model 2.0 Spec]: https://github.com/microsoft/terminal/blob/main/doc/specs/%235000%20-%20Process%20Model%202.0.md
[Configuration object for profiles]: https://github.com/microsoft/terminal/blob/main/doc/specs/Configuration%20object%20for%20profiles.md
[Session Management Spec]: https://github.com/microsoft/terminal/blob/main/doc/specs/%234472%20-%20Windows%20Terminal%20Session%20Management.md
[The Old New Thing: How can I launch an unelevated process from my elevated process, redux]: https://devblogs.microsoft.com/oldnewthing/20190425-00/?p=102443
[Workspace Trust]: https://code.visualstudio.com/docs/editor/workspace-trust

View File

@@ -559,4 +559,4 @@ runtime.
[Tab Tear-out in the community toolkit]: https://github.com/windows-toolkit/Sample-TabView-TearOff
[Quake mode scenarios]: https://github.com/microsoft/terminal/issues/653#issuecomment-661370107
[`ISwapChainPanelNative2::SetSwapChainHandle`]: https://docs.microsoft.com/en-us/windows/win32/api/windows.ui.xaml.media.dxinterop/nf-windows-ui-xaml-media-dxinterop-iswapchainpanelnative2-setswapchainhandle
[Process Model 2.0 Spec]: ./doc/specs/%235000%20-%20Process%20Model%202.0/%235000%20-%20Process%20Model%202.0.md
[Process Model 2.0 Spec]: https://github.com/microsoft/terminal/blob/main/doc/specs/%235000%20-%20Process%20Model%202.0/%235000%20-%20Process%20Model%202.0.md

View File

@@ -730,7 +730,7 @@ user to differentiate between the two behaviors.
[#5727]: https://github.com/microsoft/terminal/issues/5727
[#9992]: https://github.com/microsoft/terminal/issues/9992
[Process Model 2.0 Spec]: ../%235000%20-%20Process%20Model%202.0/%235000%20-%20Process%20Model%202.0.md
[Process Model 2.0 Spec]: https://github.com/microsoft/terminal/blob/main/doc/specs/%235000%20-%20Process%20Model%202.0/%235000%20-%20Process%20Model%202.0.md
[Quake 3 sample]: https://youtu.be/ZmR6HQbuHPA?t=27
[`RegisterHotKey`]: https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-registerhotkey
[`dev/migrie/f/653-QUAKE-MODE`]: https://github.com/microsoft/terminal/tree/dev/migrie/f/653-QUAKE-MODE

View File

@@ -23,7 +23,7 @@ contexts without needing to replicate an entire json blob.
This spec was largely inspired by the following diagram from @DHowett:
![figure 1](data-mockup-002.png)
![figure 1](data-mockup.png)
The goal is to introduce an `id` parameter by which actions could be uniquely
referred to. If we'd ever like to use an action outside the list of `actions`, we
@@ -36,54 +36,38 @@ Discussion with the team lead to the understanding that the name `actions` would
be even better, as a way of making the meaning of the "list of actions" more
obvious.
We will then restructure `defaults.json`, and also users' settings files (via `fixUpUserSettings`), in the following manner:
* Instead of each `command` json block containing both the `action` (along with additional arguments) and the `keys`, these will now be split up -
* There will now be one json block for just the `command`/`action`, which will also contain the `id`. These json blocks will be in their own list called `actions`.
* There will be another json block for the `keys`, which will refer to the action to be invoked by `id`. These json blocks will be in their own list called `keybindings`.
For example, let's take a look at the `split pane right` action in `defaults.json` as we currently have it:
`"actions": [..., { "command": { "action": "splitPane", "split": "right" }, "keys": "alt+shift+plus" }, ...]`
This will now become:
`"actions": [..., { "command": { "action": "splitPane", "split": "right" }, "id": "Terminal.SplitPaneRight" }, ...]`
`"keybindings": [..., { "keys": "alt+shift+plus", "id": "Terminal.SplitPaneRight" }, ...]`
Here is how we will parse settings file and construct the relevant settings model objects:
* We will first scan the `actions` list. We'll
When we're parsing `actions`, we'll make three passes:
* The first pass will scan the list for objects with an `id` property. We'll
attempt to parse those entries into `ActionAndArgs` which we'll store in the
global `id->ActionAndArgs` map. All actions defined in `defaults.json` must have an `id` specified, and all actions provided by fragments must also have `id`s. Any actions from the defaults or fragments that do not provide `id`s will be ignored. As for user-specified commands, if no `id` is set, we will auto-generate one for that command based on the action and any additional arguments. For example, the `split pane right` command above might result in an autogenerated id `User.SplitPaneRight`.
* Note: this step is also where we will generate _commands_. We will use the name provided in the entry if it's set or the action's `GenerateName` method.
* Next we will scan the `keybindings` list. These entries will
create a `KeyChord->ActionAndArgs` entry in the keybindings map. Since these objects should all contain an `id`, we will simply use the `id->ActionAndArgs` map we created in the previous step. Any object with `keys` set but no `id` will be ignored.
global `id->ActionAndArgs` map. If any entry doesn't have an `id` set, we'll
skip it in this phase. If an entry doesn't have a `command` set, we'll ignore
it in this pass.
* The second pass will scan for _keybindings_. Any entries with `keys` set will
create a `KeyChord->ActionAndArgs` entry in the keybindings map. If the entry
has an `id` set, then we'll simply re-use the action we've already parsed for
the `id`, from the action map. If there isn't an `id`, then we'll parse the
action manually at this time. Entries without a `keys` set will be ignored in
this pass.
* The final pass will be to generate _commands_. Similar to the keybindings
pass, we'll attempt to lookup actions for entries with an `id` set. If there
isn't an `id`, then we'll parse the action manually at this time. We'll then
get the name for the entry, either from the `name` property if it's set, or
the action's `GenerateName` method.
For a visual representation:
For a visual representation, let's assume the user has the following in their
`actions`:
![figure 2](data-mockup-actions-ids-keys-maps.png)
![figure 2](data-mockup-actions.png)
### Nested actions
We'll first parse the `actions` to generate the mapping of `id`->`Actions`:
We allow certain actions that take a form like this:
![figure 3](data-mockup-actions-and-ids.png)
```
{
// Select color scheme...
"name": { "key": "SetColorSchemeParentCommandName" },
"commands": [
{
"iterateOn": "schemes",
"name": "${scheme.name}",
"command": { "action": "setColorScheme", "colorScheme": "${scheme.name}" }
}
]
}
```
Then, we'll parse the `actions` to generate the mapping of keys to actions, with
some actions already being defined in the map of `id`->`Actions`:
For this case, having an `id` on the top level could potentially make sense when it comes to using that `id` in a menu, but not in the case of using that `id` for a keybinding. For the initial implementation, we will not support an `id` for these types of actions, which leaves us open to revisiting this in the future.
![figure 4](data-mockup-actions-and-ids-and-keys.png)
### Layering
When layering `actions`, if a later settings file contains an action with the
same `id`, it will replace the current value. In this way, users can redefine
@@ -103,9 +87,6 @@ As we add additional menus to the Terminal, like the customization for the new
tab dropdown, or the tab context menu, or the `TermControl` context menu, they
could all refer to these actions by `id`, rather than duplicating the same json.
As for fragments, all actions in fragments _must_ have an `id`. If a fragment provides an action without an `id`, or provides an `id` that clashes with one of the actions in `defaults.json`, that action will be ignored.
> 👉 NOTE: This will mean that actions will now need an `OriginTag`, similar to profiles and color schemes
### Existing Scenarios
@@ -234,8 +215,8 @@ actions manually.
the tab context menu or the control context menu.
<!-- Footnotes -->
[Command Palette Spec]: ./doc/specs/%232046%20-%20Command%20Palette.md
[New Tab Menu Customization Spec]: ./doc/specs/%231571%20-%20New%20Tab%20Menu%20Customization.md
[Command Palette Spec]: https://github.com/microsoft/terminal/blob/main/doc/specs/%232046%20-%20Command%20Palette.md
[New Tab Menu Customization Spec]: https://github.com/microsoft/terminal/blob/main/doc/specs/%231571%20-%20New%20Tab%20Menu%20Customization.md
[#1571]: https://github.com/microsoft/terminal/issues/1571
[#1912]: https://github.com/microsoft/terminal/issues/1912

Binary file not shown.

Before

Width:  |  Height:  |  Size: 172 KiB

View File

@@ -1,396 +0,0 @@
---
author: Dustin Howett @DHowett <duhowett@microsoft.com>
created on: 2020-08-16
last updated: 2023-12-12
issue id: "#7335"
---
# Console Allocation Policy
## Abstract
Due to the design of the console subsystem on Windows as it has existed since Windows 95, every application that is
stamped with the `IMAGE_SUBSYSTEM_WINDOWS_CUI` subsystem in its PE header will be allocated a console by kernel32.
Any application that is stamped `IMAGE_SUBSYSTEM_WINDOWS_GUI` will not automatically be allocated a console.
This has worked fine for many years: when you double-click a console application in your GUI shell, it is allocated a
console. When you run a GUI application from your console shell, it is **not** allocated a console. The shell will
**not** wait for it to exit before returning you to a prompt.
There is a large class of applications that do not fit neatly into this mold. Take Python, Ruby, Perl, Lua, or even
VBScript: These languages are not relegated to running in a console session; they can be used to write fully-fledged GUI
applications like any other language.
Because their interpreters are console subsystem applications, however, any user double-clicking a shortcut to a Python
or Perl application will be presented with a console window that the language runtime may choose to garbage collect, or
may choose not to.
If the runtime chooses to hide the window, there will still be a brief period during which that window is visible. It is
inescapable.
Likewise, any user running that GUI application from a console shell will see their shell hang until the application
terminates.
All of these scripting languages worked around this by shipping two binaries each, identical in every way expect in
their subsystem fields. python/pythonw, perl/perlw, ruby/rubyw, wscript/cscript.
PowerShell[^1] is waiting to deal with this problem because they don't necessarily want to ship a `pwshw.exe` for all
of their GUI-only authors. Every additional `*w` version of an application is an additional maintenance burden and
source of cognitive overhead[^2] for users.
On the other side, you have mostly-GUI applications that want to print output to a console **if there is one
connected**.
These applications are still primarily GUI-driven, but they might support arguments like `/?` or `--help`. They only
need a console when they need to print out some text. Sometimes they'll allocate their own console (which opens a new
window) to display in, and sometimes they'll reattach to the originating console. VSCode does the latter, and so when
you run `code` from CMD, and then `exit` CMD, your console window sticks around because VSCode is still attached to it.
It will never print anything, and your only option is to close it.
There's another risk in reattaching, too. Given that the shell decides whether to wait based on the subsystem
field, GUI subsystem applications that reattach to their owning consoles *just to print some text* end up stomping on
the output of any shell that doesn't wait for them:
```
C:\> application --help
application - the interesting application
C:\> Usage: application [OPTIONS] ...
```
> _(the prompt is interleaved with the output)_
## Solution Design
I propose that we introduce a fusion manifest field, **consoleAllocationPolicy**, with the following values:
* _absent_
* `detached`
This field allows an application to disable the automatic allocation of a console, regardless of the [process creation flags]
passed to [`CreateProcess`] and its subsystem value.
It would look (roughly) like this:
```xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<application>
<windowsSettings>
<consoleAllocationPolicy xmlns="http://schemas.microsoft.com/SMI/2024/WindowsSettings">detached</consoleAllocationPolicy>
</windowsSettings>
</application>
</assembly>
```
The effects of this field will only apply to binaries in the `IMAGE_SUBSYSTEM_WINDOWS_CUI` subsystem, as it pertains to
the particulars of their console allocation.
**All console inheritance will proceed as normal.** Since this field takes effect only in the absence of console
inheritance, CUI applications will still be able to run inside an existing console session.
| policy | behavior |
| - | - |
| _absent_ | _default behavior_ |
| `detached` | The new process is not attached to a console session (similar to `DETACHED_PROCESS`) unless one was inherited. |
An application that specifies the `detached` allocation policy will _not_ present a console window when launched by
Explorer, Task Scheduler, etc.
### Interaction with existing APIs
[`CreateProcess`] supports a number of [process creation flags] that dictate how a spawned application will behave with
regards to console allocation:
* `DETACHED_PROCESS`: No console inheritance, no console host spawned for the new process.
* `CREATE_NEW_CONSOLE`: No console inheritance, new console host **is** spawned for the new process.
* `CREATE_NO_WINDOW`: No console inheritance, new console host **is** spawned for the new process.
* this is the same as `CREATE_NEW_CONSOLE`, except that the first connection packet specifies that the window should
be invisible
Due to the design of [`CreateProcess`] and `ShellExecute`, this specification recommends that an allocation policy of
`detached` _override_ the inclusion of `CREATE_NEW_CONSOLE` in the `dwFlags` parameter to [`CreateProcess`].
> **Note**
> `ShellExecute` passes `CREATE_NEW_CONSOLE` _by default_ on all invocations. This impacts our ability to resolve the
> conflicts between these two APIs--`detached` policy and `CREATE_NEW_CONSOLE`--without auditing every call site in
> every Windows application that calls `ShellExecute` on a console application. Doing so is infeasible.
### Application impact
An application that opts into the `detached` console allocation policy will **not** be allocated a console unless one is
inherited. This presents an issue for applications like PowerShell that do want a console window when they are launched
directly.
Applications in this category can call `AllocConsole()` early in their startup to get fine-grained control over when a
console is presented.
The call to `AllocConsole()` will fail safely if the application has already inherited a console handle. It will succeed
if the application does not currently have a console handle.
> **Note**
> **Backwards Compatibility**: The behavior of `AllocConsole()` is not changing in response to this specification;
> therefore, applications that intend to run on older versions of Windows that do not support console allocation
> policies, which call `AllocConsole()`, will continue to behave normally.
### New APIs
Because a console-subsystem application may still want fine-grained control over when and how its console window is
spawned, we propose the inclusion of a new API, `AllocConsoleWithOptions(PALLOC_CONSOLE_OPTIONS)`.
#### `AllocConsoleWithOptions`
```c++
// Console Allocation Modes
typedef enum ALLOC_CONSOLE_MODE {
ALLOC_CONSOLE_MODE_DEFAULT = 0,
ALLOC_CONSOLE_MODE_NEW_WINDOW = 1,
ALLOC_CONSOLE_MODE_NO_WINDOW = 2
} ALLOC_CONSOLE_MODE;
typedef enum ALLOC_CONSOLE_RESULT {
ALLOC_CONSOLE_RESULT_NO_CONSOLE = 0,
ALLOC_CONSOLE_RESULT_NEW_CONSOLE = 1,
ALLOC_CONSOLE_RESULT_EXISTING_CONSOLE = 2
} ALLOC_CONSOLE_RESULT, *PALLOC_CONSOLE_RESULT;
typedef
struct ALLOC_CONSOLE_OPTIONS
{
ALLOC_CONSOLE_MODE mode;
BOOL useShowWindow;
WORD showWindow;
} ALLOC_CONSOLE_OPTIONS, *PALLOC_CONSOLE_OPTIONS;
WINBASEAPI
HRESULT
WINAPI
AllocConsoleWithOptions(_In_opt_ PALLOC_CONSOLE_OPTIONS allocOptions, _Out_opt_ PALLOC_CONSOLE_RESULT result);
```
**AllocConsoleWithOptions** affords an application control over how and when it begins a console session.
> [!NOTE]
> Unlike `AllocConsole`, `AllocConsoleWithOptions` without a mode (`ALLOC_CONSOLE_MODE_DEFAULT`) will only allocate a console if one was
> requested during `CreateProcess`.
>
> To override this behavior, pass one of `ALLOC_CONSOLE_MODE_NEW_WINDOW` (which is equivalent to being spawned with
> `CREATE_NEW_WINDOW`) or `ALLOC_CONSOLE_MODE_NO_WINDOW` (which is equivalent to being spawned with `CREATE_NO_CONSOLE`.)
##### Parameters
**allocOptions**: A pointer to a `ALLOC_CONSOLE_OPTIONS`.
**result**: An optional out pointer, which will be populated with a member of the `ALLOC_CONSOLE_RESULT` enum.
##### `ALLOC_CONSOLE_OPTIONS`
###### Members
**mode**: See the table below for the descriptions of the available modes.
**useShowWindow**: Specifies whether the value in `showWindow` should be used.
**showWindow**: If `useShowWindow` is set, specifies the ["show command"] used to display your
console window.
###### Return Value
`AllocConsoleWithOptions` will return `S_OK` and populate `result` to indicate whether--and how--a console session was
created.
`AllocConsoleWithOptions` will return a failing `HRESULT` if the request could not be completed.
###### Modes
| Mode | Description |
|:-------------------------------:| ------------------------------------------------------------------------------------------------------------------------------ |
| `ALLOC_CONSOLE_MODE_DEFAULT` | Allocate a console session if (and how) one was requested by the parent process. |
| `ALLOC_CONSOLE_MODE_NEW_WINDOW` | Allocate a console session with a window, even if this process was created with `CREATE_NO_CONSOLE` or `DETACHED_PROCESS`. |
| `ALLOC_CONSOLE_MODE_NO_WINDOW` | Allocate a console session _without_ a window, even if this process was created with `CREATE_NEW_WINDOW` or `DETACHED_PROCESS` |
###### Notes
Applications seeking backwards compatibility are encouraged to delay-load `AllocConsoleWithOptions` or check for its presence in
the `api-ms-win-core-console-l1` APISet.
## Inspiration
Fusion manifest entries are used to make application-scoped decisions like this all the time, like `longPathAware` and
`heapType`.
CUI applications that can spawn a UI (or GUI applications that can print to a console) are commonplace on other
platforms because there is no subsystem differentiation.
## UI/UX Design
There is no UI for this feature.
## Capabilities
### Accessibility
This should have no impact on accessibility.
### Security
One reviewer brought up the potential for a malicious actor to spawn an endless stream of headless daemon processes.
This proposal in no way changes the facilities available to malicious people for causing harm: they could have simply
used `IMAGE_SUBSYSTEM_WINDOWS_GUI` and not presented a UI--an option that has been available to them for 35 years.
### Reliability
This should have no impact on reliability.
### Compatibility
An existing application opting into **detached** may constitute a breaking change, but the scope of the breakage is
restricted to that application and is expected to be managed by the application.
All behavioral changes are opt-in.
> **EXAMPLE**: If Python updates python.exe to specify an allocation policy of **detached**, graphical python applications
> will become double-click runnable from the graphical shell without spawning a console window. _However_, console-based
> python applications will no longer spawn a console window when double-clicked from the graphical shell.
>
> In addition, if python.exe specifies **detached**, Console APIs will fail until a console is allocated.
Python could work around this by calling [`AllocConsole`] or [new API `AllocConsoleWithOptions`](#allocconsolewithoptions)
if it can be detected that console I/O is required.
#### Downlevel
On downlevel versions of Windows that do not understand (or expect) this manifest field, applications will allocate
consoles as specified by their image subsystem (described in the [abstract](#abstract) above).
### Performance, Power, and Efficiency
This should have no impact on performance, power or efficiency.
## Potential Issues
### Shell Hang
I am **not** proposing a change in how shells determine whether to wait for an application before returning to a prompt.
This means that a console subsystem application that intends to primarily present a UI but occasionally print text to a
console (therefore choosing the **detached** allocation policy) will cause the shell to "hang" and wait for it to
exit.
The decision to pause/wait is made entirely in the calling shell, and the console subsystem cannot influence that
decision.
Because the vast majority of shells on Windows "hang" by calling `WaitFor...Object` with a HANDLE to the spawned
process, an application that wants to be a "hybrid" CUI/GUI application will be forced to spawn a separate process to
detach from the shell and then terminate its main process.
This is very similar to the forking model seen in many POSIX-compliant operating systems.
### Launching interactively from Explorer, Task Scheduler, etc.
Applications like PowerShell may wish to retain automatic console allocation, and **detached** would be unsuitable for
them. If PowerShell specifies the `detached` console allocation policy, launching `pwsh.exe` from File Explorer it will
no longer spawn a console. This would almost certainly break PowerShell for all users.
Such applications can use `AllocConsole()` early in their startup.
At the same time, PowerShell wants `-WindowStyle Hidden` to suppress the console _before it's created_.
Applications in this category can use `AllocConsoleWithOptions()` to specify additional information about the new console window.
PowerShell, and any other shell that wishes to maintain interactive launch from the graphical shell, can start in
**detached** mode and then allocate a console as necessary. Therefore:
* PowerShell will set `<consoleAllocationPolicy>detached</consoleAllocationPolicy>`
* On startup, it will process its commandline arguments.
* If `-WindowStyle Hidden` is **not** present (the default case), it can:
* `AllocConsole()` or `AllocConsoleWithOptions(NULL)`
* Either of these APIs will present a console window (or not) based on the flags passed through `STARTUPINFO` during
[`CreateProcess`].
* If `-WindowStyle Hidden` is present, it can:
* `AllocConsoleWithOptions(&alloc)` where `alloc.mode` specifies `ALLOC_CONSOLE_MODE_HIDDEN`
## Future considerations
We're introducing a new manifest field today -- what if we want to introduce more? Should we have a `consoleSettings`
manifest block?
Are there other allocation policies we need to consider?
## Resources
### Rejected Solutions
- A new PE subsystem, `IMAGE_SUBSYSTEM_WINDOWS_HYBRID`
- it would behave like **inheritOnly**
- relies on shells to update and check for this
- checking a subsystem doesn't work right with app execution aliases[^3]
- This is not a new problem, but it digs the hole a little deeper.
- requires standardization outside of Microsoft because the PE format is a dependency of the UEFI specification[^4]
- requires coordination between tooling teams both within and without Microsoft (regarding any tool that operates on
or produces PE files)
- An exported symbol that shells can check for to determine whether to wait for the attached process to exit
- relies on shells to update and check for this
- cracking an executable to look for symbols is probably the last thing shells want to do
- we could provide an API to determine whether to wait or return?
- fragile, somewhat silly, exporting symbols from EXEs is annoying and uncommon
An earlier version of this specification offered the **always** allocation policy, with the following behaviors:
> **STRUCK FROM SPECIFICATION**
>
> * A GUI subsystem application would always get a console window.
> * A command-line shell would not wait for it to exit before returning a prompt.
It was cut because a GUI application that wants a console window can simply attach to an existing console session or
allocate a new one. We found no compelling use case that would require the forced allocation of a console session
outside of the application's code.
An earlier version of this specification offered the **inheritOnly** allocation policy, instead of the finer-grained
**hidden** and **detached** policies. We deemed it insufficient for PowerShell's use case because any application
launched by an **inheritOnly** PowerShell would immediately force the uncontrolled allocation of a console window.
> **STRUCK FROM SPECIFICATION**
>
> The move to **hidden** allows PowerShell to offer a fully-fledged console connection that can be itself inherited by a
> downstream application.
#### Additional allocation policies
An earlier revision of this specification suggested two allocation policies:
> **STRUCK FROM SPECIFICATION**
>
> **hidden** is intended to be used by console applications that want finer-grained control over the visibility of their
> console windows, but that still need a console host to service console APIs. This includes most scripting language
> interpreters.
>
> **detached** is intended to be used by primarily graphical applications that would like to operate against a console _if
> one is present_ but do not mind its absence. This includes any graphical tool with a `--help` or `/?` argument.
The `hidden` policy was rejected due to an incompatibility with modern console hosting, as `hidden` would require an
application to interact with the console window via `GetConsoleWindow()` and explicitly show it.
> **STRUCK FROM SPECIFICATION**
>
> ##### ShowWindow and ConPTY
>
> The pseudoconsole creates a hidden window to service `GetConsoleWindow()`, and it can be trivially shown using
> `ShowWindow`. If we recommend that applications `ShowWindow` on startup, we will need to guard the pseudoconsole's
> pseudo-window from being shown.
[^1]: [Powershell -WindowStyle Hidden still shows a window briefly]
[^2]: [StackOverflow: pythonw.exe or python.exe?]
[^3]: [PowerShell: Windows Store applications incorrectly assumed to be console applications]
[^4]: [UEFI spec 2.6 appendix Q.1]
[Powershell -WindowStyle Hidden still shows a window briefly]: https://github.com/PowerShell/PowerShell/issues/3028
[PowerShell: Windows Store applications incorrectly assumed to be console applications]: https://github.com/PowerShell/PowerShell/issues/9970
[StackOverflow: pythonw.exe or python.exe?]: https://stackoverflow.com/questions/9705982/pythonw-exe-or-python-exe
[UEFI spec 2.6 appendix Q.1]: https://www.uefi.org/sites/default/files/resources/UEFI%20Spec%202_6.pdf
[`AllocConsole`]: https://docs.microsoft.com/windows/console/allocconsole
[`CreateProcess`]: https://docs.microsoft.com/windows/win32/api/processthreadsapi/nf-processthreadsapi-createprocessw
[process creation flags]: https://docs.microsoft.com/en-us/windows/win32/procthread/process-creation-flags
["show command"]: https://learn.microsoft.com/windows/win32/api/winuser/nf-winuser-showwindow

View File

@@ -290,7 +290,7 @@ though. **I recommend we ignore this for now, and leave this as a follow-up**.
For reference, refer to the following from iTerm2:
![image](https://user-images.githubusercontent.com/2578976/64075757-fa971980-ccee-11e9-9e44-47aaf3bca76c.png)
We don't have a menu bar like on macOS, but we do have a tab context menu. We
We don't have a menu bar like on MacOS, but we do have a tab context menu. We
could add these items as a nested entry under each tab. If we wanted to do this,
we should also make sure to dynamically change the icon of the MenuItem to
reflect the current broadcast state.

View File

@@ -373,7 +373,7 @@ changes, or the active pane in a tab changes:
`TabRowControl` to match.
The `tab.cornerRadius` might be a bit trickier to implement. Currently, there's
no XAML resource that controls this, nor is this something that's exposed by
not a XAML resource that controls this, nor is this something that's exposed by
the TabView control. Fortunately, this is something that's exposed to us
programmatically. We'll need to manually set that value on each `TabViewItem` as
we create new tabs. When we reload settings, we'll need to make sure to come

View File

@@ -142,4 +142,4 @@ Feature Notes:
[#4472]: https://github.com/microsoft/terminal/issues/4472
[#8048]: https://github.com/microsoft/terminal/pull/8048
[Terminal 2022 Roadmap]: ./roadmap-2022.md
[Terminal 2022 Roadmap]: https://github.com/microsoft/terminal/tree/main/doc/roadmap-2022.md

View File

@@ -95,7 +95,7 @@
#define HAVE_AVX512
#endif
#if defined(X86_OR_X64) && !defined(_M_ARM64EC)
#if defined(X86_OR_X64)
/* MSVC compatible compilers (Windows) */
#if defined(_MSC_VER)
/* clang-cl (LLVM 10 from 2020) requires /arch:AVX2 or

View File

@@ -1,407 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="48"
height="48"
viewBox="0 0 48 48"
fill="none"
version="1.1"
id="svg284"
sodipodi:docname="Terminal_Can_Pill.svg"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)">
<metadata
id="metadata288">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="922"
inkscape:window-height="816"
id="namedview286"
showgrid="false"
inkscape:zoom="8.8541667"
inkscape:cx="-17.429862"
inkscape:cy="31.710582"
inkscape:window-x="3142"
inkscape:window-y="60"
inkscape:window-maximized="0"
inkscape:current-layer="svg284" />
<g
id="g4007"
transform="matrix(0.9375,0,0,0.9375,0,1.5)">
<path
id="path150"
d="M 0,13 H 16 V 6 H 2 C 0.9,6 0,6.9 0,8 Z"
inkscape:connector-curvature="0"
style="fill:#cccccc" />
<path
id="path152"
d="M 32,6 H 16 v 7 h 16 z"
inkscape:connector-curvature="0"
style="fill:#999999" />
<path
id="path154"
d="M 48,13 H 32 V 6 h 14 c 1.1,0 2,0.9 2,2 z"
inkscape:connector-curvature="0"
style="fill:#666666" />
<path
id="path156"
d="M 46,42 H 2 C 0.9,42 0,41.1 0,40 V 12 h 48 v 28 c 0,1.1 -0.9,2 -2,2 z"
style="fill:url(#paint0_linear)"
inkscape:connector-curvature="0" />
<g
id="g171"
style="filter:url(#filter0_dd)">
<path
id="path158"
d="m 15.2,24.3 -8.80001,8.8 c -0.5,0.5 -0.5,1.2 0,1.6 l 1.8,1.8 C 8.69999,37 9.4,37 9.8,36.5 l 8.8,-8.8 c 0.5,-0.5 0.5,-1.2 0,-1.6 l -1.8,-1.8 c -0.4,-0.4 -1.2,-0.4 -1.6,0 z"
style="fill:url(#paint1_linear)"
inkscape:connector-curvature="0" />
<mask
height="13"
width="13"
y="24"
x="6"
maskUnits="userSpaceOnUse"
mask-type="alpha"
id="mask0">
<path
id="path160"
d="m 15.2,24.3 -8.80001,8.8 c -0.5,0.5 -0.5,1.2 0,1.6 l 1.8,1.8 C 8.69999,37 9.4,37 9.8,36.5 l 8.8,-8.8 c 0.5,-0.5 0.5,-1.2 0,-1.6 l -1.8,-1.8 c -0.4,-0.4 -1.2,-0.4 -1.6,0 z"
inkscape:connector-curvature="0"
style="fill:url(#paint2_linear)" />
</mask>
<g
id="g167"
mask="url(#mask0)">
<g
id="g165"
style="filter:url(#filter1_dd)">
<path
id="path163"
d="m 9.8,17.3 8.8,8.8 c 0.5,0.5 0.5,1.2 0,1.6 l -1.8,1.8 c -0.5,0.5 -1.2,0.5 -1.6,0 L 6.39999,20.7 c -0.5,-0.5 -0.5,-1.2 0,-1.6 l 1.8,-1.8 C 8.59999,16.9 9.4,16.9 9.8,17.3 Z"
style="fill:url(#paint3_linear)"
inkscape:connector-curvature="0" />
</g>
</g>
<path
id="path169"
d="m 9.8,17.3 8.8,8.8 c 0.5,0.5 0.5,1.2 0,1.6 l -1.8,1.8 c -0.5,0.5 -1.2,0.5 -1.6,0 L 6.39999,20.7 c -0.5,-0.5 -0.5,-1.2 0,-1.6 l 1.8,-1.8 C 8.59999,16.9 9.4,16.9 9.8,17.3 Z"
style="fill:url(#paint4_linear)"
inkscape:connector-curvature="0" />
</g>
<g
id="g175"
style="filter:url(#filter2_dd)">
<path
id="path173"
d="M 40,32 H 24 c -0.6,0 -1,0.4 -1,1 v 3 c 0,0.6 0.4,1 1,1 h 16 c 0.6,0 1,-0.4 1,-1 v -3 c 0,-0.6 -0.4,-1 -1,-1 z"
style="fill:url(#paint5_linear)"
inkscape:connector-curvature="0" />
</g>
</g>
<defs
id="defs282">
<filter
id="filter0_dd"
x="3.02499"
y="15"
width="18.95"
height="25.875"
filterUnits="userSpaceOnUse"
color-interpolation-filters="sRGB">
<feFlood
flood-opacity="0"
result="BackgroundImageFix"
id="feFlood177" />
<feColorMatrix
in="SourceAlpha"
type="matrix"
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
id="feColorMatrix179" />
<feOffset
dy="0.5"
id="feOffset181" />
<feGaussianBlur
stdDeviation="0.5"
id="feGaussianBlur183" />
<feColorMatrix
type="matrix"
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0"
id="feColorMatrix185" />
<feBlend
mode="normal"
in2="BackgroundImageFix"
result="effect1_dropShadow"
id="feBlend187" />
<feColorMatrix
in="SourceAlpha"
type="matrix"
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
id="feColorMatrix189" />
<feOffset
dy="1"
id="feOffset191" />
<feGaussianBlur
stdDeviation="1.5"
id="feGaussianBlur193" />
<feColorMatrix
type="matrix"
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0"
id="feColorMatrix195" />
<feBlend
mode="normal"
in2="effect1_dropShadow"
result="effect2_dropShadow"
id="feBlend197" />
<feBlend
mode="normal"
in="SourceGraphic"
in2="effect2_dropShadow"
result="shape"
id="feBlend199" />
</filter>
<filter
id="filter1_dd"
x="3.02499"
y="15"
width="18.95"
height="18.875"
filterUnits="userSpaceOnUse"
color-interpolation-filters="sRGB">
<feFlood
flood-opacity="0"
result="BackgroundImageFix"
id="feFlood202" />
<feColorMatrix
in="SourceAlpha"
type="matrix"
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
id="feColorMatrix204" />
<feOffset
dy="0.5"
id="feOffset206" />
<feGaussianBlur
stdDeviation="0.5"
id="feGaussianBlur208" />
<feColorMatrix
type="matrix"
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0"
id="feColorMatrix210" />
<feBlend
mode="normal"
in2="BackgroundImageFix"
result="effect1_dropShadow"
id="feBlend212" />
<feColorMatrix
in="SourceAlpha"
type="matrix"
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
id="feColorMatrix214" />
<feOffset
dy="1"
id="feOffset216" />
<feGaussianBlur
stdDeviation="1.5"
id="feGaussianBlur218" />
<feColorMatrix
type="matrix"
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0"
id="feColorMatrix220" />
<feBlend
mode="normal"
in2="effect1_dropShadow"
result="effect2_dropShadow"
id="feBlend222" />
<feBlend
mode="normal"
in="SourceGraphic"
in2="effect2_dropShadow"
result="shape"
id="feBlend224" />
</filter>
<filter
id="filter2_dd"
x="20"
y="30"
width="24"
height="11"
filterUnits="userSpaceOnUse"
color-interpolation-filters="sRGB">
<feFlood
flood-opacity="0"
result="BackgroundImageFix"
id="feFlood227" />
<feColorMatrix
in="SourceAlpha"
type="matrix"
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
id="feColorMatrix229" />
<feOffset
dy="0.5"
id="feOffset231" />
<feGaussianBlur
stdDeviation="0.5"
id="feGaussianBlur233" />
<feColorMatrix
type="matrix"
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0"
id="feColorMatrix235" />
<feBlend
mode="normal"
in2="BackgroundImageFix"
result="effect1_dropShadow"
id="feBlend237" />
<feColorMatrix
in="SourceAlpha"
type="matrix"
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
id="feColorMatrix239" />
<feOffset
dy="1"
id="feOffset241" />
<feGaussianBlur
stdDeviation="1.5"
id="feGaussianBlur243" />
<feColorMatrix
type="matrix"
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0"
id="feColorMatrix245" />
<feBlend
mode="normal"
in2="effect1_dropShadow"
result="effect2_dropShadow"
id="feBlend247" />
<feBlend
mode="normal"
in="SourceGraphic"
in2="effect2_dropShadow"
result="shape"
id="feBlend249" />
</filter>
<linearGradient
id="paint0_linear"
x1="36.4462"
y1="47.8257"
x2="11.8217"
y2="5.1748"
gradientUnits="userSpaceOnUse">
<stop
stop-color="#333333"
id="stop252" />
<stop
offset="1"
stop-color="#4D4D4D"
id="stop254" />
</linearGradient>
<linearGradient
id="paint1_linear"
x1="14.5276"
y1="33.9959"
x2="10.4841"
y2="26.9924"
gradientUnits="userSpaceOnUse">
<stop
stop-color="#999999"
id="stop257" />
<stop
offset="1"
stop-color="#B3B3B3"
id="stop259" />
</linearGradient>
<linearGradient
id="paint2_linear"
x1="14.5276"
y1="33.9959"
x2="10.4841"
y2="26.9924"
gradientUnits="userSpaceOnUse">
<stop
stop-color="#999999"
id="stop262" />
<stop
offset="1"
stop-color="#B3B3B3"
id="stop264" />
</linearGradient>
<linearGradient
id="paint3_linear"
x1="16.2747"
y1="30.0336"
x2="8.73699"
y2="16.9781"
gradientUnits="userSpaceOnUse">
<stop
stop-color="#CCCCCC"
id="stop267" />
<stop
offset="1"
stop-color="#E6E6E6"
id="stop269" />
</linearGradient>
<linearGradient
id="paint4_linear"
x1="16.2747"
y1="30.0336"
x2="8.73699"
y2="16.9781"
gradientUnits="userSpaceOnUse">
<stop
stop-color="#CCCCCC"
id="stop272" />
<stop
offset="1"
stop-color="#E6E6E6"
id="stop274" />
</linearGradient>
<linearGradient
id="paint5_linear"
x1="35.1496"
y1="39.9553"
x2="28.8504"
y2="29.0447"
gradientUnits="userSpaceOnUse">
<stop
stop-color="#CCCCCC"
id="stop277" />
<stop
offset="1"
stop-color="#E6E6E6"
id="stop279" />
</linearGradient>
</defs>
<rect
x="19"
y="31.053001"
width="29"
height="11.947"
rx="1.8238994"
id="rect29"
style="fill:#fcc024;stroke-width:1;fill-opacity:1;stroke:none;stroke-miterlimit:4;stroke-dasharray:none" />
<path
d="M29.3999 39.7363C28.9253 39.9824 28.335 40.1055 27.6289 40.1055C26.7148 40.1055 25.9824 39.8169 25.4316 39.2397C24.8809 38.6626 24.6055 37.9053 24.6055 36.9678C24.6055 35.96 24.9146 35.1455 25.5327 34.5244C26.1538 33.9033 26.9375 33.5928 27.8838 33.5928C28.4932 33.5928 28.9985 33.6792 29.3999 33.8521V34.8892C28.9751 34.6372 28.5063 34.5112 27.9937 34.5112C27.311 34.5112 26.7573 34.7295 26.3325 35.166C25.9106 35.6025 25.6997 36.1855 25.6997 36.915C25.6997 37.6094 25.8975 38.1631 26.293 38.5762C26.6885 38.9863 27.2085 39.1914 27.853 39.1914C28.4478 39.1914 28.9634 39.0508 29.3999 38.7695V39.7363ZM35.772 40H34.625L34.0581 38.396H31.5796L31.0347 40H29.8921L32.252 33.6982H33.4297L35.772 40ZM33.7812 37.5435L32.9067 35.0298C32.8804 34.9478 32.8525 34.8159 32.8232 34.6343H32.8057C32.7793 34.8013 32.75 34.9331 32.7178 35.0298L31.8521 37.5435H33.7812ZM41.9858 40H40.8433L37.833 35.3682C37.7568 35.251 37.6938 35.1294 37.644 35.0034H37.6177C37.6411 35.1382 37.6528 35.4268 37.6528 35.8691V40H36.6421V33.6982H37.8594L40.7686 38.2202C40.8916 38.4077 40.9707 38.5366 41.0059 38.6069H41.0234C40.9941 38.4399 40.9795 38.1572 40.9795 37.7588V33.6982H41.9858V40Z"
id="pill_text"
inkscape:connector-curvature="0"
style="fill:#000000;stroke-width:1;stroke:none;stroke-miterlimit:4;stroke-dasharray:none" />
</svg>

Before

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -1,17 +0,0 @@
<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
<defs>
<linearGradient id="foreground"><stop stop-color="#000000"/></linearGradient>
<linearGradient id="background"><stop stop-color="#ffffff"/></linearGradient>
</defs>
<!-- background rounded rectangle -->
<path d="M2 6C0.9 6 0 6.9 0 8L0 12L0 13L0 40C0 41.1 0.9 42 2 42L46 42C47.1 42 48 41.1 48 40L48 13L48 12L48 8C48 6.9 47.1 6 46 6L32 6L16 6L2 6Z" fill="url(#background)"/>
<!-- tab outlines -->
<rect y="12" x="0" height="1" width="48" fill="url(#foreground)"/>
<rect y="6" x="15.33" height="7" width="1" fill="url(#foreground)"/>
<rect y="6" x="31.66" height="7" width="1" fill="url(#foreground)"/>
<!-- > -->
<path d="M15.2 24.3L6.4 33.1C5.9 33.6 5.9 34.3 6.4 34.7L8.2 36.5C8.7 37 9.4 37 9.8 36.5L18.6 27.7C19.1 27.2 19.1 26.5 18.6 26.1L16.8 24.3C16.4 23.9 15.6 23.9 15.2 24.3Z" fill="url(#foreground)"/>
<path d="M9.8 17.3L18.6 26.1C19.1 26.6 19.1 27.3 18.6 27.7L16.8 29.5C16.3 30 15.6 30 15.2 29.5L6.4 20.7C5.9 20.2 5.9 19.5 6.4 19.1L8.2 17.3C8.6 16.9 9.4 16.9 9.8 17.3Z" fill="url(#foreground)"/>
<!-- "PRE" -->
<path d="m 27.279297,33.324219 c 0,2.468099 0,4.936198 0,7.404297 0.513672,0 1.027343,0 1.541015,0 0,-0.848958 0,-1.697917 0,-2.546875 0.917549,0.01484 1.927453,0.03299 2.65875,-0.616892 1.172278,-0.927905 1.176118,-3.073122 -0.17547,-3.840777 -0.981472,-0.568217 -2.13908,-0.358412 -3.218649,-0.399753 -0.268549,0 -0.537097,0 -0.805646,0 z m 5.869141,0 c 0,2.468099 0,4.936198 0,7.404297 0.513021,0 1.026041,0 1.539062,0 0,-0.950521 0,-1.901042 0,-2.851563 0.431639,-0.03621 0.908827,0.05394 1.148438,0.458985 0.525553,0.771736 0.970414,1.596546 1.458984,2.392578 0.604167,0 1.208333,0 1.8125,0 -0.638695,-0.976785 -1.211177,-1.999445 -1.914561,-2.931671 -0.241051,-0.276681 -0.636923,-0.466649 -0.07177,-0.574189 1.274395,-0.677377 1.378019,-2.774051 0.102268,-3.504493 -0.922467,-0.560429 -2.029423,-0.352936 -3.053526,-0.393944 -0.340466,0 -0.680932,0 -1.021398,0 z m 6.25,0 c 0,2.468099 0,4.936198 0,7.404297 1.440755,0 2.88151,0 4.322265,0 0,-0.454427 0,-0.908855 0,-1.363282 -0.925781,0 -1.851563,0 -2.777344,0 0,-0.566406 0,-1.132812 0,-1.699218 0.804688,0 1.609375,0 2.414063,0 0,-0.454427 0,-0.908855 0,-1.363282 -0.804688,0 -1.609375,0 -2.414063,0 0,-0.536458 0,-1.072917 0,-1.609375 0.873047,0 1.746094,0 2.619141,0 0,-0.45638 0,-0.91276 0,-1.36914 -1.388021,0 -2.776041,0 -4.164062,0 z M 34.6875,34.648438 c 0.570781,0.0371 1.28319,-0.150767 1.691507,0.358943 0.370833,0.564952 0.02331,1.464787 -0.684396,1.526855 -0.334157,0.03512 -0.67147,0.0117 -1.007111,0.0185 0,-0.634765 0,-1.269531 0,-1.904296 z m -5.867188,0.01562 c 0.61736,0.02299 1.42501,-0.135196 1.79395,0.492096 0.333428,0.657753 -0.0252,1.619083 -0.829192,1.664678 -0.319151,0.05007 -0.643164,0.0243 -0.964758,0.03073 0,-0.729167 0,-1.458333 0,-2.1875 z" fill="url(#foreground)"/>
</svg>

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

Some files were not shown because too many files have changed in this diff Show More