Compare commits

..

43 Commits

Author SHA1 Message Date
Leonard Hecker
e405309bd0 wip 2025-10-15 10:51:02 +02:00
Windows Console Service Bot
7f6ab5520e Localization Updates - main - 10/15/2025 02:48:19 (#19451)
Closes #18849
Closes #19412

Co-authored-by: Console Service Bot <consvc@microsoft.com>
2025-10-15 03:44:46 +00:00
Alex Alabuzhev
84cc3e3e52 Add initial bold font support to the GDI renderer (#19441)
Render SGR1 as bold in 256 and true colors, where "bold is intense" is
not applicable.
Implemented by creating 2 extra fonts: bold for 1 and bold italic for 1
+ 3.

No non-trivial changes, just extensions.
LOGFONT also supports Underline and StrikeOut, but they seem to be
already covered by other means, so no combinatorial explosion of fonts
expected.

Refs #18919

Co-authored-by: Leonard Hecker <lhecker@microsoft.com>
2025-10-14 17:00:13 -05:00
Carlos Zamora
819987c90e Update WinGet CNF for exact command matching (#19432)
## Summary of the Pull Request
Update the WinGet CNF package search to match that of the updated
PowerShell WinGet CNF module. Now, we'll only search for matching
commands instead of by name and moniker.

## References and Relevant Issues
https://github.com/microsoft/winget-command-not-found/pull/29

## Validation Steps Performed
 In CMD, type "vim" and vim packages are suggested
2025-10-09 16:27:41 -05:00
Carlos Zamora
b62cad640b Fix unfocusedBackground being used as active tab color (#19424)
## Summary of the Pull Request
Turns out that the `"TabViewItemHeaderBackground"` resource should be
set to the _selected_ color instead of the _deselected_ color.

In 1.22, (pre-#18109) we actually didn't set this resource. But we do
actually need it for high contrast mode! (verified)

## Validation Steps Performed
 High contrast mode looks right
 "Snazzy" theme from bug report looks right

## PR Checklist
 Closes #19343
2025-10-09 17:29:09 +00:00
Dustin L. Howett
9d7ea77cc8 Use the actual process image instead of module filename to dedup session (#19415)
Apparently, `GetModuleFileNameW` returns exactly the path (or prefix, in
case of a DLL) passed to `CreateProcess` casing and all. Since we were
using it to generate the uniquing hash for Portable and Unpackaged
instances, this meant that `C:\Terminal\wt` and `C:\TeRmInAl\wt` were
considered different instances. Whoops.

Using `QueryFullProcessImageNameW` instead results in canonicalization.
Maybe the kernel does it. I don't know. What I do know is that it works
more correctly.

(`Query...` goes through the kernel, while `GetModule...` goes through
the loader. Interesting!)

Closes #19253
2025-10-07 17:13:36 -05:00
Faisal Ahmad
6a8b2d10f0 chore: remove extra semicolons from ActionArgs (#19411)
Removes unnecessary extra semicolons at the end of `Equals` method
implementations in various ActionArgs classes.

Closes #19404
2025-10-07 17:35:38 +00:00
PankajBhojwani
04676bd31a Only do "keys" fixups for non-nested, non-iterable commands (#19408)
## Summary of the Pull Request
When we introduced action IDs, we separated "commands" from
"keybindings", and introduced fixup logic to rewrite the legacy-style
command blocks into the new version. However we don't do any ID logic
for nested and iterable commands, so make sure we don't inform the
loader for fixups in those cases.

## Validation Steps Performed
We no longer repeatedly attempt to fixup the settings file when we see a
`"keys"` entry in a nested/iterable command block

## PR Checklist
- [x] Closes #18736
2025-10-06 11:31:15 -07:00
Samuel D. Leslie
fc2d107897 Minor fixes to the settings schema (#19387)
## Summary of the Pull Request
Fixes a couple of minor issues in the settings schema which can result
in erroneous settings validation failures.

## References and Relevant Issues
None

## Detailed Description of the Pull Request / Additional comments
- `answerbackMessage`  
  Permit `null` type (corresponds to the default value).
- `compatibility.input.forceVT`  
  Add missing setting (previously was `experimental.input.forceVT`).
- `rendering.graphicsAPI`  
  Add missing `automatic` enumeration value.
- Mark several settings as deprecated using the same format and direct
the user to the updated settings to use.

## Validation Steps Performed
Tested updated schema against configuration with above settings present.

## PR Checklist
- [X] Schema updated (if necessary)

---------

Co-authored-by: Carlos Zamora <carlos.zamora@microsoft.com>
2025-10-02 23:13:36 -05:00
Dustin L. Howett
998ab586e1 Remove the leading fire from the taskbar progress handler (#19403)
If the progress state hasn't been set for more than 200ms, we shouldn't
even bother flickering the old state.

This prevents applications from making the tab (and the taskbar icon)
flicker.

We were reviewing #19394 and decided that the _original_ behavior before
Leonard's throttling fix was somewhat unfortunate as well. An
application that sets an indeterminate state for 10ms and then clears it
shouldn't be able to make any part of the application flicker, fast _or_
slow.

Removing the leading fire time from the throttled function ensures that
it will only fire once every 200ms, and only with the state most
recently set. It will not debounce (so setting the progress every 150ms
will not prevent it from updating.)

Closes #19394
2025-10-02 11:24:31 -05:00
Windows Console Service Bot
10ef1284d4 Localization Updates - main - 09/30/2025 21:11:05 (#19400) 2025-09-30 21:50:33 +00:00
Dustin L. Howett
5976de1600 Avoid reentrancy issues when dropping AppHost, even harder (#19395)
The previous fix in #19296 moved the _destruction_ of AppHost into the
tail end after we manipulate the `_windows` vector; however, it kept the
part which calls into XAML (`Close`) before the `erase`. I suspect that
we still had some reentrancy issues, where we cached an iterator before
the list was modified by another window close event.

That is:

```mermaid
sequenceDiagram
		Emperor->>Emperor: Close Window
		Emperor->>+AppHost: Close (a)
		AppHost->>XAML: Close
		XAML-->>Emperor: pump loop
		Emperor->>Emperor: Close Window
		Emperor->>+AppHost: Close (b)
		AppHost->>XAML: Close
		XAML-->>Emperor: pump loop
		AppHost->>-Emperor: Closed
		Emperor->>Emperor: erase(b)
		AppHost->>-Emperor: Closed
		Emperor->>Emperor: erase(a)
```

Moving the `Close()` to after the `erase` ensures that there are no
cached iterators that survive beyond XAML pumping the message loop.

Fixes 8d41ace3
2025-09-30 16:05:58 -05:00
Dustin L. Howett
52f9bd6d2c build: switch Touchdown to Federated Identity (#19399)
This is required as part of offboarding our non-user service account.
2025-09-30 15:57:45 -05:00
Avishek Das
05a4afcf35 Fix broken MSDN link in gdi/state.cpp (#19375)
Closes #16439

Co-authored-by: Carlos Zamora <carlos.zamora@microsoft.com>
2025-09-25 19:17:08 +00:00
Carlos Zamora
ad6473d6ae Add tab color setting to settings UI (#19351)
## Summary of the Pull Request
Adds the tab color profile setting to the settings UI. It's positioned
next to the tab title at the root of the profile page.

The new component uses a nullable color picker control to allow the user
to pick a color. The null color is represented as "Use theme color".

The tricky part is evaluating the `ThemeColor` for `null` (aka "use
theme color"). Since the value is dependent on the active theme, it can
be any of the following values:
- theme.tab.background...
   - explicit color
   - accent color
   - terminal background color
- (if no theme.tab.background is defined) theme.window.applicationTheme
   - light --> #F9F9F9
   - dark --> #282828
- default --> one of the above two values depending on the application
theme

The above light/dark values were acquired by using the color picker on
the tab when in light/dark theme.

## Validation Steps Performed
 accessible value is read out
 explicit tab color set
- tab color is null, so we fall back to...
-  theme.tab.background: explicit color, accent color, terminal
background color
-  theme.window.applicationTheme (and no theme.tab.background defined):
light, dark, default (aka not defined)
      -  updates when theme is changed locally and via JSON

## PR Checklist
Closes part of #18318
2025-09-25 11:37:43 -07:00
Dustin L. Howett
6b428577b9 build: separate vpack creation from vpack publication (#19380)
This will allow us to publish vpacks without making the build fail
waiting for us to *merge* those vpacks into Windows. It also gives us
better control over when and where the vpack update gets merged.
2025-09-25 13:36:31 -05:00
Leonard Hecker
4600c4791b Rewrite the MSAA/UIA integration into conhost (#19344)
Goal: Remove `CursorBlinker`.
Problem: Spooky action at a distance via `Cursor::HasMoved`.
Solution: Moved all the a11y event raising into `_stream.cpp` and pray
for the best.

Goal: Prevent node.js from tanking conhost performance via MSAA (WHY).
Problem: `ServiceLocator`.
Solution: Unserviced the locator. Debounced event raising. Performance
increased by >10x.
Problem 2: Lots of files changed.

This PR is a prerequisite for #19330

## Validation Steps Performed
Ran NVDA with and without UIA enabled and with different delays. 
2025-09-22 22:53:52 +00:00
Dustin L. Howett
e80aadd98b Move newTabMenu creation to Settings fixups (#19353)
Some of the other settings fixups require there to be a valid
NewTabMenu, rather than just a temporary object. Since the resolving all
the menu entries after loading already forces the user to have a
`newTabMenu`, let's just codify it as a real fixup.

I've moved the SSH folder fixup after the settings fixup because it
relies on there being a NTM.

I decided not to make this fixup write back to the user's settings.
There are a couple reasons for this, all of which are flimsy.

- There are a number of tests that test fixup behavior, especially those
around actions, which would need to be updated for this new mandatory
key. I did not think it proper to add `newTabMenu` to ten unrelated
tests that only contain actions (for example.)
- We actually don't currently have mandatory keys. But this one was
always being added anyway, in a later phase...
- It's consistent with the existing behavior.

Closes #19356
2025-09-16 21:08:45 +00:00
Dustin L. Howett
1926c4601c VsDev: reject VS instances which do not actually contain devshell/devcmd (#19352)
Closes #19169
2025-09-16 15:24:10 -05:00
Dustin L. Howett
46b9572e60 Avoid generating SSH profiles using stale memory (#19354)
You can't return a `string_view` to a temporary. It's a miracle this
ever worked.

Broken since inception in a5f9c85c39

Closes #19355
2025-09-16 15:23:58 -05:00
Leonard Hecker
0aee174e68 Fix behavior of split-pane for existing windows (#19347)
Closes #18815

## Validation Steps Performed
* `wt -w 0 sp` splits the current tab 
2025-09-16 13:09:56 -05:00
Ayman Bagabas
814f78ed2c Add support for VT horizontal mouse wheel events (#19248)
This adds support for horizontal mouse wheel events (`WM_MOUSEHWHEEL`).
With this change, applications running in the terminal can now receive
and respond to horizontal scroll inputs from the mouse/trackpad.

Closes #19245
Closes #10329
2025-09-11 18:48:49 -05:00
John Cavanaugh
eb16eb26ab Fix terminal profile schema to allow null in keybinding id (#19332)
Fixes the terminal profile jsonschema to allow for null in the id. This
is to match the current implementation when disabling a built in default
keybind.
2025-09-11 13:06:33 -05:00
Leonard Hecker
384932183f Fix a crash in _makeCursorVisible (#19329)
Fixes the crash and also makes `SnapOnOutput` a bit nicer.

Closes #19325

## Validation Steps Performed
* Launch vim in WSL
* Exit
* No crash 
2025-09-10 21:21:46 +02:00
Dustin L. Howett
5a05f82f7c Apparently finish the SLNX migration (#19335) 2025-09-09 20:39:39 -05:00
Dustin L. Howett
d6714f3ca9 Convert the solution file to the new SLNX format (#19328) 2025-09-09 15:01:03 -05:00
Leonard Hecker
4a34a76504 Fix right click on tabs closing them (#19273)
I do not like this.

## Validation Steps Performed
* Enable close buttons on tabs
* Open a tab
* Close the tab with middle click
* Open a tab
* Right click the tab
* Tab doesn't close, Menu opens 
2025-09-08 23:16:20 +00:00
Dustin L. Howett
54aaa4a98a tests: add UIHelpers and ThemeHelpers to TestHostApp (#19323)
It can't actually activate TerminalApp.dll without these... lol.
2025-09-08 10:21:29 -07:00
Windows Console Service Bot
13ddefa635 Localization Updates - main - 09/04/2025 03:03:15 (#19319) 2025-09-05 17:13:47 -05:00
PankajBhojwani
f6303ac1ae Add reflection to the ActionArgs in the settings model (#18915)
Implements reflection to the various ActionArg types in the settings
model, which allows these structs to provide information about
themselves (i.e. what args they contain and what types they are). This
is necessary as a pre-requisite for the Settings Editor to display and
modify these arg values.

## Detailed Description of the Pull Request / Additional comments
* The `IActionArgs` interface now has additional methods:
	* Get the number of args
	* Get/Set an arg at a specific index
	* Get a vector of arg descriptions; the arg description contains:
		* name of the arg
		* type of the arg
		* whether the arg is required
* a tag, this is to cover special cases (for example the ColorScheme
argument is technically of type "string", but only allows specific
values)
* All the macros in `ActionArgsMagic` have been updated to support the
new interface
* `ActionMap` has been updated to support adding/editing/deleting
actions and keybindings from outside the SettingsModel
	* It also handles ID change requests for commands
* EnumMappings have been added to various ActionArg enums that weren't
there before

## Validation Steps Performed
Bug bashed in conjunction with #18917
2025-09-03 13:36:10 -07:00
Dustin L. Howett
52e60b95e4 Remove TerminalSettings from the TerminalSettingsModel project (#19262)
The idea with IControlSettings (and friends) was always that a consumer
of the terminal control could implement it in whatever way they pleased.

Windows Terminal (the application) was intended to be only one
consumer. It has a whole JSON settings model. Nobody wants to think
about JSON at the Terminal Control level. We could have an "adapter" in
TerminalApp, which spoke Terminal JSON Settings on one side and Terminal
Control on the other side.

That worked until we added the settings editor. The settings editor
needed to display a control, and that control's settings needed to be
based on the JSON settings. Oops. We took the expedient route of moving
the adapter into TerminalSettingsModel itself, and poking a bunch of
holes in it so that TerminalApp and TerminalSettingsEditor could tweak
it as needed.

Later, we doubled down on the control settings interface by having every
Terminal Control _make its own ControlSettings_ when we were going to do
the multi-process model. This reduced the number of IPC round trips for
every settings query to 0. Later we built color scheme previewing on top
of that--adding structs to carry color schemes and stuff which was
already in the Appearance config. Sheesh. Layers and layers and layers.

This pull request moves it back into its own library and strips it from
the surface of TerminalSettingsModel. It also deletes `ControlSettings`
and `struct CoreScheme`. That library is called
`TerminalSettingsAppAdapterLib`, and it contains a hidden WinRT
_implements_ type rather than a full-fledged activatable `runtimeclass`.
It also implements one-level inheritance on its own rather than using
IInheritable.

It adheres to the following principles:
- The control will never modify its settings in a way that is visible to
  the control's consumer; therefore, none of the properties have setters
- The settings should never contain things of interest only to the
  Application that the Application uses to communicate data _back to
  itself_ (see `ProfileName`, removed in 68b723c and `KeyBindings`,
  removed in fa09141). This generalizes to "we should never store stuff
  in an unrelated object passed between layers solely for the purpose of
  getting it back".

I made a few changes to the settings interface, including introducing a
new `ICoreScheme` interface that _only_ contains color scheme info. This
is designed to support the Preview/Set color scheme actions, which no
longer work by _app backing up the scheme and restoring it later._ All
of that machinery lives inside TermControl/ControlCore now.

`ICoreScheme` no longer supports `GetColorAtIndex`; you must read all 16
colors at the same time. I am not sorry. Every consumer did that
already, so now we have 15 fewer COM calls for every color scheme.

The new TerminalSettings is mostly consumed via
`com_ptr<TerminalSettings>`, so a bunch of `.` (projected) accesses had
to turn into `->` (com_ptr dereferencing) accesses.

I also realized, in the course of this work, that the old
TerminalSettings contained a partial hand-written reimplementation of
_every setting_ in `ControlProperties`. Every contributor had to add
every new setting to both places--why? I can't figure it out. I'm using
ControlProperties comprehensively now. I propagated any setting whose
default value was different from that in ControlProperties back to
ControlProperties.

This is part X in a series of pull requests that will remove all mention
of Microsoft.Terminal.Control and Microsoft.Terminal.Core from the
settings model. Once that is done, the settings model can consume _only_
the base WinRT types and build very early and test more easily.

Previewing is fun. I introduced a new place to stash an entire color
table on ControlCore, which we use to save the "active" colors while we
temporarily overwrite them. SetColorScheme is _also_ fun. We now have a
slot for overriding only the focused color scheme on ControlCore. It's
fine. It's clearer than "back up the focused appearance, overwrite the
focused appearance, create a child of the user's settings and apply the
color scheme to it, etc.".

There is a bug/design choice in color scheme overriding, which may or
may not matter: overlaying a color scheme on a terminal with an
unfocused appearance which _does not_ have its own color scheme will
result in the previously-deleted overridden focused color scheme peeking
through when the terminal is not focused.

I also got rid of our only in-product use of
`Terminal::CreateFromSettings` which required us to set `InitialRows`
and `InitialCols` on the incoming settings object (see core tenet 2).

Refs #19261
Refs #19314
Refs #19254
2025-09-03 14:01:36 -05:00
Dustin L. Howett
fa09141a16 Stop using Settings to shuttle IKeyBindings around (#19314)
For some reason, we went real hard on an architecture where the settings
object contained the key bindings handler for the terminal. To make this
work, we had to wind it through tons of layers: `TermControl`,
`ControlInteractivity`, `ControlCore` (which saved it on
`ControlSettings`), `ControlSettings`. Of course, because we have no
clear delineation of concerns at the App layer this required us to put
the bindings into the Settings Cache[^1].

Well, `TermControl` used `ControlCore` to get the Settings, to get the
Bindings, to dispatch keys.

Yes, `TermControl` stored `IKeyBindings` down three layers _only to fish
it back out and use it itself._

There is one place in the application where `TermControl`s are hooked up
to their owners. Instead of passing the key bindings dispatcher in
through nine hundred layers, we can just set it once--definitively!--
there.

[^1]: This was the last thing that made the settings cache
page-specific...
2025-09-03 16:43:34 +00:00
Myungchul Keum
8011f3e28c Adjust "Dimidium" color scheme (#19303)
- Add Selection BG color
- Make Bright white brighter

## Summary of the Pull Request
Final tune for Dimidium color scheme before its release.

## References and Relevant Issues
#18563

## Detailed Description of the Pull Request / Additional comments
I made little change to Dimidium color scheme.

<img width="640" height="174" alt="cmp-lightness1c"
src="https://github.com/user-attachments/assets/2e4aa6ca-5864-4901-b323-2e2bb2bf00e8"
/>


![preview-terminal](https://github.com/user-attachments/assets/8a53c54d-942a-44a2-9ee7-9ff8a6d2dfab)

<img width="584" height="207" alt="image"
src="https://github.com/user-attachments/assets/b70b0759-7961-4f8f-aaa7-762fc48e425b"
/>


- Adjusted "Bright white" slightly brighter, hoping it can be
distinguished better from "White".
- Defined "Selection Background" color.

This will be the final tune for Dimidum color scheme.
2025-09-03 11:04:28 -05:00
Leonard Hecker
8d41ace320 Avoid reentrancy issues when dropping AppHost (#19296)
tl;dr: ~Apphost() may pump the message loop.
That's no bueno. See comments in the diff.

Additionally, this PR enables `_assertIsMainThread` in
release to trace down mysterious crashes in those builds.
2025-09-01 15:33:11 +02:00
Leonard Hecker
7849b00cbd Fix CoreWindow being destroyed after handoff (#19298)
As per: https://github.com/microsoft/terminal/discussions/19280#discussioncomment-14237148

## Validation Steps Performed
* Launch wtd via handoff (spawn cmd, etc.)
* Shift+Click the tab bar + button to create a new window
* Close the initial window
* UI doesn't lock up 
2025-09-01 15:32:58 +02:00
Leonard Hecker
5899343237 Fix a race condition around Open/CloseClipboard (#19297)
tl;dr: Open/CloseClipboard are surprisingly not thread-safe.

## Validation Steps Performed
* Copy a large amount of text (>1MB)
* Run `edit.exe`
* Press and hold Ctrl+Shift+V
* Doesn't crash 
2025-08-29 20:20:53 +02:00
Windows Console Service Bot
1283c0f5b9 Localization Updates - main - 08/26/2025 03:03:22 (#19278) 2025-08-29 00:32:22 +02:00
Dustin L. Howett
4272151adc Include Profile.BellSound as a media resource (#19289)
I legitimately cannot figure out how I forgot this. Bell should support
all the same validation as other media resources! Technically this means
you can set `bellSound` to `desktopWallpaper`, but... we'll pretend that
makes sense.

I reworked the viewmodel to be a little more sensible. It no longer
requires somebody else to check that its files exist. The settings UI
now also displays `File not found` in the _preview_ for the bell if it
is a single file which failed validation!
2025-08-28 00:05:51 +00:00
Dustin L. Howett
bd14f69080 sb: add appId to the StoreBroker blobs (new AERO requirement) (#19290)
> _I am altering the deal. Pray I do not alter it further._
> -the AERO team, maybe
2025-08-27 10:22:28 -07:00
Dustin L. Howett
91c9a14a71 env: don't explode when GetShortPathNameW fails (#19284)
It fails inside app containers (!) such as the one used by LocalTests.
2025-08-26 21:50:32 +00:00
Dustin L. Howett
9e10436a80 Move adjustProcessPriorityThrottled ctor earlier (#19283)
Test Impact: The LocalTests do not call `Initialize(HWND)`, so we would
fail on launch.
Also, we have `Create()` and `Initialize()` and `event Initialized` (the
last of which is not called from either of the first two...)
2025-08-26 21:34:01 +00:00
Dustin L. Howett
a9b660cc36 version: bump to 1.25 on main (#19276) 2025-08-25 17:06:19 -05:00
Dustin L. Howett
7b754e3d8e Localization Updates - 08/25/2025 21:39:33 (#19277)
Co-authored-by: Console Service Bot <consvc@microsoft.com>
2025-08-25 17:02:41 -05:00
291 changed files with 7970 additions and 6078 deletions

View File

@@ -178,7 +178,6 @@ ubrk
UChar
UFIELD
ULARGE
UNCEx
UOI
UPDATEINIFILE
urlmon

View File

@@ -141,7 +141,6 @@ BValue
Cacafire
CALLCONV
CANDRABINDU
CANTCALLOUT
capslock
CARETBLINKINGENABLED
CARRIAGERETURN
@@ -808,9 +807,9 @@ IMPEXP
inbox
inclusivity
INCONTEXT
INDEXID
INFOEX
inheritcursor
ININPUTSYNCCALL
INITCOMMONCONTROLSEX
INITDIALOG
INITGUID
@@ -910,6 +909,7 @@ LNM
LOADONCALL
LOBYTE
localappdata
LOCATIONCHANGE
locsrc
Loewen
LOGBRUSH
@@ -1035,6 +1035,7 @@ MOUSEACTIVATE
MOUSEFIRST
MOUSEHWHEEL
MOVESTART
msaa
msb
msbuildcache
msctls
@@ -1063,7 +1064,6 @@ Mypair
Myval
NAMELENGTH
namestream
NCACTIVATE
NCCALCSIZE
NCCREATE
NCLBUTTONDOWN
@@ -1094,8 +1094,6 @@ NEXTLINE
nfe
NLSMODE
NOACTIVATE
NOACTIVATEKEYBOARDLAYOUT
NOACTIVATETIP
NOAPPLYNOW
NOCLIP
NOCOMM
@@ -1510,6 +1508,7 @@ scrolllock
scrolloffset
SCROLLSCALE
SCROLLSCREENBUFFER
scursor
sddl
SDKDDK
segfault
@@ -1589,6 +1588,7 @@ SLGP
SLIST
slmult
sln
slnx
slpit
SManifest
SMARTQUOTE
@@ -1707,11 +1707,9 @@ TEXTMETRIC
TEXTMETRICW
textmode
texttests
TFCAT
THUMBPOSITION
THUMBTRACK
tilunittests
TIPCAP
titlebars
TITLEISLINKNAME
TLDP
@@ -1763,8 +1761,6 @@ UIACCESS
uiacore
uiautomationcore
uielem
UIELEMENTENABLED
UIELEMENTENABLEDONLY
UINTs
uld
uldash
@@ -1980,8 +1976,8 @@ WRITECONSOLEINPUT
WRITECONSOLEOUTPUT
WRITECONSOLEOUTPUTSTRING
wrkstr
WRL
wrl
WRL
wrp
WRunoff
WSLENV

File diff suppressed because it is too large Load Diff

1070
OpenConsole.slnx Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -375,7 +375,7 @@ winget configure .config\configuration.winget
## Building the Code
OpenConsole.sln may be built from within Visual Studio or from the command-line
OpenConsole.slnx may be built from within Visual Studio or from the command-line
using a set of convenience scripts & tools in the **/tools** directory:
### Building in PowerShell

View File

@@ -56,11 +56,11 @@ Dies ist ein Open Source-Projekt, und wir freuen uns über die Teilnahme der Com
<ReleaseNotes>
Version __VERSION_NUMBER__
- Wir haben der Benutzeroberfläche durchschnittliche Einstellungen hinzugefügt, die nur einmal in der JSON-Datei vorhanden waren, einschließlich einer neuen Seite zum Anpassen des Layouts Ihres Menüs "Neue Registerkarte"!
- Wir haben die Fensterverwaltung zurückgesetzt, um die Zuverlässigkeit zu verbessern; Melden Sie alle Fehler, die mit dem alias "wt.exe" auftreten.
- Profile zeigen jetzt ein Symbol an, wenn sie ausgeblendet wurden oder auf programme verweisen, die deinstalliert wurden.
Eine komplett neue Erweiterungsseite, die anzeigt, was in Ihrem Terminal installiert ist
Die Befehlspalette wird jetzt sowohl in Ihrer Muttersprache als auch auf Englisch angezeigt
Neue VT-Features wie synchronisiertes Rendering, neue Farbschemas, Konfiguration für schnelle Mausaktionen wie Zoomen und mehr
Weitere Details finden Sie auf unserer GitHub-Releasesseite.
Weitere Informationen finden Sie auf unserer GitHub-Releaseseite.
</ReleaseNotes>
<ScreenshotCaptions>
<!-- Valid length: 200 character limit, up to 9 elements per platform -->

View File

@@ -56,11 +56,11 @@ Este es un proyecto de fuente abierta y animamos a la comunidad a participar. Pa
<ReleaseNotes>
Versión __VERSION_NUMBER__
- Hemos agregado decenas de configuraciones a la interfaz de usuario que solo existían una vez en el archivo JSON, incluida una página nueva para personalizar el diseño del menú Nueva pestaña.
- Tenemos administración de ventanas rearchitecdas para mejorar la confiabilidad; envíe los errores que encuentre con el alias de wt.exe.
- Ahora, los perfiles muestran un icono si se han ocultado o hacen referencia a programas que se han desinstalado.
- Página Extensiones completamente nueva que muestra lo que se ha instalado en tu terminal
- La paleta de comandos ahora se muestra en tu idioma nativo, así como en inglés
- Nuevas características de VT, como la representación sincronizada, nuevos esquemas de color, configuración para acciones rápidas del ratón, como el zoom, y más
Consulte nuestra página de versiones de GitHub para obtener más detalles.
Consulta la página de versiones de GitHub para más información.
</ReleaseNotes>
<ScreenshotCaptions>
<!-- Valid length: 200 character limit, up to 9 elements per platform -->

View File

@@ -54,13 +54,13 @@ Il sagit dun projet open source et nous vous invitons à participer dans l
</DevStudio>
<ReleaseNotes>
__VERSION_NUMBER__ de version
Version __VERSION_NUMBER__
- Nous avons ajouté des milliers de paramètres à linterface utilisateur qui nexistaient auparavant que dans le fichier JSON, y compris une nouvelle page pour personnaliser la disposition de votre menu Nouvel onglet !
- Nous avons réarchitialiser la gestion des fenêtres pour améliorer la fiabilité ; entrez les bogues rencontrés avec lalias wt.exe
- Les profils affichent désormais une icône sils ont été masqués ou sils font référence à des programmes qui ont été désinstallés.
- Une toute nouvelle page Extensions qui montre ce qui a été installé dans votre terminal
- La palette de commandes saffiche désormais dans votre langue native, ainsi quen anglais
- Nouvelles fonctionnalités VT telles que le rendu synchronisé, de nouveaux schémas de couleurs, la configuration pour des actions rapides de la souris comme le zoom, et plus encore
Pour plus dinformations, consultez notre page des mises en production GitHub.
Veuillez consulter notre page des versions GitHub pour découvrir dautres détails.
</ReleaseNotes>
<ScreenshotCaptions>
<!-- Valid length: 200 character limit, up to 9 elements per platform -->

View File

@@ -54,13 +54,13 @@ Si tratta di un progetto open source e la partecipazione della community è molt
</DevStudio>
<ReleaseNotes>
Versione __VERSION_NUMBER__
Versione __VERSION_NUMBER__
- Sono state aggiunte decine di impostazioni all'interfaccia utente che una volta esisteva solo nel file JSON, inclusa una nuova pagina per personalizzare il layout del menu Nuova scheda.
- È stata riattivata la gestione delle finestre per migliorare l'affidabilità; inserire eventuali bug riscontrati con l'alias wt.exe
- I profili ora mostrano un'icona se sono stati nascosti o fanno riferimento ai programmi che sono stati disinstallati.
- Una pagina Estensioni completamente nuova che mostra ciò che è stato installato nel terminale
- Il riquadro comandi ora viene visualizzato nella tua lingua di origine oltre che in inglese
- Nuove funzionalità VT come il rendering sincronizzato, le nuove combinazioni di colori, la configurazione per azioni rapide del mouse come lo zoom e altro ancora
Per altri dettagli, vedere la pagina delle versioni di GitHub.
Per altri dettagli, vedi la pagina delle release di GitHub.
</ReleaseNotes>
<ScreenshotCaptions>
<!-- Valid length: 200 character limit, up to 9 elements per platform -->

View File

@@ -56,11 +56,11 @@
<ReleaseNotes>
バージョン __VERSION_NUMBER__
- [新しいタブ] メニューのレイアウトをカスタマイズするための新しいページを含む、一度だけ JSON ファイルに存在した UI に多数の設定を追加しました。
- 信頼性を向上させるためにウィンドウ管理を再選択しました。wt.exe エイリアスで発生したバグを報告してください
- プロファイルが非表示になっているか、アンインストールされたプログラムを参照している場合にアイコンが表示されるようになりました。
- ターミナルに何がインストールされているかを表示する新しい [拡張機能] ページ
- コマンド パレットがネイティブ言語と英語で表示されるようになりました
- 同期レンダリング、新しい配色、ズームなどのクイック マウス操作の構成などの、新しい VT 機能
詳細については、GitHub リリース ページを参照してください。
詳細については、GitHub リリース ページをご覧ください。
</ReleaseNotes>
<ScreenshotCaptions>
<!-- Valid length: 200 character limit, up to 9 elements per platform -->

View File

@@ -56,9 +56,9 @@
<ReleaseNotes>
버전 __VERSION_NUMBER__
- 새 탭 메뉴의 레이아웃을 사용자 지정하기 위한 새 페이지를 포함하여 JSON 파일에 한 번만 존재했던 UI에 수천 개의 설정을 추가했습니다.
- 안정성을 개선하기 위해 창 관리를 다시 보관했습니다. wt.exe 별칭에 발생한 버그를 제출하세요.
- 프로필이 숨겨졌거나 제거된 프로그램을 참조하는 경우 이제 프로필에 아이콘이 표시됩니다.
- 터미널에 설치된 항목을 보여 주는 완전히 새로운 확장 페이지
- 명령 팔레트가 이제 영어뿐만 아니라 모국어로도 표시
- 동기화된 렌더링, 새로운 색 구성표, 확대/축소와 같은 빠른 마우스 동작을 위한 구성 등 새로운 VT 기능이 추가
자세한 내용은 GitHub 릴리스 페이지를 참조하세요.
</ReleaseNotes>

View File

@@ -54,13 +54,13 @@ Este é um projeto de código aberto e a participação da comunidade é bem-vin
</DevStudio>
<ReleaseNotes>
Versão __VERSION_NUMBER__
Version __VERSION_NUMBER__
- Adicionamos várias configurações à interface do usuário que só existiam no arquivo JSON, incluindo uma nova página para personalizar o layout do menu Nova Guia!
- Temos o gerenciamento de janelas rearmado para melhorar a confiabilidade; registre todos os bugs encontrados com o wt.exe alias
- Os perfis agora mostram um ícone se eles foram ocultos ou se referem a programas que foram desinstalados.
Uma nova página de Extensões que mostra o que foi instalado no seu Terminal
A Paleta de Comandos agora aparece no seu idioma nativo, além do inglês
Novos recursos da VT, como renderização sincronizada, novos esquemas de cores, configuração para ações rápidas do mouse, como zoom, e muito mais
Consulte nossa página de versões do GitHub para obter detalhes adicionais.
Confira nossa página de lançamentos no GitHub para obter mais detalhes.
</ReleaseNotes>
<ScreenshotCaptions>
<!-- Valid length: 200 character limit, up to 9 elements per platform -->

View File

@@ -56,11 +56,11 @@
<ReleaseNotes>
Vėѓѕіöй __VERSION_NUMBER__ !!! !!! !
- Ẁē'νё àðđέď đöžзńş öƒ śėŧťїńģš тб тнè ÛĮ ťħąт ŏņ¢з όⁿℓγ έжіѕŧéð іή тђε ЈŠΩŃ ƒїℓė, ĭňĉŀџđіņģ å ňэẅ φâģé ƒøя ςŭśŧŏmïżϊñģ тħέ ĺαŷöυτ öƒ убµř Йέẁ Ţàъ мęήµ! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!
- Ẁè ĥаνė řэąřčħΐŧέсτέð щįлďοш мǻňαĝēмêиť ťô ϊmрябνé ŗĕŀĩāвîĺïтγ; ρŀěăѕе ƒíŀё αⁿу вûġš ÿøú εʼnćōùлťēѓ ẃïτħ ŧћё wt.exe ǻļĭâś !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!
- Рґøƒíŀêŝ ňöẁ šћθẁ ãй ĭčöñ ίƒ ŧħэŷ'νę ъеєл ђіðδэñ őř řєƒěґ ŧσ φяοġгаmŝ ẅђíçĥ ẁ℮гέ џňϊйşťàľĺèð. !!! !!! !!! !!! !!! !!! !!! !!! !!! !
- Ą ωћόĺé ņέш ∑×τзńşĩōиŝ ρâģε τђат šнòωş ωħąт нǻś ъеēñ įηšтǻľĺéδ ĭʼnтο ўбμŗ Ţзřmĭňāŀ !!! !!! !!! !!! !!! !!! !!! !!!
- €όммаήδ Рдĺēтţĕ пŏẅ şĥŏшś üρ ϊñ ỳоũѓ йαťïνє ļäŋģµаġέ άś ŵєŀľ åś Σиĝℓĭŝђ !!! !!! !!! !!! !!! !!! !!!
- ∏еẅ VΤ ƒэåŧύґέŝ şűçн ăŝ ѕỳňсĥŗǿйìźėð гēŋďзříⁿğ, ηĕш ćôĺõг şĉћěмєѕ, çóńƒіĝџŗáτїöπ ƒοг qũī¢ķ möűšë ąćŧϊόņŝ ľîķє žøōmίйğ, ǻⁿđ мόřε !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!
Рļèāŝє ŝèĕ θџŗ ĢίťĤцъ řέĺэªşэš ρąĝę ƒόř áďđїτϊōπαľ đэŧдįļŝ. !!! !!! !!! !!! !!! !!!
Ρĺęąŝэ ѕєě õμя ĞĭтΗύв řєĺэдšέŝ рάġě ƒοґ àďđϊтїõлаℓ ðêţǻїłş. !!! !!! !!! !!! !!! !!!
</ReleaseNotes>
<ScreenshotCaptions>
<!-- Valid length: 200 character limit, up to 9 elements per platform -->

View File

@@ -56,11 +56,11 @@
<ReleaseNotes>
Vėѓѕіöй __VERSION_NUMBER__ !!! !!! !
- Ẁē'νё àðđέď đöžзńş öƒ śėŧťїńģš тб тнè ÛĮ ťħąт ŏņ¢з όⁿℓγ έжіѕŧéð іή тђε ЈŠΩŃ ƒїℓė, ĭňĉŀџđіņģ å ňэẅ φâģé ƒøя ςŭśŧŏmïżϊñģ тħέ ĺαŷöυτ öƒ убµř Йέẁ Ţàъ мęήµ! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!
- Ẁè ĥаνė řэąřčħΐŧέсτέð щįлďοш мǻňαĝēмêиť ťô ϊmрябνé ŗĕŀĩāвîĺïтγ; ρŀěăѕе ƒíŀё αⁿу вûġš ÿøú εʼnćōùлťēѓ ẃïτħ ŧћё wt.exe ǻļĭâś !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!
- Рґøƒíŀêŝ ňöẁ šћθẁ ãй ĭčöñ ίƒ ŧħэŷ'νę ъеєл ђіðδэñ őř řєƒěґ ŧσ φяοġгаmŝ ẅђíçĥ ẁ℮гέ џňϊйşťàľĺèð. !!! !!! !!! !!! !!! !!! !!! !!! !!! !
- Ą ωћόĺé ņέш ∑×τзńşĩōиŝ ρâģε τђат šнòωş ωħąт нǻś ъеēñ įηšтǻľĺéδ ĭʼnтο ўбμŗ Ţзřmĭňāŀ !!! !!! !!! !!! !!! !!! !!! !!!
- €όммаήδ Рдĺēтţĕ пŏẅ şĥŏшś üρ ϊñ ỳоũѓ йαťïνє ļäŋģµаġέ άś ŵєŀľ åś Σиĝℓĭŝђ !!! !!! !!! !!! !!! !!! !!!
- ∏еẅ VΤ ƒэåŧύґέŝ şűçн ăŝ ѕỳňсĥŗǿйìźėð гēŋďзříⁿğ, ηĕш ćôĺõг şĉћěмєѕ, çóńƒіĝџŗáτїöπ ƒοг qũī¢ķ möűšë ąćŧϊόņŝ ľîķє žøōmίйğ, ǻⁿđ мόřε !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!
Рļèāŝє ŝèĕ θџŗ ĢίťĤцъ řέĺэªşэš ρąĝę ƒόř áďđїτϊōπαľ đэŧдįļŝ. !!! !!! !!! !!! !!! !!!
Ρĺęąŝэ ѕєě õμя ĞĭтΗύв řєĺэдšέŝ рάġě ƒοґ àďđϊтїõлаℓ ðêţǻїłş. !!! !!! !!! !!! !!! !!!
</ReleaseNotes>
<ScreenshotCaptions>
<!-- Valid length: 200 character limit, up to 9 elements per platform -->

View File

@@ -56,11 +56,11 @@
<ReleaseNotes>
Vėѓѕіöй __VERSION_NUMBER__ !!! !!! !
- Ẁē'νё àðđέď đöžзńş öƒ śėŧťїńģš тб тнè ÛĮ ťħąт ŏņ¢з όⁿℓγ έжіѕŧéð іή тђε ЈŠΩŃ ƒїℓė, ĭňĉŀџđіņģ å ňэẅ φâģé ƒøя ςŭśŧŏmïżϊñģ тħέ ĺαŷöυτ öƒ убµř Йέẁ Ţàъ мęήµ! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!
- Ẁè ĥаνė řэąřčħΐŧέсτέð щįлďοш мǻňαĝēмêиť ťô ϊmрябνé ŗĕŀĩāвîĺïтγ; ρŀěăѕе ƒíŀё αⁿу вûġš ÿøú εʼnćōùлťēѓ ẃïτħ ŧћё wt.exe ǻļĭâś !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!
- Рґøƒíŀêŝ ňöẁ šћθẁ ãй ĭčöñ ίƒ ŧħэŷ'νę ъеєл ђіðδэñ őř řєƒěґ ŧσ φяοġгаmŝ ẅђíçĥ ẁ℮гέ џňϊйşťàľĺèð. !!! !!! !!! !!! !!! !!! !!! !!! !!! !
- Ą ωћόĺé ņέш ∑×τзńşĩōиŝ ρâģε τђат šнòωş ωħąт нǻś ъеēñ įηšтǻľĺéδ ĭʼnтο ўбμŗ Ţзřmĭňāŀ !!! !!! !!! !!! !!! !!! !!! !!!
- €όммаήδ Рдĺēтţĕ пŏẅ şĥŏшś üρ ϊñ ỳоũѓ йαťïνє ļäŋģµаġέ άś ŵєŀľ åś Σиĝℓĭŝђ !!! !!! !!! !!! !!! !!! !!!
- ∏еẅ VΤ ƒэåŧύґέŝ şűçн ăŝ ѕỳňсĥŗǿйìźėð гēŋďзříⁿğ, ηĕш ćôĺõг şĉћěмєѕ, çóńƒіĝџŗáτїöπ ƒοг qũī¢ķ möűšë ąćŧϊόņŝ ľîķє žøōmίйğ, ǻⁿđ мόřε !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!
Рļèāŝє ŝèĕ θџŗ ĢίťĤцъ řέĺэªşэš ρąĝę ƒόř áďđїτϊōπαľ đэŧдįļŝ. !!! !!! !!! !!! !!! !!!
Ρĺęąŝэ ѕєě õμя ĞĭтΗύв řєĺэдšέŝ рάġě ƒοґ àďđϊтїõлаℓ ðêţǻїłş. !!! !!! !!! !!! !!! !!!
</ReleaseNotes>
<ScreenshotCaptions>
<!-- Valid length: 200 character limit, up to 9 elements per platform -->

View File

@@ -56,9 +56,9 @@
<ReleaseNotes>
Версия __VERSION_NUMBER__
- Мы добавили в пользовательский интерфейс десятки параметров, которые существовали только в JSON-файле, включая новую страницу для настройки макета меню "Новая вкладка".
- Для повышения надежности мы переупоряхлили управление окнами; создайте все ошибки, обнаруженные с wt.exe псевдонимом
- Профили теперь показывают значок, если они скрыты или ссылаются на программы, которые были удалены.
Новая страница расширений, на которой отображается информация о том, что было установлено в вашем терминале
Палитра команд теперь доступна на вашем языке, а также на английском
Новые функции VT, например синхронизированная отрисовка, новые цветовые схемы, настройка быстрых действий мыши, таких как масштабирование, и т. д.
Дополнительные сведения см. на странице выпусков GitHub.
</ReleaseNotes>

View File

@@ -54,13 +54,13 @@
</DevStudio>
<ReleaseNotes>
版本 __VERSION_NUMBER__
Version __VERSION_NUMBER__
- 我们向用户界面添加了许多设置,这些设置仅存在于 JSON 文件中,包括用于自定义“新建标签页”菜单布局的新页面!
- 我们已重新检测窗口管理以提高可靠性;请将遇到的任何 bug 归档为 wt.exe 别名
- 如果配置文件已隐藏或引用已卸载的程序,则它们现在将显示一个图标。
- 一个全新的“扩展”页,显示已安装到终端的内容
- 命令面板现在以你的母语和英语显示
- 新的 VT 功能,例如同步渲染、新配色方案、快速鼠标操作(如缩放)的配置等
有关其他详细信息,请参阅 GitHub 发布页面。
有关其他详细信息,请参阅我们的 GitHub 发布页面。
</ReleaseNotes>
<ScreenshotCaptions>
<!-- Valid length: 200 character limit, up to 9 elements per platform -->

View File

@@ -54,13 +54,13 @@
</DevStudio>
<ReleaseNotes>
版本 __VERSION_NUMBER__
Version __VERSION_NUMBER__
- 我們已新增數十個只存在於 JSON 檔案中的設定到 UI包括自定義 [新索引標籤] 功能表版面配置的新頁面!
- 我們已重新設定視窗管理,以改善可靠性;請提出您在 wt.exe 別名遇到的任何錯誤
- 設定文件現在會在隱藏或參照已卸載的程式時顯示圖示。
- 全新的延伸模組頁面會顯示已安裝在您終端機中的內容
- 命令選擇區現在以您的母語和英文顯示
- 新的 VT 功能,例如同步轉譯、新的色彩配置、快速滑鼠動作 (例如縮放) 設定等等
如需詳細數據,請參閱我們的 GitHub 版本頁面。
如需更多詳細資料,請參閱我們的 GitHub 發行版本頁面。
</ReleaseNotes>
<ScreenshotCaptions>
<!-- Valid length: 200 character limit, up to 9 elements per platform -->

View File

@@ -56,12 +56,9 @@ Dies ist ein Open Source-Projekt, und wir freuen uns über die Teilnahme an der
<ReleaseNotes>
Version __VERSION_NUMBER__
Wir haben umgeschrieben, wie Konsolenanwendungen im Terminal gehostet werden! Melden Sie alle auftretenden Fehler.
Terminal unterstützt jetzt Sixels!
Sie können jetzt einen angedockten Bereich öffnen, der Ausschnitte von Befehlen enthält, die Sie gespeichert haben, um sie später zu verwenden.
Für Benutzer der Eingabeaufforderung der neuesten Version von Windows 11 wird möglicherweise ein QuickInfo-Symbol angezeigt, das installierbare Software von WinGet vorschlägt.
Ausgewählter Text wird jetzt viel sichtbarer (und anpassbarer!).
- Eine Reihe von Zuverlässigkeitsfehlern, Benutzerfreundlichkeitsproblemen und Ärgernissen wurden behoben.
Wir haben der Benutzeroberfläche Dutzende von Einstellungen hinzugefügt, die nur einmal in der JSON-Datei vorhanden waren, einschließlich einer neuen Seite zum Anpassen des Layouts Ihres Menüs „Neue Registerkarte“!
Wir haben die Fensterverwaltung umgestaltet, um die Zuverlässigkeit zu verbessern. Melden Sie alle Fehler, die beim alias „wt.exe“ auftreten
Profile zeigen jetzt ein Symbol an, wenn sie ausgeblendet wurden oder auf Programme verweisen, die deinstalliert wurden.
Weitere Informationen finden Sie auf unserer GitHub-Releaseseite.
</ReleaseNotes>

View File

@@ -56,12 +56,9 @@ Este es un proyecto de fuente abierta y animamos a la comunidad a participar. Pa
<ReleaseNotes>
Versión __VERSION_NUMBER__
- Hemos reescrito cómo se hospedan las aplicaciones de consola en Terminal. Informe de los errores que encuentre.
- Terminal ahora admite síxeles.
- Ahora puede abrir un panel acoplado que contenga fragmentos de comandos que haya guardado para usarlos más adelante
- Los usuarios del símbolo del sistema de la versión más reciente de Windows 11 pueden ver un icono de "sugerencia rápida" que sugiere software instalable de WinGet
- El texto seleccionado ahora será mucho más visible (y personalizable)
- Se han corregido varios errores de fiabilidad, problemas de comodidad y molestias.
- Hemos añadido decenas de configuraciones a la interfaz de usuario que antes solo existían en el archivo JSON, incluida una nueva página para personalizar el diseño del menú Nueva pestaña.
- Hemos reestructurado la gestión de ventanas para mejorar la fiabilidad; informe de cualquier error que encuentre con el alias wt.exe
- Ahora, los perfiles muestran un icono si han sido ocultados o hacen referencia a programas que han sido desinstalados.
Consulte la página de versiones de GitHub para más información.
</ReleaseNotes>

View File

@@ -56,12 +56,9 @@ Il sagit dun projet open source et nous encourageons la participation à l
<ReleaseNotes>
Version __VERSION_NUMBER__
Nous avons réécrit la manière dont les applications de console sont hébergées dans Terminal ! Veuillez signaler tout bogue que vous rencontrez.
Terminal prend désormais en charge Sixels !
Vous pouvez maintenant ouvrir un panneau ancré contenant des extraits de commandes que vous avez enregistrées pour les utiliser ultérieurement
Les utilisateurs de linvite de commande sur la dernière version de Windows 11 peuvent voir une icône « astuce rapide » qui suggère un logiciel installable à partir de WinGet
Le texte sélectionné sera désormais beaucoup plus visible (et personnalisable !)
Un certain nombre de bogues de fiabilité, de problèmes de commodité et de désagréments ont été corrigés.
- Nous avons ajouté des dizaines de paramètres à linterface utilisateur qui nexistaient auparavant que dans le fichier JSON, y compris une nouvelle page pour personnaliser la disposition de votre menu Nouvel onglet.
- Nous avons fait une refonte de la gestion des fenêtres pour améliorer la fiabilité. Veuillez signaler les bogues que vous rencontrez avec lalias wt.exe.
- Les profils affichent désormais une icône sils ont été masqués ou sils font référence à des programmes qui ont été désinstallés.
Veuillez consulter notre page des versions GitHub pour découvrir dautres détails.
</ReleaseNotes>

View File

@@ -56,12 +56,9 @@ Si tratta di un progetto open source e la partecipazione della community è molt
<ReleaseNotes>
Versione __VERSION_NUMBER__
- Abbiamo cambiato il modo in cui le applicazioni della console vengono ospitate allinterno di Terminale. Segnala eventuali bug riscontrati.
- Ora Terminale supporta i Sixel.
- Puoi aprire un pannello ancorato contenente frammenti di comandi salvati per usarli in seguito
- Gli utenti che usano il prompt dei comandi nella versione più recente di Windows 11 potrebbero visualizzare unicona di “suggerimento rapido” che consiglia il software installabile da WinGet
- Il testo selezionato sarà ora molto più visibile, oltre che personalizzabile.
- Sono stati risolti diversi bug di affidabilità e problemi di ordine pratico.
- Abbiamo aggiunto decine di impostazioni all'interfaccia utente che in precedenza esistevano solo nel file JSON, inclusa una nuova pagina per personalizzare il layout del menu Nuova scheda.
- Abbiamo riprogettato la gestione delle finestre per migliorarne l'affidabilità; segnala eventuali bug riscontrati con l'alias wt.exe
- I profili ora mostrano un'icona se sono stati nascosti o se fanno riferimento a programmi disinstallati.
Per altri dettagli, vedi la pagina delle release di GitHub.
</ReleaseNotes>

View File

@@ -56,12 +56,9 @@
<ReleaseNotes>
バージョン __VERSION_NUMBER__
- ターミナル内でのコンソール アプリケーションのホスト方法を書き換えました。発生したバグを報告してください
- ターミナルで Sixels がサポートされるようになりました。
- 後で使用するために保存したコマンドのスニペットを含むドッキング パネルを開けるようになりました
- 最新の Windows 11 リリースのコマンド プロンプト ユーザーには、WinGet からインストール可能なソフトウェアを提案する "クイック ヒント" アイコンが表示される場合があります
- 選択したテキストが大幅に見やすくなりました (カスタマイズも可能です)
- 信頼性に関するバグ、利便性の問題、不快な問題の多くが修正されました。
- 新しいタブ メニューのレイアウトをカスタマイズするための新しいページなど、以前は JSON ファイルにしかなかった設定が UI に多数追加されました
- 信頼性を向上させるために、ウィンドウ管理を再設計しました。wt.exe エイリアスで発生したバグを報告してください
- プロファイルが非表示になっている場合や、アンインストールされたプログラムを参照している場合に、アイコンが表示されるようになりました
詳細については、GitHub リリース ページをご覧ください。
</ReleaseNotes>

View File

@@ -56,12 +56,9 @@
<ReleaseNotes>
버전 __VERSION_NUMBER__
- 콘솔 애플리케이션이 터미널 내에서 호스팅되는 방법을 다시 작성했습니다. 버그가 발생하면 보고해 주세요.
- 터미널에서 이제 Sixels를 지원합니다.
- 이제 나중에 사용하기 위해 저장한 명령 조각이 포함된 도킹된 패널을 열 수 있습니다.
- 최신 Windows 11 릴리스의 명령 프롬프트 사용자는 WinGet에서 설치 가능한 소프트웨어를 추천하는 "간단한 팁" 아이콘을 볼 수 있습니다.
- 이제 선택한 텍스트가 훨씬 더 잘 보입니다(사용자 지정 가능).
- 여러 안정성 버그, 편의성 문제, 불편 사항이 수정되었습니다.
- 새 탭 메뉴의 레이아웃을 사용자 지정하기 위한 새 페이지를 포함하여 JSON 파일에만 존재했던 수십 개의 설정을 UI에 추가
- 안정성을 개선하기 위해 창 관리 구조를 재구성했습니다. wt.exe 별칭과 관련하여 발생한 버그 신고
- 프로필이 숨겨졌거나 제거된 프로그램을 참조하는 경우 이제 프로필에 아이콘이 표시됩니다.
자세한 내용은 GitHub 릴리스 페이지를 참조하세요.
</ReleaseNotes>

View File

@@ -54,14 +54,11 @@ Este é um projeto de código aberto e a participação da comunidade é bem-vin
</DevStudio>
<ReleaseNotes>
Versão __VERSION_NUMBER__
Version __VERSION_NUMBER__
Reescrevemos a forma como os aplicativos de console são hospedados no Terminal! Relate os bugs encontrados.
O terminal agora oferece suporte ao Sixels!
Agora você pode abrir um painel acoplado contendo snippets de comandos que você salvou para usar mais tarde
Os usuários do Prompt de Comando na versão mais recente do Windows 11 podem ver um ícone de "dica rápida", que sugere softwares instaláveis a partir do WinGet
O texto selecionado agora ficará muito mais visível (e personalizável!)
Vários bugs de confiabilidade, problemas de conveniência e incômodos foram resolvidos.
Adicionamos várias configurações à interface do usuário que antes só existiam no arquivo JSON, incluindo uma nova página para personalizar o layout do seu menu Nova Guia!
Reestruturamos o gerenciamento de janelas para melhorar a confiabilidade; registre os bugs que você encontrar com o alias wt.exe
Os perfis agora exibem um ícone se estiverem ocultos ou se referirem a programas que foram desinstalados.
Confira nossa página de lançamentos no GitHub para obter mais detalhes.
</ReleaseNotes>

View File

@@ -56,14 +56,11 @@
<ReleaseNotes>
Vėѓѕіöй __VERSION_NUMBER__ !!! !!! !
- Ẁē'νё ŕéẁѓĭτťёñ ћοώ ĉòπşõℓε άррℓіċªťįõпѕ αяе ĥθѕťэđ įŋšιďé Ţєямїńąℓ! Рļéаšė яёροřτ αņу ьϋģš ýõμ éпćŏџήţęя. !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!
- Ţëямΐʼnαļ ńóẃ ŝüррöятš Śїхέłś! !!! !!! !!!
- ¥оų ĉåи ńòŵ θρėñ д đбčĸэď ράńέļ ċőлŧăīņϊňģ śⁿіφφëťś оƒ ςōмmàⁿďş ŷŏũ ĥªν℮ şåνěđ τσ üśε łαťэŗ !!! !!! !!! !!! !!! !!! !!! !!! !!!
- Ćοмmäлđ Рřōmφť üş℮ŗѕ öη τће ļāťëšτ Щīйđôώѕ 11 řёℓеаѕĕ måў ŝэε ά "qůïςκ ŧĭр" ιсôñ τĥдт šűğģєѕŧѕ ίńśŧăłłавļз šôƒţẁαгέ ƒґόm ЩĩйĞéţ !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!
- Śєļèċťєď ţĕжт ωϊŀļ йǿẃ ьέ mџ¢н мǿѓε νĭŝϊъļė (άŋđ сŭŝтŏмΐżдьļē!) !!! !!! !!! !!! !!! !!! !
- Ä ņϋmъŗ ŏƒ ѓēŀїаъïļŧÿ ьüĝś, ςôⁿνėηĭ℮иć℮ îѕšůëş ăπð âлňбγдňçėŝ ћªνε ъēёп ƒΐ×еð. !!! !!! !!! !!! !!! !!! !!! !!!
- Ẁē'νё àðđέď đöžзńş öƒ śėŧťїńģš тб тнè ÛĮ ťħąт ŏņ¢з όⁿℓγ έжіѕŧéð іή тђε ЈŠΩŃ ƒїℓė, ĭňĉŀџđіņģ å ňэẅ φâģé ƒøя ςŭśŧŏmïżϊñģ тħέ ĺαŷöυτ öƒ убµř Йέẁ Ţàъ мęήµ! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!
- Ẁè ĥаνė řэąřčħΐŧέсτέð щįлďοш мǻňαĝēмêиť ťô ϊmрябνé ŗĕŀĩāвîĺïтγ; ρŀěăѕе ƒíŀё αⁿу вûġš ÿøú εʼnćōùлťēѓ ẃïτħ ŧћё wt.exe ǻļĭâś !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!
- Рґøƒíŀêŝ ňöẁ šћθẁ ãй ĭčöñ ίƒ ŧħэŷ'νę ъеєл ђіðδэñ őř řєƒěґ ŧσ φяοġгаmŝ ẅђíçĥ ẁ℮гέ џňϊйşťàľĺèð. !!! !!! !!! !!! !!! !!! !!! !!! !!! !
Ρĺёàŝ℮ ŝез ǿúг ĢīťНŭъ řěłεαśèŝ φāğ℮ ƒóѓ дďδітĭøиąℓ ð℮тªїľŝ. !!! !!! !!! !!! !!! !!!
Рļèāŝє ŝèĕ θџŗ ĢίťĤцъ řέĺэªşэš ρąĝę ƒόř áďđїτϊōπαľ đэŧдįļŝ. !!! !!! !!! !!! !!! !!!
</ReleaseNotes>
<ScreenshotCaptions>
<!-- Valid length: 200 character limit, up to 9 elements per platform -->

View File

@@ -56,14 +56,11 @@
<ReleaseNotes>
Vėѓѕіöй __VERSION_NUMBER__ !!! !!! !
- Ẁē'νё ŕéẁѓĭτťёñ ћοώ ĉòπşõℓε άррℓіċªťįõпѕ αяе ĥθѕťэđ įŋšιďé Ţєямїńąℓ! Рļéаšė яёροřτ αņу ьϋģš ýõμ éпćŏџήţęя. !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!
- Ţëямΐʼnαļ ńóẃ ŝüррöятš Śїхέłś! !!! !!! !!!
- ¥оų ĉåи ńòŵ θρėñ д đбčĸэď ράńέļ ċőлŧăīņϊňģ śⁿіφφëťś оƒ ςōмmàⁿďş ŷŏũ ĥªν℮ şåνěđ τσ üśε łαťэŗ !!! !!! !!! !!! !!! !!! !!! !!! !!!
- Ćοмmäлđ Рřōmφť üş℮ŗѕ öη τће ļāťëšτ Щīйđôώѕ 11 řёℓеаѕĕ måў ŝэε ά "qůïςκ ŧĭр" ιсôñ τĥдт šűğģєѕŧѕ ίńśŧăłłавļз šôƒţẁαгέ ƒґόm ЩĩйĞéţ !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!
- Śєļèċťєď ţĕжт ωϊŀļ йǿẃ ьέ mџ¢н мǿѓε νĭŝϊъļė (άŋđ сŭŝтŏмΐżдьļē!) !!! !!! !!! !!! !!! !!! !
- Ä ņϋmъŗ ŏƒ ѓēŀїаъïļŧÿ ьüĝś, ςôⁿνėηĭ℮иć℮ îѕšůëş ăπð âлňбγдňçėŝ ћªνε ъēёп ƒΐ×еð. !!! !!! !!! !!! !!! !!! !!! !!!
- Ẁē'νё àðđέď đöžзńş öƒ śėŧťїńģš тб тнè ÛĮ ťħąт ŏņ¢з όⁿℓγ έжіѕŧéð іή тђε ЈŠΩŃ ƒїℓė, ĭňĉŀџđіņģ å ňэẅ φâģé ƒøя ςŭśŧŏmïżϊñģ тħέ ĺαŷöυτ öƒ убµř Йέẁ Ţàъ мęήµ! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!
- Ẁè ĥаνė řэąřčħΐŧέсτέð щįлďοш мǻňαĝēмêиť ťô ϊmрябνé ŗĕŀĩāвîĺïтγ; ρŀěăѕе ƒíŀё αⁿу вûġš ÿøú εʼnćōùлťēѓ ẃïτħ ŧћё wt.exe ǻļĭâś !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!
- Рґøƒíŀêŝ ňöẁ šћθẁ ãй ĭčöñ ίƒ ŧħэŷ'νę ъеєл ђіðδэñ őř řєƒěґ ŧσ φяοġгаmŝ ẅђíçĥ ẁ℮гέ џňϊйşťàľĺèð. !!! !!! !!! !!! !!! !!! !!! !!! !!! !
Ρĺёàŝ℮ ŝез ǿúг ĢīťНŭъ řěłεαśèŝ φāğ℮ ƒóѓ дďδітĭøиąℓ ð℮тªїľŝ. !!! !!! !!! !!! !!! !!!
Рļèāŝє ŝèĕ θџŗ ĢίťĤцъ řέĺэªşэš ρąĝę ƒόř áďđїτϊōπαľ đэŧдįļŝ. !!! !!! !!! !!! !!! !!!
</ReleaseNotes>
<ScreenshotCaptions>
<!-- Valid length: 200 character limit, up to 9 elements per platform -->

View File

@@ -56,14 +56,11 @@
<ReleaseNotes>
Vėѓѕіöй __VERSION_NUMBER__ !!! !!! !
- Ẁē'νё ŕéẁѓĭτťёñ ћοώ ĉòπşõℓε άррℓіċªťįõпѕ αяе ĥθѕťэđ įŋšιďé Ţєямїńąℓ! Рļéаšė яёροřτ αņу ьϋģš ýõμ éпćŏџήţęя. !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!
- Ţëямΐʼnαļ ńóẃ ŝüррöятš Śїхέłś! !!! !!! !!!
- ¥оų ĉåи ńòŵ θρėñ д đбčĸэď ράńέļ ċőлŧăīņϊňģ śⁿіφφëťś оƒ ςōмmàⁿďş ŷŏũ ĥªν℮ şåνěđ τσ üśε łαťэŗ !!! !!! !!! !!! !!! !!! !!! !!! !!!
- Ćοмmäлđ Рřōmφť üş℮ŗѕ öη τће ļāťëšτ Щīйđôώѕ 11 řёℓеаѕĕ måў ŝэε ά "qůïςκ ŧĭр" ιсôñ τĥдт šűğģєѕŧѕ ίńśŧăłłавļз šôƒţẁαгέ ƒґόm ЩĩйĞéţ !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!
- Śєļèċťєď ţĕжт ωϊŀļ йǿẃ ьέ mџ¢н мǿѓε νĭŝϊъļė (άŋđ сŭŝтŏмΐżдьļē!) !!! !!! !!! !!! !!! !!! !
- Ä ņϋmъŗ ŏƒ ѓēŀїаъïļŧÿ ьüĝś, ςôⁿνėηĭ℮иć℮ îѕšůëş ăπð âлňбγдňçėŝ ћªνε ъēёп ƒΐ×еð. !!! !!! !!! !!! !!! !!! !!! !!!
- Ẁē'νё àðđέď đöžзńş öƒ śėŧťїńģš тб тнè ÛĮ ťħąт ŏņ¢з όⁿℓγ έжіѕŧéð іή тђε ЈŠΩŃ ƒїℓė, ĭňĉŀџđіņģ å ňэẅ φâģé ƒøя ςŭśŧŏmïżϊñģ тħέ ĺαŷöυτ öƒ убµř Йέẁ Ţàъ мęήµ! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!
- Ẁè ĥаνė řэąřčħΐŧέсτέð щįлďοш мǻňαĝēмêиť ťô ϊmрябνé ŗĕŀĩāвîĺïтγ; ρŀěăѕе ƒíŀё αⁿу вûġš ÿøú εʼnćōùлťēѓ ẃïτħ ŧћё wt.exe ǻļĭâś !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!
- Рґøƒíŀêŝ ňöẁ šћθẁ ãй ĭčöñ ίƒ ŧħэŷ'νę ъеєл ђіðδэñ őř řєƒěґ ŧσ φяοġгаmŝ ẅђíçĥ ẁ℮гέ џňϊйşťàľĺèð. !!! !!! !!! !!! !!! !!! !!! !!! !!! !
Ρĺёàŝ℮ ŝез ǿúг ĢīťНŭъ řěłεαśèŝ φāğ℮ ƒóѓ дďδітĭøиąℓ ð℮тªїľŝ. !!! !!! !!! !!! !!! !!!
Рļèāŝє ŝèĕ θџŗ ĢίťĤцъ řέĺэªşэš ρąĝę ƒόř áďđїτϊōπαľ đэŧдįļŝ. !!! !!! !!! !!! !!! !!!
</ReleaseNotes>
<ScreenshotCaptions>
<!-- Valid length: 200 character limit, up to 9 elements per platform -->

View File

@@ -56,12 +56,9 @@
<ReleaseNotes>
Версия __VERSION_NUMBER__
Мы переписали, как консольные приложения размещаются внутри Терминала! Сообщайте о любых ошибках, с которыми вы столкнулись.
Терминал теперь поддерживает форматы Sixel!
Теперь вы можете открыть закрепленную панель, содержащую фрагменты команд, которые вы сохранили для использования в дальнейшем
Пользователи командной строки в новейшем выпуске Windows 11 могут увидеть значок "краткой подсказки", который предлагает устанавливаемые программы из WinGet
Выделенный текст теперь станет более видимым (и настраиваемым!)
Исправлено несколько ошибок надежности, проблем с удобством, а также устранены раздражающие моменты.
Мы добавили в пользовательский интерфейс десятки параметров, которые ранее существовали только в JSON-файле, включая новую страницу для настройки макета меню новой вкладки.
Мы переработали управление окнами для повышения надежности. Сообщайте о любых ошибках, которые вы обнаружите с псевдонимом wt.exe
Профили теперь отображают значок, если они были скрыты или ссылаются на программы, которые были удалены.
Дополнительные сведения см. на странице выпусков GitHub.
</ReleaseNotes>

View File

@@ -56,12 +56,9 @@
<ReleaseNotes>
Version __VERSION_NUMBER__
- 我们已改变主机应用程序在终端内的托管方式!请报告遇到的任何 bug。
- 终端现在支持 Sixels!
- 现在可以打开一个停靠面板,其中包含已保存供以后使用的命令片段
- 最新 Windows 11 版本上的命令提示用户可能会看到“快速提示”图标,该图标建议从 WinGet 安装软件
- 所选文本现在将具有更高的可见性(和可自定义性!)
- 修复了许多可靠性 bug、便利性问题和令人烦恼的问题。
- 我们向用户界面添加了许多之前仅存在于 JSON 文件中的设置,包括用于自定义“新建标签页”菜单布局的新页面!
- 我们已重新架构窗口管理以提高可靠性; 请使用 wt.exe 别名提交您遇到的任何错误
- 配置文件如果已被隐藏或引用了已卸载的程序,现在会显示一个图标。
有关其他详细信息,请参阅我们的 GitHub 发布页面。
</ReleaseNotes>

View File

@@ -54,16 +54,13 @@
</DevStudio>
<ReleaseNotes>
版本 __VERSION_NUMBER__
Version __VERSION_NUMBER__
- 我們已重寫主機應用程式在終端機內託管的方式!請報告您遇到的錯誤。
- 終端機現在支援 Sixels!
- 現在,您可以開啟包含已儲存命令程式碼片段的固定面板,以供稍後使用
- 最新 Windows 11 版本中的 [命令提示] 使用者可能會看到「快速提示」圖示,建議可自 WinGet 安裝的軟體
- 選取的文字現在會更明顯 (且可自訂!)
- 已修正一些可靠性錯誤、便利性問題和令人困擾的問題。
- 我們已在使用者介面中新增數十個曾經僅存在於 JSON 檔案中的設定,包括一個可自訂新索引標籤選單版面配置的新頁面!
- 我們已重新架構視窗管理以提升可靠性; 如果您在使用 wt.exe 別名時遇到任何錯誤,請提交錯誤回報
- 如果設定檔已隱藏或參照已解除安裝的程式,現在會顯示圖示。
如需更多詳細資,請參閱我們的 GitHub 發行頁面。
如需更多詳細資,請參閱我們的 GitHub 發行版本頁面。
</ReleaseNotes>
<ScreenshotCaptions>
<!-- Valid length: 200 character limit, up to 9 elements per platform -->

View File

@@ -17,6 +17,7 @@
"PackageContents/WindowsTerminalShellExt.dll",
// The rest
"PackageContents/TerminalAzBridge.exe",
"PackageContents/wt.exe",
"PackageContents/WindowsTerminal.exe",
"PackageContents/elevate-shim.exe"

View File

@@ -9,7 +9,7 @@
<PropertyGroup>
<!-- Optional, defaults to main. Name of the branch which will be used for calculating branch point. -->
<PGOBranch>release-1.24</PGOBranch>
<PGOBranch>main</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

@@ -51,8 +51,8 @@ steps:
displayName: 'Touchdown Build - 7105, PRODEXT'
inputs:
teamId: 7105
TDBuildServiceConnection: $(TouchdownServiceConnection)
authType: SubjectNameIssuer
FederatedIdentityTDBuildServiceConnection: $(TouchdownServiceConnection)
authType: FederatedIdentityTDBuild
resourceFilePath: |
**\en-US\*.resw
build\StoreSubmission\Stable\PDPs\en-us\PDP.xml

View File

@@ -50,7 +50,6 @@ stages:
buildEverything: true
pgoBuildMode: Instrument
artifactStem: -instrumentation
keepAllExpensiveBuildOutputs: false # the ARM64 build agent runs out of memory downloading the artifacts...
- stage: RunPGO
displayName: Run PGO

View File

@@ -75,9 +75,9 @@ jobs:
- template: .\steps-restore-nuget.yml
- task: VSBuild@1
displayName: Build solution OpenConsole.sln for WPF Control (Pack)
displayName: Build solution OpenConsole.slnx for WPF Control (Pack)
inputs:
solution: 'OpenConsole.sln'
solution: 'OpenConsole.slnx'
msbuildArgs: >-
/p:WindowsTerminalReleaseBuild=true;Version=$(XES_PACKAGEVERSIONNUMBER)
/p:NoBuild=true

View File

@@ -170,9 +170,9 @@ jobs:
- ${{ parameters.beforeBuildSteps }}
- task: VSBuild@1
displayName: Build OpenConsole.sln
displayName: Build OpenConsole.slnx
inputs:
solution: 'OpenConsole.sln'
solution: 'OpenConsole.slnx'
msbuildArgs: >-
/p:WindowsTerminalOfficialBuild=true;WindowsTerminalBranding=${{ parameters.branding }};PGOBuildMode=${{ parameters.pgoBuildMode }}
${{ parameters.additionalBuildOptions }}

View File

@@ -26,7 +26,6 @@ jobs:
pgoToolsPath: $(Build.SourcesDirectory)\build\PGO
nuspecPath: $(pgoToolsPath)\NuSpecs
nuspecFilename: PGO.nuspec
nugetFeed: "https://pkgs.dev.azure.com/shine-oss/terminal/_packaging/TerminalDependencies/nuget/v3/index.json"
steps:
- checkout: self
@@ -46,8 +45,7 @@ jobs:
- task: NuGetAuthenticate@1
inputs:
azureDevOpsServiceConnection: 'Terminal Public Artifact Feed'
feedUrl: $(nugetFeed)
nuGetServiceConnections: 'Terminal Public Artifact Feed'
# In the Microsoft Azure DevOps tenant, NuGetCommand is ambiguous.
# This should be `task: NuGetCommand@2`
@@ -70,7 +68,15 @@ jobs:
artifact: pgo-nupkg-${{ parameters.buildConfiguration }}${{ parameters.artifactStem }}
displayName: "Publish Pipeline Artifact"
- pwsh: |-
$nupkg = Get-Item "$(Build.ArtifactStagingDirectory)/*.nupkg"
& nuget push -ApiKey az -Source "$(nugetFeed)" "$nupkg"
displayName: NuGet push
- task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2
displayName: 'NuGet push'
inputs:
command: push
nuGetFeedType: external
packagesToPush: $(Build.ArtifactStagingDirectory)/*.nupkg
# The actual URL and PAT for this feed is configured at
# https://microsoft.visualstudio.com/Dart/_settings/adminservices
# This is the name of that connection
publishFeedCredentials: 'Terminal Public Artifact Feed'
feedsToUse: config
nugetConfigPath: '$(Build.SourcesDirectory)/NuGet.config'

View File

@@ -45,10 +45,6 @@ jobs:
displayName: Extract the unpackaged build for PGO
- template: steps-ensure-nuget-version.yml
parameters:
${{ if eq(parameters.buildPlatform, 'arm64') }}:
# The ARM64 agents do not seem to have NuGet installed
forceNugetInstallation: true
- powershell: |-
$Package = 'Microsoft.Internal.Windows.Terminal.TestContent'

View File

@@ -210,8 +210,6 @@ extends:
ob_createvpack_taskLogVerbosity: Detailed
ob_createvpack_verbose: true
ob_createvpack_vpackdirectory: '$(JobOutputDirectory)\vpack'
ob_createvpack_versionAs: string
ob_createvpack_version: '$(XES_PACKAGEVERSIONNUMBER)'
ob_updateOSManifest_gitcheckinConfigPath: '$(Build.SourcesDirectory)\build\config\GitCheckin.json'
# We're skipping the 'fetch' part of the OneBranch rules, but that doesn't mean
# that it doesn't expect to have downloaded a manifest directly to some 'destination'

View File

@@ -1,10 +1,5 @@
parameters:
- name: forceNugetInstallation
type: boolean
default: false
steps:
- ${{ if and(ne(parameters.forceNugetInstallation, true), eq(variables['System.CollectionId'], 'cb55739e-4afe-46a3-970f-1b49d8ee7564')) }}:
- ${{ if eq(variables['System.CollectionId'], 'cb55739e-4afe-46a3-970f-1b49d8ee7564') }}:
- pwsh: |-
Write-Host "Assuming NuGet is already installed..."
& nuget.exe help
@@ -12,6 +7,6 @@ steps:
- ${{ else }}:
- task: NuGetToolInstaller@1
displayName: Use NuGet 7.0.1
displayName: Use NuGet 6.6.1
inputs:
versionSpec: 7.0.1
versionSpec: 6.6.1

View File

@@ -19,14 +19,16 @@ steps:
restoreSolution: build/packages.config
restoreDirectory: '$(Build.SourcesDirectory)\packages'
- task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2
- task: VSBuild@1
displayName: Restore NuGet packages for solution
inputs:
command: restore
feedsToUse: config
configPath: NuGet.config
restoreSolution: OpenConsole.sln
restoreDirectory: '$(Build.SourcesDirectory)\packages'
solution: 'OpenConsole.slnx'
msbuildArgs: /t:Restore
platform: $(BuildPlatform)
configuration: $(BuildConfiguration)
msbuildArchitecture: x64
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
- task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2
displayName: Restore NuGet packages for global nuget

View File

@@ -5,7 +5,7 @@
<XesUseOneStoreVersioning>true</XesUseOneStoreVersioning>
<XesBaseYearForStoreVersion>2025</XesBaseYearForStoreVersion>
<VersionMajor>1</VersionMajor>
<VersionMinor>24</VersionMinor>
<VersionMinor>25</VersionMinor>
<VersionInfoProductName>Windows Terminal</VersionInfoProductName>
<VersionInfoCulture>1033</VersionInfoCulture>
<!-- The default has a spacing problem -->

View File

@@ -7,9 +7,17 @@ Licensed under the MIT license.
#include <ntcsrmsg.h>
#ifdef __cplusplus
extern "C" {
#endif
NTSTATUS CsrClientCallServer(
PCSR_API_MSG m,
PCSR_CAPTURE_HEADER CaptureBuffer OPTIONAL,
ULONG ApiNumber,
ULONG ArgLength
);
#ifdef __cplusplus
}
#endif

View File

@@ -5,6 +5,10 @@ Licensed under the MIT license.
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
#define OB_FILE_OBJECT_TYPE 1
typedef struct _PORT_MESSAGE {
@@ -124,3 +128,7 @@ NTSTATUS NtAlpcQueryInformationMessage(
ULONG Length,
PULONG ReturnLength
);
#ifdef __cplusplus
}
#endif

View File

@@ -7,7 +7,7 @@ This repository uses [git submodules](https://git-scm.com/book/en/v2/Git-Tools-S
git submodule update --init --recursive
```
OpenConsole.sln may be built from within Visual Studio or from the command-line using a set of convenience scripts & tools in the **/tools** directory:
OpenConsole.slnx may be built from within Visual Studio or from the command-line using a set of convenience scripts & tools in the **/tools** directory:
When using Visual Studio, be sure to set up the path for code formatting. To download the required clang-format.exe file, follow one of the building instructions below and run:
```powershell
@@ -103,7 +103,7 @@ If you want to use .nupkg files instead of the downloaded Nuget package, you can
The Terminal is bundled as an `.msix`, which is produced by the `CascadiaPackage.wapproj` project. To build that project from the commandline, you can run the following (from a window you've already run `tools\razzle.cmd` in):
```cmd
"%msbuild%" "%OPENCON%\OpenConsole.sln" /p:Configuration=%_LAST_BUILD_CONF% /p:Platform=%ARCH% /p:AppxSymbolPackageEnabled=false /t:Terminal\CascadiaPackage /m
"%msbuild%" "%OPENCON%\OpenConsole.slnx" /p:Configuration=%_LAST_BUILD_CONF% /p:Platform=%ARCH% /p:AppxSymbolPackageEnabled=false /t:Terminal\CascadiaPackage /m
```
This takes quite some time, and only generates an `msix`. It does not install the msix. To deploy the package:

View File

@@ -13,7 +13,6 @@
// - ulSize - The height of the cursor within this buffer
Cursor::Cursor(const ULONG ulSize, TextBuffer& parentBuffer) noexcept :
_parentBuffer{ parentBuffer },
_fHasMoved(false),
_fIsVisible(true),
_fIsOn(true),
_fIsDouble(false),
@@ -35,11 +34,6 @@ til::point Cursor::GetPosition() const noexcept
return _cPosition;
}
bool Cursor::HasMoved() const noexcept
{
return _fHasMoved;
}
bool Cursor::IsVisible() const noexcept
{
return _fIsVisible;
@@ -75,11 +69,6 @@ ULONG Cursor::GetSize() const noexcept
return _ulSize;
}
void Cursor::SetHasMoved(const bool fHasMoved) noexcept
{
_fHasMoved = fHasMoved;
}
void Cursor::SetIsVisible(const bool fIsVisible) noexcept
{
_fIsVisible = fIsVisible;
@@ -249,7 +238,6 @@ void Cursor::CopyProperties(const Cursor& OtherCursor) noexcept
// We shouldn't copy the position as it will be already rearranged by the resize operation.
//_cPosition = pOtherCursor->_cPosition;
_fHasMoved = OtherCursor._fHasMoved;
_fIsVisible = OtherCursor._fIsVisible;
_fIsOn = OtherCursor._fIsOn;
_fIsDouble = OtherCursor._fIsDouble;

View File

@@ -38,7 +38,6 @@ public:
Cursor(Cursor&&) = default;
Cursor& operator=(Cursor&&) & = delete;
bool HasMoved() const noexcept;
bool IsVisible() const noexcept;
bool IsOn() const noexcept;
bool IsBlinkingAllowed() const noexcept;
@@ -54,7 +53,6 @@ public:
bool IsDeferDrawing() noexcept;
void EndDeferDrawing() noexcept;
void SetHasMoved(const bool fHasMoved) noexcept;
void SetIsVisible(const bool fIsVisible) noexcept;
void SetIsOn(const bool fIsOn) noexcept;
void SetBlinkingAllowed(const bool fIsOn) noexcept;
@@ -90,7 +88,6 @@ private:
til::point _cPosition; // current position on screen (in screen buffer coords).
bool _fHasMoved;
bool _fIsVisible; // whether cursor is visible (set only through the API)
bool _fIsOn; // whether blinking cursor is on or not
bool _fIsDouble; // whether the cursor size should be doubled

View File

@@ -77,6 +77,9 @@
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\WindowsTerminal\WindowsTerminal.vcxproj">
<Project>{CA5CAD1A-1754-4A9D-93D7-857A9D17CB1B}</Project>
</ProjectReference>
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalAzBridge\TerminalAzBridge.vcxproj">
<Project>{067F0A06-FCB7-472C-96E9-B03B54E8E18D}</Project>
</ProjectReference>
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\ShellExtension\WindowsTerminalShellExt.vcxproj">
<Project>{f2ed628a-db22-446f-a081-4cc845b51a2b}</Project>
</ProjectReference>

View File

@@ -5,12 +5,14 @@
#include "../TerminalApp/TerminalPage.h"
#include "../UnitTests_SettingsModel/TestUtils.h"
#include "../TerminalSettingsAppAdapterLib/TerminalSettings.h"
using namespace Microsoft::Console;
using namespace WEX::Logging;
using namespace WEX::TestExecution;
using namespace WEX::Common;
using namespace winrt::TerminalApp;
using namespace winrt::Microsoft::Terminal::Settings;
using namespace winrt::Microsoft::Terminal::Settings::Model;
using namespace winrt::Microsoft::Terminal::Control;
@@ -1419,10 +1421,10 @@ namespace TerminalAppLocalTests
VERIFY_ARE_EQUAL(L"profile0", terminalArgs.Profile());
VERIFY_IS_NULL(terminalArgs.Elevate());
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs, nullptr);
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs);
const auto termSettings = termSettingsResult.DefaultSettings();
VERIFY_ARE_EQUAL(L"cmd.exe", termSettings.Commandline());
VERIFY_ARE_EQUAL(false, termSettings.Elevate());
VERIFY_ARE_EQUAL(L"cmd.exe", termSettings->Commandline());
VERIFY_ARE_EQUAL(false, termSettings->Elevate());
}
{
Log::Comment(L"profile.elevate=true, action.elevate=nullopt: DO auto elevate");
@@ -1442,10 +1444,10 @@ namespace TerminalAppLocalTests
VERIFY_ARE_EQUAL(L"profile1", terminalArgs.Profile());
VERIFY_IS_NULL(terminalArgs.Elevate());
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs, nullptr);
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs);
const auto termSettings = termSettingsResult.DefaultSettings();
VERIFY_ARE_EQUAL(L"pwsh.exe", termSettings.Commandline());
VERIFY_ARE_EQUAL(true, termSettings.Elevate());
VERIFY_ARE_EQUAL(L"pwsh.exe", termSettings->Commandline());
VERIFY_ARE_EQUAL(true, termSettings->Elevate());
}
{
Log::Comment(L"profile.elevate=false, action.elevate=nullopt: don't auto elevate");
@@ -1465,10 +1467,10 @@ namespace TerminalAppLocalTests
VERIFY_ARE_EQUAL(L"profile2", terminalArgs.Profile());
VERIFY_IS_NULL(terminalArgs.Elevate());
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs, nullptr);
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs);
const auto termSettings = termSettingsResult.DefaultSettings();
VERIFY_ARE_EQUAL(L"wsl.exe", termSettings.Commandline());
VERIFY_ARE_EQUAL(false, termSettings.Elevate());
VERIFY_ARE_EQUAL(L"wsl.exe", termSettings->Commandline());
VERIFY_ARE_EQUAL(false, termSettings->Elevate());
}
{
@@ -1490,10 +1492,10 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(terminalArgs.Elevate());
VERIFY_IS_FALSE(terminalArgs.Elevate().Value());
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs, nullptr);
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs);
const auto termSettings = termSettingsResult.DefaultSettings();
VERIFY_ARE_EQUAL(L"cmd.exe", termSettings.Commandline());
VERIFY_ARE_EQUAL(false, termSettings.Elevate());
VERIFY_ARE_EQUAL(L"cmd.exe", termSettings->Commandline());
VERIFY_ARE_EQUAL(false, termSettings->Elevate());
}
{
Log::Comment(L"profile.elevate=true, action.elevate=false: don't auto elevate");
@@ -1514,10 +1516,10 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(terminalArgs.Elevate());
VERIFY_IS_FALSE(terminalArgs.Elevate().Value());
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs, nullptr);
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs);
const auto termSettings = termSettingsResult.DefaultSettings();
VERIFY_ARE_EQUAL(L"pwsh.exe", termSettings.Commandline());
VERIFY_ARE_EQUAL(false, termSettings.Elevate());
VERIFY_ARE_EQUAL(L"pwsh.exe", termSettings->Commandline());
VERIFY_ARE_EQUAL(false, termSettings->Elevate());
}
{
Log::Comment(L"profile.elevate=false, action.elevate=false: don't auto elevate");
@@ -1538,10 +1540,10 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(terminalArgs.Elevate());
VERIFY_IS_FALSE(terminalArgs.Elevate().Value());
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs, nullptr);
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs);
const auto termSettings = termSettingsResult.DefaultSettings();
VERIFY_ARE_EQUAL(L"wsl.exe", termSettings.Commandline());
VERIFY_ARE_EQUAL(false, termSettings.Elevate());
VERIFY_ARE_EQUAL(L"wsl.exe", termSettings->Commandline());
VERIFY_ARE_EQUAL(false, termSettings->Elevate());
}
{
@@ -1563,10 +1565,10 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(terminalArgs.Elevate());
VERIFY_IS_TRUE(terminalArgs.Elevate().Value());
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs, nullptr);
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs);
const auto termSettings = termSettingsResult.DefaultSettings();
VERIFY_ARE_EQUAL(L"cmd.exe", termSettings.Commandline());
VERIFY_ARE_EQUAL(true, termSettings.Elevate());
VERIFY_ARE_EQUAL(L"cmd.exe", termSettings->Commandline());
VERIFY_ARE_EQUAL(true, termSettings->Elevate());
}
{
Log::Comment(L"profile.elevate=true, action.elevate=true: DO auto elevate");
@@ -1586,10 +1588,10 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(terminalArgs.Elevate());
VERIFY_IS_TRUE(terminalArgs.Elevate().Value());
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs, nullptr);
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs);
const auto termSettings = termSettingsResult.DefaultSettings();
VERIFY_ARE_EQUAL(L"pwsh.exe", termSettings.Commandline());
VERIFY_ARE_EQUAL(true, termSettings.Elevate());
VERIFY_ARE_EQUAL(L"pwsh.exe", termSettings->Commandline());
VERIFY_ARE_EQUAL(true, termSettings->Elevate());
}
{
Log::Comment(L"profile.elevate=false, action.elevate=true: DO auto elevate");
@@ -1610,10 +1612,10 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(terminalArgs.Elevate());
VERIFY_IS_TRUE(terminalArgs.Elevate().Value());
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs, nullptr);
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs);
const auto termSettings = termSettingsResult.DefaultSettings();
VERIFY_ARE_EQUAL(L"wsl.exe", termSettings.Commandline());
VERIFY_ARE_EQUAL(true, termSettings.Elevate());
VERIFY_ARE_EQUAL(L"wsl.exe", termSettings->Commandline());
VERIFY_ARE_EQUAL(true, termSettings->Elevate());
}
}

View File

@@ -66,7 +66,6 @@ namespace TerminalAppLocalTests
// can help you identify if something much lower in the stack has
// failed.
TEST_METHOD(EnsureTestsActivate);
TEST_METHOD(TryCreateSettingsType);
TEST_METHOD(TryCreateConnectionType);
TEST_METHOD(TryCreateXamlObjects);
@@ -131,23 +130,12 @@ namespace TerminalAppLocalTests
VERIFY_IS_TRUE(true);
}
void TabTests::TryCreateSettingsType()
{
// Verify we can create a WinRT type we authored
// Just creating it is enough to know that everything is working.
TerminalSettings settings;
VERIFY_IS_NOT_NULL(settings);
}
void TabTests::TryCreateConnectionType()
{
// Verify we can create a WinRT type we authored
// Just creating it is enough to know that everything is working.
winrt::Microsoft::Terminal::TerminalConnection::EchoConnection conn{};
VERIFY_IS_NOT_NULL(conn);
// We're doing this test separately from the TryCreateSettingsType test,
// to ensure both dependent binaries (TerminalSettings and
// TerminalConnection) both work individually.
}
void TabTests::TryCreateXamlObjects()
@@ -1306,6 +1294,15 @@ namespace TerminalAppLocalTests
});
}
static til::color _getControlBackgroundColor(winrt::TerminalApp::implementation::ContentManager* contentManager,
const winrt::Microsoft::Terminal::Control::TermControl& c)
{
auto interactivity{ contentManager->TryLookupCore(c.ContentId()) };
VERIFY_IS_NOT_NULL(interactivity);
const auto core{ interactivity.Core() };
return til::color{ core.BackgroundColor() };
}
void TabTests::TestPreviewCommitScheme()
{
Log::Comment(L"Preview a color scheme. Make sure it's applied, then committed accordingly");
@@ -1313,14 +1310,12 @@ namespace TerminalAppLocalTests
auto page = _commonSetup();
VERIFY_IS_NOT_NULL(page);
TestOnUIThread([&page]() {
TestOnUIThread([&page, this]() {
const auto& activeControl{ page->_GetActiveControl() };
VERIFY_IS_NOT_NULL(activeControl);
const auto& controlSettings = activeControl.Settings();
VERIFY_IS_NOT_NULL(controlSettings);
VERIFY_ARE_EQUAL(til::color{ 0xff0c0c0c }, til::color{ controlSettings.DefaultBackground() });
const auto backgroundColor{ _getControlBackgroundColor(_contentManager.get(), activeControl) };
VERIFY_ARE_EQUAL(til::color{ 0xff0c0c0c }, backgroundColor);
});
TestOnUIThread([&page]() {
@@ -1330,15 +1325,13 @@ namespace TerminalAppLocalTests
page->_PreviewAction(actionAndArgs);
});
TestOnUIThread([&page]() {
TestOnUIThread([&page, this]() {
const auto& activeControl{ page->_GetActiveControl() };
VERIFY_IS_NOT_NULL(activeControl);
const auto& controlSettings = activeControl.Settings();
VERIFY_IS_NOT_NULL(controlSettings);
Log::Comment(L"Color should be changed to the preview");
VERIFY_ARE_EQUAL(til::color{ 0xff000000 }, til::color{ controlSettings.DefaultBackground() });
const auto backgroundColor{ _getControlBackgroundColor(_contentManager.get(), activeControl) };
VERIFY_ARE_EQUAL(til::color{ 0xff000000 }, backgroundColor);
// And we should have stored a function to revert the change.
VERIFY_ARE_EQUAL(1u, page->_restorePreviewFuncs.size());
@@ -1352,15 +1345,13 @@ namespace TerminalAppLocalTests
page->_HandleSetColorScheme(nullptr, ActionEventArgs{ args });
});
TestOnUIThread([&page]() {
TestOnUIThread([&page, this]() {
const auto& activeControl{ page->_GetActiveControl() };
VERIFY_IS_NOT_NULL(activeControl);
const auto& controlSettings = activeControl.Settings();
VERIFY_IS_NOT_NULL(controlSettings);
Log::Comment(L"Color should be changed");
VERIFY_ARE_EQUAL(til::color{ 0xff000000 }, til::color{ controlSettings.DefaultBackground() });
const auto backgroundColor{ _getControlBackgroundColor(_contentManager.get(), activeControl) };
VERIFY_ARE_EQUAL(til::color{ 0xff000000 }, backgroundColor);
// After preview there should be no more restore functions to execute.
VERIFY_ARE_EQUAL(0u, page->_restorePreviewFuncs.size());
@@ -1381,14 +1372,12 @@ namespace TerminalAppLocalTests
auto page = _commonSetup();
VERIFY_IS_NOT_NULL(page);
TestOnUIThread([&page]() {
TestOnUIThread([&page, this]() {
const auto& activeControl{ page->_GetActiveControl() };
VERIFY_IS_NOT_NULL(activeControl);
const auto& controlSettings = activeControl.Settings();
VERIFY_IS_NOT_NULL(controlSettings);
VERIFY_ARE_EQUAL(til::color{ 0xff0c0c0c }, til::color{ controlSettings.DefaultBackground() });
const auto backgroundColor{ _getControlBackgroundColor(_contentManager.get(), activeControl) };
VERIFY_ARE_EQUAL(til::color{ 0xff0c0c0c }, backgroundColor);
});
TestOnUIThread([&page]() {
@@ -1398,15 +1387,13 @@ namespace TerminalAppLocalTests
page->_PreviewAction(actionAndArgs);
});
TestOnUIThread([&page]() {
TestOnUIThread([&page, this]() {
const auto& activeControl{ page->_GetActiveControl() };
VERIFY_IS_NOT_NULL(activeControl);
const auto& controlSettings = activeControl.Settings();
VERIFY_IS_NOT_NULL(controlSettings);
Log::Comment(L"Color should be changed to the preview");
VERIFY_ARE_EQUAL(til::color{ 0xff000000 }, til::color{ controlSettings.DefaultBackground() });
const auto backgroundColor{ _getControlBackgroundColor(_contentManager.get(), activeControl) };
VERIFY_ARE_EQUAL(til::color{ 0xff000000 }, backgroundColor);
});
TestOnUIThread([&page]() {
@@ -1414,15 +1401,13 @@ namespace TerminalAppLocalTests
page->_EndPreview();
});
TestOnUIThread([&page]() {
TestOnUIThread([&page, this]() {
const auto& activeControl{ page->_GetActiveControl() };
VERIFY_IS_NOT_NULL(activeControl);
const auto& controlSettings = activeControl.Settings();
VERIFY_IS_NOT_NULL(controlSettings);
Log::Comment(L"Color should be the same as it originally was");
VERIFY_ARE_EQUAL(til::color{ 0xff0c0c0c }, til::color{ controlSettings.DefaultBackground() });
const auto backgroundColor{ _getControlBackgroundColor(_contentManager.get(), activeControl) };
VERIFY_ARE_EQUAL(til::color{ 0xff0c0c0c }, backgroundColor);
});
Log::Comment(L"Sleep to let events propagate");
Sleep(250);
@@ -1437,14 +1422,12 @@ namespace TerminalAppLocalTests
auto page = _commonSetup();
VERIFY_IS_NOT_NULL(page);
TestOnUIThread([&page]() {
TestOnUIThread([&page, this]() {
const auto& activeControl{ page->_GetActiveControl() };
VERIFY_IS_NOT_NULL(activeControl);
const auto& controlSettings = activeControl.Settings();
VERIFY_IS_NOT_NULL(controlSettings);
VERIFY_ARE_EQUAL(til::color{ 0xff0c0c0c }, til::color{ controlSettings.DefaultBackground() });
const auto backgroundColor{ _getControlBackgroundColor(_contentManager.get(), activeControl) };
VERIFY_ARE_EQUAL(til::color{ 0xff0c0c0c }, backgroundColor);
});
TestOnUIThread([&page]() {
@@ -1453,15 +1436,13 @@ namespace TerminalAppLocalTests
page->_PreviewColorScheme(args);
});
TestOnUIThread([&page]() {
TestOnUIThread([&page, this]() {
const auto& activeControl{ page->_GetActiveControl() };
VERIFY_IS_NOT_NULL(activeControl);
const auto& controlSettings = activeControl.Settings();
VERIFY_IS_NOT_NULL(controlSettings);
Log::Comment(L"Color should be changed to the preview");
VERIFY_ARE_EQUAL(til::color{ 0xff000000 }, til::color{ controlSettings.DefaultBackground() });
const auto backgroundColor{ _getControlBackgroundColor(_contentManager.get(), activeControl) };
VERIFY_ARE_EQUAL(til::color{ 0xff000000 }, backgroundColor);
});
TestOnUIThread([&page]() {
@@ -1470,15 +1451,13 @@ namespace TerminalAppLocalTests
page->_PreviewColorScheme(args);
});
TestOnUIThread([&page]() {
TestOnUIThread([&page, this]() {
const auto& activeControl{ page->_GetActiveControl() };
VERIFY_IS_NOT_NULL(activeControl);
const auto& controlSettings = activeControl.Settings();
VERIFY_IS_NOT_NULL(controlSettings);
Log::Comment(L"Color should be changed to the preview");
VERIFY_ARE_EQUAL(til::color{ 0xffFAFAFA }, til::color{ controlSettings.DefaultBackground() });
const auto backgroundColor{ _getControlBackgroundColor(_contentManager.get(), activeControl) };
VERIFY_ARE_EQUAL(til::color{ 0xffFAFAFA }, backgroundColor);
});
TestOnUIThread([&page]() {
@@ -1489,15 +1468,13 @@ namespace TerminalAppLocalTests
page->_HandleSetColorScheme(nullptr, ActionEventArgs{ args });
});
TestOnUIThread([&page]() {
TestOnUIThread([&page, this]() {
const auto& activeControl{ page->_GetActiveControl() };
VERIFY_IS_NOT_NULL(activeControl);
const auto& controlSettings = activeControl.Settings();
VERIFY_IS_NOT_NULL(controlSettings);
Log::Comment(L"Color should be changed");
VERIFY_ARE_EQUAL(til::color{ 0xffFAFAFA }, til::color{ controlSettings.DefaultBackground() });
const auto backgroundColor{ _getControlBackgroundColor(_contentManager.get(), activeControl) };
VERIFY_ARE_EQUAL(til::color{ 0xffFAFAFA }, backgroundColor);
});
Log::Comment(L"Sleep to let events propagate");
Sleep(250);

View File

@@ -60,6 +60,9 @@
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalConnection\TerminalConnection.vcxproj" />
<ProjectReference Include="$(OpenConsoleDir)\src\cascadia\TerminalApp\dll\TerminalApp.vcxproj" />
<ProjectReference Include="$(OpenConsoleDir)\src\cascadia\TerminalSettingsModel\dll\Microsoft.Terminal.Settings.Model.vcxproj" />
<ProjectReference Include="$(OpenConsoleDir)\src\cascadia\TerminalSettingsAppAdapterLib\TerminalSettingsAppAdapterLib.vcxproj">
<Project>{3c46e2b0-ae6c-4132-9122-6772fb411959}</Project>
</ProjectReference>
</ItemGroup>
<!-- ========================= Globals ======================== -->

View File

@@ -22,6 +22,7 @@
<VcpkgAutoLink>false</VcpkgAutoLink>
<TerminalMUX>true</TerminalMUX>
<TerminalThemeHelpers>true</TerminalThemeHelpers>
<!--
These two properties are very important!
@@ -114,6 +115,9 @@
<Project>{CA5CAD1A-082C-4476-9F33-94B339494076}</Project>
</ProjectReference>
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\UIHelpers\UIHelpers.vcxproj">
<Project>{6515F03F-E56D-4DB4-B23D-AC4FB80DB36F}</Project>
</ProjectReference>
</ItemGroup>
<PropertyGroup>

View File

@@ -5,6 +5,7 @@
#include "TerminalPage.h"
#include "Utils.h"
#include "../../types/inc/utils.hpp"
#include "../TerminalSettingsAppAdapterLib/TerminalSettings.h"
#include <LibraryResources.h>
@@ -97,24 +98,19 @@ namespace winrt::TerminalApp::implementation
{
if (const auto& scheme{ _settings.GlobalSettings().ColorSchemes().TryLookup(args.SchemeName()) })
{
const auto backup = _restorePreviewFuncs.empty();
// Clear the saved preview funcs because we don't need to add a restore each time
// the preview color changes, we only need to be able to restore the last one.
_restorePreviewFuncs.clear();
_ApplyToActiveControls([&](const auto& control) {
// Stash a copy of the current scheme.
auto originalScheme{ control.ColorScheme() };
auto temporarySettings{ winrt::make_self<Settings::TerminalSettings>() };
temporarySettings->ApplyColorScheme(scheme);
control.ApplyPreviewColorScheme(temporarySettings.try_as<winrt::Microsoft::Terminal::Core::ICoreScheme>());
// Apply the new scheme.
control.ColorScheme(scheme.ToCoreScheme());
if (backup)
{
// Each control will emplace a revert into the
// _restorePreviewFuncs for itself.
_restorePreviewFuncs.emplace_back([=]() {
// On dismiss, restore the original scheme.
control.ColorScheme(originalScheme);
});
}
// Take a copy of the inputs, since they are pointers anyways.
_restorePreviewFuncs.emplace_back([=]() {
control.ResetPreviewColorScheme();
});
});
}
}

View File

@@ -8,6 +8,7 @@
#include "ScratchpadContent.h"
#include "../WinRTUtils/inc/WtExeUtils.h"
#include "../../types/inc/utils.hpp"
#include "../TerminalSettingsAppAdapterLib/TerminalSettings.h"
#include "Utils.h"
using namespace winrt::Windows::ApplicationModel::DataTransfer;
@@ -668,8 +669,10 @@ namespace winrt::TerminalApp::implementation
{
if (const auto scheme = _settings.GlobalSettings().ColorSchemes().TryLookup(realArgs.SchemeName()))
{
auto temporarySettings{ winrt::make_self<Settings::TerminalSettings>() };
temporarySettings->ApplyColorScheme(scheme);
const auto res = _ApplyToActiveControls([&](auto& control) {
control.ColorScheme(scheme.ToCoreScheme());
control.SetOverrideColorScheme(temporarySettings.try_as<winrt::Microsoft::Terminal::Core::ICoreScheme>());
});
args.Handled(res);
}
@@ -900,10 +903,7 @@ namespace winrt::TerminalApp::implementation
co_return;
}
// ShellExecuteExW may block, so do it on a background thread.
//
// NOTE: All remaining code of this function doesn't touch `this`, so we don't need weak/strong_ref.
// NOTE NOTE: Don't touch `this` when you make changes here.
// Hop to the BG thread
co_await winrt::resume_background();
// This will get us the correct exe for dev/preview/release. If you
@@ -1456,8 +1456,6 @@ namespace winrt::TerminalApp::implementation
safe_void_coroutine TerminalPage::_doHandleSuggestions(SuggestionsArgs realArgs)
{
const auto weak = get_weak();
const auto dispatcher = Dispatcher();
const auto source = realArgs.Source();
std::vector<Command> commandsCollection;
Control::CommandHistoryContext context{ nullptr };
@@ -1524,12 +1522,7 @@ namespace winrt::TerminalApp::implementation
}
}
co_await wil::resume_foreground(dispatcher);
const auto strong = weak.get();
if (!strong)
{
co_return;
}
co_await wil::resume_foreground(Dispatcher());
// Open the palette with all these commands in it.
_OpenSuggestions(_GetActiveControl(),

View File

@@ -150,9 +150,7 @@ namespace winrt::TerminalApp::implementation
});
_languageProfileNotifier = winrt::make_self<LanguageProfileNotifier>([this]() {
// TODO: This is really bad, because we reset any current user customizations.
// See GH#11522.
ReloadSettingsThrottled();
_reloadSettings->Run();
});
// Do this here, rather than at the top of main. This will prevent us from
@@ -332,7 +330,7 @@ namespace winrt::TerminalApp::implementation
if (modifiedBasename == settingsBasename)
{
ReloadSettingsThrottled();
_reloadSettings->Run();
}
});
}
@@ -438,11 +436,6 @@ namespace winrt::TerminalApp::implementation
SettingsChanged.raise(*this, *ev);
}
void AppLogic::ReloadSettingsThrottled()
{
_reloadSettings->Run();
}
// This is a continuation of AppLogic::Create() and includes the more expensive parts.
void AppLogic::NotifyRootInitialized()
{

View File

@@ -36,7 +36,6 @@ namespace winrt::TerminalApp::implementation
bool IsRunningElevated() const noexcept;
bool CanDragDrop() const noexcept;
void ReloadSettings();
void ReloadSettingsThrottled();
void NotifyRootInitialized();
bool HasSettingsStartupActions() const noexcept;
@@ -81,6 +80,7 @@ namespace winrt::TerminalApp::implementation
[[nodiscard]] HRESULT _TryLoadSettings() noexcept;
void _ProcessLazySettingsChanges();
void _RegisterSettingsChange();
safe_void_coroutine _DispatchReloadSettings();
void _setupFolderPathEnvVar();

View File

@@ -25,7 +25,6 @@ namespace TerminalApp
Boolean HasSettingsStartupActions();
void ReloadSettings();
void ReloadSettingsThrottled();
Microsoft.Terminal.Settings.Model.CascadiaSettings Settings { get; };
TerminalWindow CreateNewWindow();

View File

@@ -929,17 +929,6 @@ namespace winrt::TerminalApp::implementation
void CommandPalette::_filterTextChanged(const IInspectable& /*sender*/,
const Windows::UI::Xaml::RoutedEventArgs& /*args*/)
{
// GH#18737: Only respond to this change if we are visible:
// _close calls _searchBox().Text(L"") to reset the search text, which lands us
// in here after the command palette is dismissed. Since we have a code path here that
// could potentially lead to an action being previewed (specifically if there is a
// preview-able action as the first entry in the command list), that preview will
// appear after the palette is dismissed without this check.
if (Visibility() != Visibility::Visible)
{
return;
}
// When we are executing the _SelectNextTab in the TabManagement.cpp, this method
// is getting triggered because we set up the default value for that CommandPalette
// with an empty string. Therefore, to avoid the reset of the index when executing

View File

@@ -34,15 +34,9 @@ namespace winrt::Microsoft::TerminalApp::implementation
// before actually starting the connection to the client app. This
// will ensure both controls are initialized before the client app
// is.
const auto weak = get_weak();
co_await winrt::resume_background();
const auto strong = weak.get();
if (!strong)
{
co_return;
}
_pairedTap->_start.wait();
_wrappedConnection.Start();
}
void WriteInput(const winrt::array_view<const char16_t> buffer)

View File

@@ -43,9 +43,6 @@ safe_void_coroutine Jumplist::UpdateJumplist(const CascadiaSettings& settings) n
// make sure to capture the settings _before_ the co_await
const auto strongSettings = settings;
// Explorer APIs may block, so do it on a background thread.
//
// NOTE: Jumplist has no members, so we don't need to hold onto `this` here.
co_await winrt::resume_background();
try

View File

@@ -89,18 +89,6 @@ namespace winrt::TerminalApp::implementation
CloseClick.raise(*this, e);
}
bool MinMaxCloseControl::Focused() const
{
return _focused;
}
void MinMaxCloseControl::Focused(bool focused)
{
_focused = focused;
ReleaseButtons();
}
void MinMaxCloseControl::SetWindowVisualState(WindowVisualState visualState)
{
// Look up the heights we should use for the caption buttons from our
@@ -182,25 +170,25 @@ namespace winrt::TerminalApp::implementation
// animate the fade in/out transition between colors.
case CaptionButton::Minimize:
VisualStateManager::GoToState(MinimizeButton(), L"PointerOver", true);
VisualStateManager::GoToState(MaximizeButton(), _normalState(), true);
VisualStateManager::GoToState(CloseButton(), _normalState(), true);
VisualStateManager::GoToState(MaximizeButton(), L"Normal", true);
VisualStateManager::GoToState(CloseButton(), L"Normal", true);
_displayToolTip->Run(MinimizeButton());
closeToolTipForButton(MaximizeButton());
closeToolTipForButton(CloseButton());
break;
case CaptionButton::Maximize:
VisualStateManager::GoToState(MinimizeButton(), _normalState(), true);
VisualStateManager::GoToState(MinimizeButton(), L"Normal", true);
VisualStateManager::GoToState(MaximizeButton(), L"PointerOver", true);
VisualStateManager::GoToState(CloseButton(), _normalState(), true);
VisualStateManager::GoToState(CloseButton(), L"Normal", true);
closeToolTipForButton(MinimizeButton());
_displayToolTip->Run(MaximizeButton());
closeToolTipForButton(CloseButton());
break;
case CaptionButton::Close:
VisualStateManager::GoToState(MinimizeButton(), _normalState(), true);
VisualStateManager::GoToState(MaximizeButton(), _normalState(), true);
VisualStateManager::GoToState(MinimizeButton(), L"Normal", true);
VisualStateManager::GoToState(MaximizeButton(), L"Normal", true);
VisualStateManager::GoToState(CloseButton(), L"PointerOver", true);
closeToolTipForButton(MinimizeButton());
@@ -223,17 +211,17 @@ namespace winrt::TerminalApp::implementation
{
case CaptionButton::Minimize:
VisualStateManager::GoToState(MinimizeButton(), L"Pressed", true);
VisualStateManager::GoToState(MaximizeButton(), _normalState(), true);
VisualStateManager::GoToState(CloseButton(), _normalState(), true);
VisualStateManager::GoToState(MaximizeButton(), L"Normal", true);
VisualStateManager::GoToState(CloseButton(), L"Normal", true);
break;
case CaptionButton::Maximize:
VisualStateManager::GoToState(MinimizeButton(), _normalState(), true);
VisualStateManager::GoToState(MinimizeButton(), L"Normal", true);
VisualStateManager::GoToState(MaximizeButton(), L"Pressed", true);
VisualStateManager::GoToState(CloseButton(), _normalState(), true);
VisualStateManager::GoToState(CloseButton(), L"Normal", true);
break;
case CaptionButton::Close:
VisualStateManager::GoToState(MinimizeButton(), _normalState(), true);
VisualStateManager::GoToState(MaximizeButton(), _normalState(), true);
VisualStateManager::GoToState(MinimizeButton(), L"Normal", true);
VisualStateManager::GoToState(MaximizeButton(), L"Normal", true);
VisualStateManager::GoToState(CloseButton(), L"Pressed", true);
break;
}
@@ -246,9 +234,9 @@ namespace winrt::TerminalApp::implementation
void MinMaxCloseControl::ReleaseButtons()
{
_displayToolTip->Run(nullptr);
VisualStateManager::GoToState(MinimizeButton(), _normalState(), true);
VisualStateManager::GoToState(MaximizeButton(), _normalState(), true);
VisualStateManager::GoToState(CloseButton(), _normalState(), true);
VisualStateManager::GoToState(MinimizeButton(), L"Normal", true);
VisualStateManager::GoToState(MaximizeButton(), L"Normal", true);
VisualStateManager::GoToState(CloseButton(), L"Normal", true);
closeToolTipForButton(MinimizeButton());
closeToolTipForButton(MaximizeButton());
@@ -256,11 +244,4 @@ namespace winrt::TerminalApp::implementation
_lastPressedButton = std::nullopt;
}
const winrt::param::hstring& MinMaxCloseControl::_normalState() const
{
static const winrt::param::hstring normal = L"Normal";
static const winrt::param::hstring unfocused = L"Unfocused";
return (_focused ? normal : unfocused);
}
}

View File

@@ -21,9 +21,6 @@ namespace winrt::TerminalApp::implementation
void PressButton(CaptionButton button);
void ReleaseButtons();
bool Focused() const;
void Focused(bool focused);
void _MinimizeClick(const winrt::Windows::Foundation::IInspectable& sender,
const winrt::Windows::UI::Xaml::RoutedEventArgs& e);
void _MaximizeClick(const winrt::Windows::Foundation::IInspectable& sender,
@@ -35,12 +32,8 @@ namespace winrt::TerminalApp::implementation
til::typed_event<TerminalApp::MinMaxCloseControl, winrt::Windows::UI::Xaml::RoutedEventArgs> MaximizeClick;
til::typed_event<TerminalApp::MinMaxCloseControl, winrt::Windows::UI::Xaml::RoutedEventArgs> CloseClick;
bool _focused{ false };
std::shared_ptr<ThrottledFunc<winrt::Windows::UI::Xaml::Controls::Button>> _displayToolTip{ nullptr };
std::optional<CaptionButton> _lastPressedButton{ std::nullopt };
private:
const winrt::param::hstring& _normalState() const;
};
}

View File

@@ -14,7 +14,6 @@ namespace TerminalApp
void HoverButton(CaptionButton button);
void PressButton(CaptionButton button);
void ReleaseButtons();
Boolean Focused { get; set; };
event Windows.Foundation.TypedEventHandler<MinMaxCloseControl, Windows.UI.Xaml.RoutedEventArgs> MinimizeClick;
event Windows.Foundation.TypedEventHandler<MinMaxCloseControl, Windows.UI.Xaml.RoutedEventArgs> MaximizeClick;

View File

@@ -32,10 +32,6 @@
ResourceKey="SystemControlForegroundBaseHighBrush" />
<StaticResource x:Key="CaptionButtonForegroundPressed"
ResourceKey="SystemControlForegroundBaseHighBrush" />
<StaticResource x:Key="CaptionButtonForegroundUnfocusedColor"
ResourceKey="TextFillColorDisabled" />
<SolidColorBrush x:Key="CaptionButtonForegroundUnfocused"
Color="{ThemeResource CaptionButtonForegroundUnfocusedColor}" />
<SolidColorBrush x:Key="CaptionButtonBackground"
Color="Transparent" />
<Color x:Key="CaptionButtonBackgroundColor">Transparent</Color>
@@ -70,10 +66,6 @@
ResourceKey="SystemControlForegroundBaseHighBrush" />
<StaticResource x:Key="CaptionButtonForegroundPressed"
ResourceKey="SystemControlForegroundBaseHighBrush" />
<StaticResource x:Key="CaptionButtonForegroundUnfocusedColor"
ResourceKey="TextFillColorDisabled" />
<SolidColorBrush x:Key="CaptionButtonForegroundUnfocused"
Color="{ThemeResource CaptionButtonForegroundUnfocusedColor}" />
<SolidColorBrush x:Key="CaptionButtonBackground"
Color="Transparent" />
<Color x:Key="CaptionButtonBackgroundColor">Transparent</Color>
@@ -111,10 +103,6 @@
Color="{ThemeResource SystemColorHighlightTextColor}" />
<SolidColorBrush x:Key="CaptionButtonForegroundPressed"
Color="{ThemeResource SystemColorHighlightTextColor}" />
<SolidColorBrush x:Key="CaptionButtonForegroundUnfocused"
Color="{ThemeResource SystemColorButtonTextColor}" />
<StaticResource x:Key="CaptionButtonForegroundUnfocusedColor"
ResourceKey="SystemColorButtonTextColor" />
<SolidColorBrush x:Key="CloseButtonBackgroundPointerOver"
Color="{ThemeResource SystemColorHighlightColor}" />
<SolidColorBrush x:Key="CloseButtonForegroundPointerOver"
@@ -201,20 +189,6 @@
Duration="0:0:0.1" />
</Storyboard>
</VisualTransition>
<VisualTransition From="PointerOver"
To="Unfocused">
<Storyboard>
<ColorAnimation Storyboard.TargetName="ButtonBaseElement"
Storyboard.TargetProperty="(UIElement.Background).(SolidColorBrush.Color)"
To="{ThemeResource CaptionButtonBackgroundColor}"
Duration="0:0:0.15" />
<ColorAnimation Storyboard.TargetName="ButtonIcon"
Storyboard.TargetProperty="(UIElement.Foreground).(SolidColorBrush.Color)"
To="{ThemeResource CaptionButtonForegroundUnfocusedColor}"
Duration="0:0:0.1" />
</Storyboard>
</VisualTransition>
</VisualStateGroup.Transitions>
<VisualState x:Name="Normal">
@@ -224,13 +198,6 @@
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Unfocused">
<VisualState.Setters>
<Setter Target="ButtonBaseElement.Background" Value="{ThemeResource CaptionButtonBackground}" />
<Setter Target="ButtonIcon.Foreground" Value="{ThemeResource CaptionButtonForegroundUnfocused}" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="PointerOver">
<VisualState.Setters>
<Setter Target="ButtonBaseElement.Background" Value="{ThemeResource CaptionButtonBackgroundPointerOver}" />

View File

@@ -887,7 +887,7 @@
<value>Déplacer l'onglet vers une nouvelle fenêtre </value>
</data>
<data name="RunAsAdminFlyout.Text" xml:space="preserve">
<value>Exécuter en tant qu'administrateur (restreint)</value>
<value>Exécuter en temps qu'administrateur (restreint)</value>
<comment>This text is displayed on context menu for profile entries in add new tab button.</comment>
</data>
<data name="TerminalPage_PaneMovedAnnouncement_ExistingTab" xml:space="preserve">

View File

@@ -317,7 +317,7 @@
<value>同じ名前ですが大文字と小文字が異なる環境変数が複数見つかりました。使用される値は 1 つだけです。</value>
</data>
<data name="CmdCommandArgDesc" xml:space="preserve">
<value>新しいタブまたはペインで生成されるオプションのコマンドと引数</value>
<value>新しいタブまたはウィンドウで生成されるオプションのコマンドと引数</value>
</data>
<data name="SaveSnippetDesc" xml:space="preserve">
<value>コマンド ラインを入力アクションとして保存する</value>
@@ -412,7 +412,7 @@
<comment>{Locked="\"tabTitle\""}</comment>
</data>
<data name="CmdInheritEnvDesc" xml:space="preserve">
<value>新しい環境ブロックを作成するのではなく、新しいタブまたはペインを作成するときに、ターミナル独自の環境変数を継承します。これは、"command" が渡されたときに既定で設定されます。 </value>
<value>新しい環境ブロックを作成するのではなく、新しいタブまたはウィンドウを作成するときに、ターミナル独自の環境変数を継承します。これは、"command" が渡されたときに既定で設定されます。 </value>
<comment>{Locked="\"command\""}</comment>
</data>
<data name="CmdColorSchemeArgDesc" xml:space="preserve">
@@ -429,7 +429,7 @@
<value>ウィンドウを全画面表示モードで起動する</value>
</data>
<data name="CmdMoveFocusDesc" xml:space="preserve">
<value>指定した方向にある隣のペインにフォーカスを移動する</value>
<value>指定した方向にある隣のウィンドウにフォーカスを移動する</value>
</data>
<data name="CmdMFDesc" xml:space="preserve">
<value>"move-focus" サブコマンドのエイリアス。</value>
@@ -857,7 +857,7 @@
<value>設定ページを開きます</value>
</data>
<data name="SplitTabToolTip" xml:space="preserve">
<value>現在のディレクトリのアクティブなプロファイルを使用して新しいペインを開きます</value>
<value>現在のディレクトリのアクティブなプロファイルを使用して新しいウィンドウを開きます</value>
</data>
<data name="TabCloseAfterToolTip" xml:space="preserve">
<value>このタブの右側にあるすべてのタブを閉じます</value>
@@ -930,7 +930,7 @@
<value>接続の再起動</value>
</data>
<data name="RestartConnectionToolTip" xml:space="preserve">
<value>アクティブ ペイン接続を再起動します</value>
<value>アクティブウィンドウ接続を再起動します</value>
</data>
<data name="SnippetPaneTitle.Text" xml:space="preserve">
<value>抜粋</value>

View File

@@ -48,22 +48,13 @@ namespace winrt::TerminalApp::implementation
{
_settings = settings;
const auto dispatcher = Dispatcher();
const auto weak = get_weak();
// You'd think that `FilterToSendInput(queryString)` would work. It
// doesn't! That uses the queryString as the current command the user
// has typed, then relies on the suggestions UI to _also_ filter with that
// string.
const auto tasks = co_await _settings.GlobalSettings().ActionMap().FilterToSnippets(winrt::hstring{}, winrt::hstring{}); // IVector<Model::Command>
co_await wil::resume_foreground(dispatcher);
const auto strong = weak.get();
if (!strong)
{
co_return;
}
co_await wil::resume_foreground(Dispatcher());
_allTasks.Clear();
for (const auto& t : tasks)

View File

@@ -20,6 +20,7 @@
#include "TabRowControl.h"
#include "DebugTapConnection.h"
#include "..\TerminalSettingsModel\FileUtils.h"
#include "../TerminalSettingsAppAdapterLib/TerminalSettings.h"
#include <shlobj.h>
@@ -74,7 +75,7 @@ namespace winrt::TerminalApp::implementation
{
return S_FALSE;
}
const auto settings{ TerminalSettings::CreateWithNewTerminalArgs(_settings, newTerminalArgs, *_bindings) };
const auto settings{ Settings::TerminalSettings::CreateWithNewTerminalArgs(_settings, newTerminalArgs) };
// Try to handle auto-elevation
if (_maybeElevate(newTerminalArgs, settings, profile))
@@ -397,18 +398,12 @@ namespace winrt::TerminalApp::implementation
// - tab: the tab to remove
winrt::Windows::Foundation::IAsyncAction TerminalPage::_HandleCloseTabRequested(winrt::TerminalApp::Tab tab)
{
winrt::com_ptr<TerminalPage> strong;
if (tab.ReadOnly())
{
const auto weak = get_weak();
auto warningResult = co_await _ShowCloseReadOnlyDialog();
strong = weak.get();
// If the user didn't explicitly click on close tab - leave
if (!strong || warningResult != ContentDialogResult::Primary)
if (warningResult != ContentDialogResult::Primary)
{
co_return;
}
@@ -719,14 +714,10 @@ namespace winrt::TerminalApp::implementation
{
if (pane->ContainsReadOnly())
{
const auto weak = get_weak();
auto warningResult = co_await _ShowCloseReadOnlyDialog();
const auto strong = weak.get();
// If the user didn't explicitly click on close tab - leave
if (!strong || warningResult != ContentDialogResult::Primary)
if (warningResult != ContentDialogResult::Primary)
{
co_return false;
}
@@ -784,13 +775,9 @@ namespace winrt::TerminalApp::implementation
if (const auto pane{ activeTab->GetActivePane() })
{
const auto weak = get_weak();
if (co_await _PaneConfirmCloseReadOnly(pane))
{
if (const auto strong = weak.get())
{
_HandleClosePaneRequested(pane);
}
_HandleClosePaneRequested(pane);
}
}
}
@@ -848,22 +835,9 @@ namespace winrt::TerminalApp::implementation
// - tabs - tabs to remove
safe_void_coroutine TerminalPage::_RemoveTabs(const std::vector<winrt::TerminalApp::Tab> tabs)
{
const auto weak = get_weak();
for (auto& tab : tabs)
{
winrt::Windows::Foundation::IAsyncAction action{ nullptr };
if (const auto strong = weak.get())
{
action = _HandleCloseTabRequested(tab);
}
if (!action)
{
co_return;
}
co_await action;
co_await _HandleCloseTabRequested(tab);
}
}
// Method Description:
@@ -947,13 +921,8 @@ namespace winrt::TerminalApp::implementation
// WinUI asynchronously updates its tab view items, so it may happen that we're given a
// `TabViewItem` that still contains a `Tab` which has actually already been removed.
// First we must yield once, to flush out whatever TabView is currently doing.
const auto weak = get_weak();
const auto strong = get_strong();
co_await wil::resume_foreground(Dispatcher());
const auto strong = weak.get();
if (!strong)
{
co_return;
}
const auto tab = _GetTabByTabViewItem(sender);
if (!tab)

View File

@@ -414,6 +414,9 @@
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\UIHelpers\UIHelpers.vcxproj">
<Project>{6515F03F-E56D-4DB4-B23D-AC4FB80DB36F}</Project>
</ProjectReference>
<ProjectReference Include="$(OpenConsoleDir)\src\cascadia\TerminalSettingsAppAdapterLib\TerminalSettingsAppAdapterLib.vcxproj">
<Project>{3c46e2b0-ae6c-4132-9122-6772fb411959}</Project>
</ProjectReference>
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\UIMarkdown\UIMarkdown.vcxproj">
<Project>{7615F03F-E56D-4DB4-B23D-BD4FB80DB36F}</Project>
<Private>true</Private>

View File

@@ -7,7 +7,6 @@
#include <LibraryResources.h>
#include <TerminalThemeHelpers.h>
#include <til/unicode.h>
#include <Utils.h>
#include <TerminalCore/ControlKeyStates.hpp>
@@ -22,6 +21,7 @@
#include "TerminalSettingsCache.h"
#include "../../types/inc/ColorFix.hpp"
#include "../../types/inc/utils.hpp"
#include "../TerminalSettingsAppAdapterLib/TerminalSettings.h"
#include "LaunchPositionRequest.g.cpp"
#include "RenameWindowRequestedArgs.g.cpp"
@@ -260,16 +260,6 @@ namespace winrt::TerminalApp::implementation
}
}
_adjustProcessPriorityThrottled = std::make_shared<ThrottledFunc<>>(
DispatcherQueue::GetForCurrentThread(),
til::throttled_func_options{
.delay = std::chrono::milliseconds{ 100 },
.debounce = true,
.trailing = true,
},
[=]() {
_adjustProcessPriority();
});
_hostingHwnd = hwnd;
return S_OK;
}
@@ -281,7 +271,7 @@ namespace winrt::TerminalApp::implementation
if (_settings == nullptr)
{
// Create this only on the first time we load the settings.
_terminalSettingsCache = std::make_shared<TerminalSettingsCache>(settings, *_bindings);
_terminalSettingsCache = std::make_shared<TerminalSettingsCache>(settings);
}
_settings = settings;
@@ -452,6 +442,17 @@ namespace winrt::TerminalApp::implementation
// them.
_tabRow.ShowElevationShield(IsRunningElevated() && _settings.GlobalSettings().ShowAdminShield());
_adjustProcessPriorityThrottled = std::make_shared<ThrottledFunc<>>(
DispatcherQueue::GetForCurrentThread(),
til::throttled_func_options{
.delay = std::chrono::milliseconds{ 100 },
.debounce = true,
.trailing = true,
},
[=]() {
_adjustProcessPriority();
});
}
Windows::UI::Xaml::Automation::Peers::AutomationPeer TerminalPage::OnCreateAutomationPeer()
@@ -1465,7 +1466,7 @@ namespace winrt::TerminalApp::implementation
// Return value:
// - the desired connection
TerminalConnection::ITerminalConnection TerminalPage::_CreateConnectionFromSettings(Profile profile,
TerminalSettings settings,
IControlSettings settings,
const bool inheritCursor)
{
static const auto textMeasurement = [&]() -> std::wstring_view {
@@ -1490,8 +1491,18 @@ namespace winrt::TerminalApp::implementation
if (connectionType == TerminalConnection::AzureConnection::ConnectionType() &&
TerminalConnection::AzureConnection::IsAzureConnectionAvailable())
{
connection = TerminalConnection::AzureConnection{};
valueSet = TerminalConnection::ConptyConnection::CreateSettings(winrt::hstring{},
std::filesystem::path azBridgePath{ wil::GetModuleFileNameW<std::wstring>(nullptr) };
azBridgePath.replace_filename(L"TerminalAzBridge.exe");
if constexpr (Feature_AzureConnectionInProc::IsEnabled())
{
connection = TerminalConnection::AzureConnection{};
}
else
{
connection = TerminalConnection::ConptyConnection{};
}
valueSet = TerminalConnection::ConptyConnection::CreateSettings(azBridgePath.native(),
L".",
L"Azure",
false,
@@ -1505,9 +1516,8 @@ namespace winrt::TerminalApp::implementation
else
{
const auto environment = settings.EnvironmentVariables() != nullptr ?
settings.EnvironmentVariables().GetView() :
nullptr;
auto settingsInternal{ winrt::get_self<Settings::TerminalSettings>(settings) };
const auto environment = settingsInternal->EnvironmentVariables();
// Update the path to be relative to whatever our CWD is.
//
@@ -1529,7 +1539,7 @@ namespace winrt::TerminalApp::implementation
valueSet = TerminalConnection::ConptyConnection::CreateSettings(settings.Commandline(),
newWorkingDirectory,
settings.StartingTitle(),
settings.ReloadEnvironmentVariables(),
settingsInternal->ReloadEnvironmentVariables(),
_WindowProperties.VirtualEnvVars(),
environment,
settings.InitialRows(),
@@ -1583,20 +1593,20 @@ namespace winrt::TerminalApp::implementation
const auto& connection = control.Connection();
auto profile{ paneContent.GetProfile() };
TerminalSettingsCreateResult controlSettings{ nullptr };
Settings::TerminalSettingsCreateResult controlSettings{ nullptr };
if (profile)
{
// TODO GH#5047 If we cache the NewTerminalArgs, we no longer need to do this.
profile = GetClosestProfileForDuplicationOfProfile(profile);
controlSettings = TerminalSettings::CreateWithProfile(_settings, profile, *_bindings);
controlSettings = Settings::TerminalSettings::CreateWithProfile(_settings, profile);
// Replace the Starting directory with the CWD, if given
const auto workingDirectory = control.WorkingDirectory();
const auto validWorkingDirectory = !workingDirectory.empty();
if (validWorkingDirectory)
{
controlSettings.DefaultSettings().StartingDirectory(workingDirectory);
controlSettings.DefaultSettings()->StartingDirectory(workingDirectory);
}
// To facilitate restarting defterm connections: grab the original
@@ -1604,11 +1614,11 @@ namespace winrt::TerminalApp::implementation
// settings.
if (const auto& conpty{ connection.try_as<TerminalConnection::ConptyConnection>() })
{
controlSettings.DefaultSettings().Commandline(conpty.Commandline());
controlSettings.DefaultSettings()->Commandline(conpty.Commandline());
}
}
return _CreateConnectionFromSettings(profile, controlSettings.DefaultSettings(), true);
return _CreateConnectionFromSettings(profile, *controlSettings.DefaultSettings(), true);
}
// Method Description:
@@ -2206,15 +2216,7 @@ namespace winrt::TerminalApp::implementation
if (!_displayingCloseDialog)
{
_displayingCloseDialog = true;
const auto weak = get_weak();
auto warningResult = co_await _ShowQuitDialog();
const auto strong = weak.get();
if (!strong)
{
co_return;
}
_displayingCloseDialog = false;
if (warningResult != ContentDialogResult::Primary)
@@ -2942,11 +2944,7 @@ namespace winrt::TerminalApp::implementation
text = winrt::hstring{ Utils::TrimPaste(text) };
}
// LOAD BEARING: Send an empty bracketed paste even if the clipboard was empty.
// Bracketed Paste provides an application a way to know whether the
// user pasted, even if there was no applicable content on it. This
// behavior is observed in GNOME Terminal, among others.
if (!bracketedPaste && text.empty())
if (text.empty())
{
co_return;
}
@@ -2985,19 +2983,7 @@ namespace winrt::TerminalApp::implementation
{
// We have to initialize the dialog here to be able to change the text of the text block within it
std::ignore = FindName(L"MultiLinePasteDialog");
// WinUI absolutely cannot deal with large amounts of text (at least O(n), possibly O(n^2),
// so we limit the string length here and add an ellipsis if necessary.
auto clipboardText = text;
if (clipboardText.size() > 1024)
{
const std::wstring_view view{ text };
// Make sure we don't cut in the middle of a surrogate pair
const auto len = til::utf16_iterate_prev(view, 512);
clipboardText = til::hstring_format(FMT_COMPILE(L"{}\n"), view.substr(0, len));
}
ClipboardText().Text(std::move(clipboardText));
ClipboardText().Text(text);
// The vertical offset on the scrollbar does not reset automatically, so reset it manually
ClipboardContentScrollViewer().ScrollToVerticalOffset(0);
@@ -3013,7 +2999,7 @@ namespace winrt::TerminalApp::implementation
}
// Clear the clipboard text so it doesn't lie around in memory
ClipboardText().Text({});
ClipboardText().Text(L"");
if (warningResult != ContentDialogResult::Primary)
{
@@ -3193,12 +3179,8 @@ namespace winrt::TerminalApp::implementation
// - eventArgs: the arguments specifying how to set the progress indicator
safe_void_coroutine TerminalPage::_SetTaskbarProgressHandler(const IInspectable /*sender*/, const IInspectable /*eventArgs*/)
{
const auto weak = get_weak();
co_await wil::resume_foreground(Dispatcher());
if (const auto strong = weak.get())
{
SetTaskbarProgress.raise(*this, nullptr);
}
SetTaskbarProgress.raise(*this, nullptr);
}
// Method Description:
@@ -3255,12 +3237,6 @@ namespace winrt::TerminalApp::implementation
{
co_return;
}
const auto weak = get_weak();
const auto dispatcher = Dispatcher();
// All of the code until resume_foreground is static and
// doesn't touch `this`, so we don't need weak/strong_ref.
co_await winrt::resume_background();
// no packages were found, nothing to suggest
@@ -3278,12 +3254,7 @@ namespace winrt::TerminalApp::implementation
suggestions.emplace_back(fmt::format(FMT_COMPILE(L"winget install --id {} -s winget"), pkg.CatalogPackage().Id()));
}
co_await wil::resume_foreground(dispatcher);
const auto strong = weak.get();
if (!strong)
{
co_return;
}
co_await wil::resume_foreground(Dispatcher());
auto term = _GetActiveControl();
if (!term)
@@ -3378,9 +3349,6 @@ namespace winrt::TerminalApp::implementation
// UI) thread. This is IMPORTANT, because the Windows.Storage API's
// (used for retrieving the path to the file) will crash on the UI
// thread, because the main thread is a STA.
//
// NOTE: All remaining code of this function doesn't touch `this`, so we don't need weak/strong_ref.
// NOTE NOTE: Don't touch `this` when you make changes here.
co_await winrt::resume_background();
auto openFile = [](const auto& filePath) {
@@ -3435,13 +3403,11 @@ namespace winrt::TerminalApp::implementation
}
}
TermControl TerminalPage::_CreateNewControlAndContent(const TerminalSettingsCreateResult& settings, const ITerminalConnection& connection)
TermControl TerminalPage::_CreateNewControlAndContent(const Settings::TerminalSettingsCreateResult& settings, const ITerminalConnection& connection)
{
// Do any initialization that needs to apply to _every_ TermControl we
// create here.
// TermControl will copy the settings out of the settings passed to it.
const auto content = _manager.CreateCore(settings.DefaultSettings(), settings.UnfocusedSettings(), connection);
const auto content = _manager.CreateCore(*settings.DefaultSettings(), settings.UnfocusedSettings().try_as<IControlAppearance>(), connection);
const TermControl control{ content };
return _SetupControl(control);
}
@@ -3455,7 +3421,7 @@ namespace winrt::TerminalApp::implementation
// don't, then when we move the content to another thread, and it
// tries to handle a key, it'll callback on the original page's
// stack, inevitably resulting in a wrong_thread
return _SetupControl(TermControl::NewControlByAttachingContent(content, *_bindings));
return _SetupControl(TermControl::NewControlByAttachingContent(content));
}
return nullptr;
}
@@ -3475,6 +3441,8 @@ namespace winrt::TerminalApp::implementation
term.OwningHwnd(reinterpret_cast<uint64_t>(*_hostingHwnd));
}
term.KeyBindings(*_bindings);
_RegisterTerminalEvents(term);
return term;
}
@@ -3511,7 +3479,7 @@ namespace winrt::TerminalApp::implementation
return std::make_shared<Pane>(paneContent);
}
TerminalSettingsCreateResult controlSettings{ nullptr };
Settings::TerminalSettingsCreateResult controlSettings{ nullptr };
Profile profile{ nullptr };
if (const auto& tabImpl{ _GetTabImpl(sourceTab) })
@@ -3521,19 +3489,19 @@ namespace winrt::TerminalApp::implementation
{
// TODO GH#5047 If we cache the NewTerminalArgs, we no longer need to do this.
profile = GetClosestProfileForDuplicationOfProfile(profile);
controlSettings = TerminalSettings::CreateWithProfile(_settings, profile, *_bindings);
controlSettings = Settings::TerminalSettings::CreateWithProfile(_settings, profile);
const auto workingDirectory = tabImpl->GetActiveTerminalControl().WorkingDirectory();
const auto validWorkingDirectory = !workingDirectory.empty();
if (validWorkingDirectory)
{
controlSettings.DefaultSettings().StartingDirectory(workingDirectory);
controlSettings.DefaultSettings()->StartingDirectory(workingDirectory);
}
}
}
if (!profile)
{
profile = _settings.GetProfileForArgs(newTerminalArgs);
controlSettings = TerminalSettings::CreateWithNewTerminalArgs(_settings, newTerminalArgs, *_bindings);
controlSettings = Settings::TerminalSettings::CreateWithNewTerminalArgs(_settings, newTerminalArgs);
}
// Try to handle auto-elevation
@@ -3542,13 +3510,13 @@ namespace winrt::TerminalApp::implementation
return nullptr;
}
const auto sessionId = controlSettings.DefaultSettings().SessionId();
const auto sessionId = controlSettings.DefaultSettings()->SessionId();
const auto hasSessionId = sessionId != winrt::guid{};
auto connection = existingConnection ? existingConnection : _CreateConnectionFromSettings(profile, controlSettings.DefaultSettings(), hasSessionId);
auto connection = existingConnection ? existingConnection : _CreateConnectionFromSettings(profile, *controlSettings.DefaultSettings(), hasSessionId);
if (existingConnection)
{
connection.Resize(controlSettings.DefaultSettings().InitialRows(), controlSettings.DefaultSettings().InitialCols());
connection.Resize(controlSettings.DefaultSettings()->InitialRows(), controlSettings.DefaultSettings()->InitialCols());
}
TerminalConnection::ITerminalConnection debugConnection{ nullptr };
@@ -3707,13 +3675,7 @@ namespace winrt::TerminalApp::implementation
// for nulls
if (const auto& connection{ _duplicateConnectionForRestart(paneContent) })
{
// Reset the terminal's VT state before attaching the new connection.
// The previous client may have left dirty modes (e.g., bracketed
// paste, mouse tracking, alternate buffer, kitty keyboard) that
// would corrupt input/output for the new shell process.
const auto& termControl = paneContent.GetTermControl();
termControl.HardResetWithoutErase();
termControl.Connection(connection);
paneContent.GetTermControl().Connection(connection);
connection.Start();
}
}
@@ -3798,7 +3760,7 @@ namespace winrt::TerminalApp::implementation
// updating terminal panes, so that we don't have to build a _new_
// TerminalSettings for every profile we update - we can just look them
// up the previous ones we built.
_terminalSettingsCache->Reset(_settings, *_bindings);
_terminalSettingsCache->Reset(_settings);
for (const auto& tab : _tabs)
{
@@ -4709,7 +4671,7 @@ namespace winrt::TerminalApp::implementation
// - true iff we tossed this request to an elevated window. Callers can use
// this result to early-return if needed.
bool TerminalPage::_maybeElevate(const NewTerminalArgs& newTerminalArgs,
const TerminalSettingsCreateResult& controlSettings,
const Settings::TerminalSettingsCreateResult& controlSettings,
const Profile& profile)
{
// When duplicating a tab there aren't any newTerminalArgs.
@@ -4722,7 +4684,7 @@ namespace winrt::TerminalApp::implementation
// If we don't even want to elevate we can return early.
// If we're already elevated we can also return, because it doesn't get any more elevated than that.
if (!defaultSettings.Elevate() || IsRunningElevated())
if (!defaultSettings->Elevate() || IsRunningElevated())
{
return false;
}
@@ -4732,7 +4694,7 @@ namespace winrt::TerminalApp::implementation
// will be that profile's GUID. If there wasn't, then we'll use
// whatever the default profile's GUID is.
newTerminalArgs.Profile(::Microsoft::Console::Utils::GuidToString(profile.Guid()));
newTerminalArgs.StartingDirectory(_evaluatePathForCwd(defaultSettings.StartingDirectory()));
newTerminalArgs.StartingDirectory(_evaluatePathForCwd(defaultSettings->StartingDirectory()));
_OpenElevatedWT(newTerminalArgs);
return true;
}
@@ -4745,18 +4707,12 @@ namespace winrt::TerminalApp::implementation
// - sender: the ICoreState instance containing the connection state
// Return Value:
// - <none>
safe_void_coroutine TerminalPage::_ConnectionStateChangedHandler(const IInspectable& sender, const IInspectable& /*args*/)
safe_void_coroutine TerminalPage::_ConnectionStateChangedHandler(const IInspectable& sender, const IInspectable& /*args*/) const
{
if (const auto coreState{ sender.try_as<winrt::Microsoft::Terminal::Control::ICoreState>() })
{
const auto newConnectionState = coreState.ConnectionState();
const auto weak = get_weak();
co_await wil::resume_foreground(Dispatcher());
const auto strong = weak.get();
if (!strong)
{
co_return;
}
_adjustProcessPriorityThrottled->Run();
@@ -4894,18 +4850,8 @@ namespace winrt::TerminalApp::implementation
}
}
// GH#19604: Get the theme's tabRow color to use as the acrylic tint.
const auto tabRowBg{ theme.TabRow() ? (_activated ? theme.TabRow().Background() :
theme.TabRow().UnfocusedBackground()) :
ThemeColor{ nullptr } };
if (_settings.GlobalSettings().UseAcrylicInTabRow() && (_activated || _settings.GlobalSettings().EnableUnfocusedAcrylic()))
if (_settings.GlobalSettings().UseAcrylicInTabRow())
{
if (tabRowBg)
{
bgColor = ThemeColor::ColorFromBrush(tabRowBg.Evaluate(res, terminalBrush, true));
}
const auto acrylicBrush = Media::AcrylicBrush();
acrylicBrush.BackgroundSource(Media::AcrylicBackgroundSource::HostBackdrop);
acrylicBrush.FallbackColor(bgColor);
@@ -4914,7 +4860,9 @@ namespace winrt::TerminalApp::implementation
TitlebarBrush(acrylicBrush);
}
else if (tabRowBg)
else if (auto tabRowBg{ theme.TabRow() ? (_activated ? theme.TabRow().Background() :
theme.TabRow().UnfocusedBackground()) :
ThemeColor{ nullptr } })
{
const auto themeBrush{ tabRowBg.Evaluate(res, terminalBrush, true) };
bgColor = ThemeColor::ColorFromBrush(themeBrush);

View File

@@ -29,6 +29,11 @@ namespace Microsoft::Terminal::Core
class ControlKeyStates;
}
namespace winrt::Microsoft::Terminal::Settings
{
struct TerminalSettingsCreateResult;
}
namespace winrt::TerminalApp::implementation
{
struct TerminalSettingsCache;
@@ -313,7 +318,7 @@ namespace winrt::TerminalApp::implementation
std::wstring _evaluatePathForCwd(std::wstring_view path);
winrt::Microsoft::Terminal::TerminalConnection::ITerminalConnection _CreateConnectionFromSettings(Microsoft::Terminal::Settings::Model::Profile profile, Microsoft::Terminal::Settings::Model::TerminalSettings settings, const bool inheritCursor);
winrt::Microsoft::Terminal::TerminalConnection::ITerminalConnection _CreateConnectionFromSettings(Microsoft::Terminal::Settings::Model::Profile profile, Microsoft::Terminal::Control::IControlSettings settings, const bool inheritCursor);
winrt::Microsoft::Terminal::TerminalConnection::ITerminalConnection _duplicateConnectionForRestart(const TerminalApp::TerminalPaneContent& paneContent);
void _restartPaneConnection(const TerminalApp::TerminalPaneContent&, const winrt::Windows::Foundation::IInspectable&);
@@ -461,7 +466,7 @@ namespace winrt::TerminalApp::implementation
void _Find(const Tab& tab);
winrt::Microsoft::Terminal::Control::TermControl _CreateNewControlAndContent(const winrt::Microsoft::Terminal::Settings::Model::TerminalSettingsCreateResult& settings,
winrt::Microsoft::Terminal::Control::TermControl _CreateNewControlAndContent(const winrt::Microsoft::Terminal::Settings::TerminalSettingsCreateResult& settings,
const winrt::Microsoft::Terminal::TerminalConnection::ITerminalConnection& connection);
winrt::Microsoft::Terminal::Control::TermControl _SetupControl(const winrt::Microsoft::Terminal::Control::TermControl& term);
winrt::Microsoft::Terminal::Control::TermControl _AttachControlToContent(const uint64_t& contentGuid);
@@ -516,11 +521,11 @@ namespace winrt::TerminalApp::implementation
winrt::Microsoft::Terminal::Settings::Model::Profile GetClosestProfileForDuplicationOfProfile(const winrt::Microsoft::Terminal::Settings::Model::Profile& profile) const noexcept;
bool _maybeElevate(const winrt::Microsoft::Terminal::Settings::Model::NewTerminalArgs& newTerminalArgs,
const winrt::Microsoft::Terminal::Settings::Model::TerminalSettingsCreateResult& controlSettings,
const winrt::Microsoft::Terminal::Settings::TerminalSettingsCreateResult& controlSettings,
const winrt::Microsoft::Terminal::Settings::Model::Profile& profile);
void _OpenElevatedWT(winrt::Microsoft::Terminal::Settings::Model::NewTerminalArgs newTerminalArgs);
safe_void_coroutine _ConnectionStateChangedHandler(const winrt::Windows::Foundation::IInspectable& sender, const winrt::Windows::Foundation::IInspectable& args);
safe_void_coroutine _ConnectionStateChangedHandler(const winrt::Windows::Foundation::IInspectable& sender, const winrt::Windows::Foundation::IInspectable& args) const;
void _CloseOnExitInfoDismissHandler(const winrt::Windows::Foundation::IInspectable& sender, const winrt::Windows::Foundation::IInspectable& args) const;
void _KeyboardServiceWarningInfoDismissHandler(const winrt::Windows::Foundation::IInspectable& sender, const winrt::Windows::Foundation::IInspectable& args) const;
static bool _IsMessageDismissed(const winrt::Microsoft::Terminal::Settings::Model::InfoBarMessage& message);
@@ -536,7 +541,7 @@ namespace winrt::TerminalApp::implementation
void _ShowWindowChangedHandler(const IInspectable sender, const winrt::Microsoft::Terminal::Control::ShowWindowArgs args);
Windows::Foundation::IAsyncAction _SearchMissingCommandHandler(const IInspectable sender, const winrt::Microsoft::Terminal::Control::SearchMissingCommandEventArgs args);
static Windows::Foundation::IAsyncOperation<Windows::Foundation::Collections::IVectorView<winrt::Microsoft::Management::Deployment::MatchResult>> _FindPackageAsync(hstring query);
Windows::Foundation::IAsyncOperation<Windows::Foundation::Collections::IVectorView<winrt::Microsoft::Management::Deployment::MatchResult>> _FindPackageAsync(hstring query);
void _WindowSizeChanged(const IInspectable sender, const winrt::Microsoft::Terminal::Control::WindowSizeChangedEventArgs args);
void _windowPropertyChanged(const IInspectable& sender, const winrt::Windows::UI::Xaml::Data::PropertyChangedEventArgs& args);

View File

@@ -127,11 +127,9 @@ namespace winrt::TerminalApp::implementation
// TODO:GH#9800 - we used to be able to persist the color scheme that a
// TermControl was initialized with, by name. With the change to having the
// control own its own copy of its settings, this isn't possible anymore.
//
// We may be able to get around this by storing the Name in the Core::Scheme
// object. That would work for schemes set by the Terminal, but not ones set
// by VT, but that seems good enough.
// control own its own copy of its settings, this wasn't possible anymore.
// It probably is once again possible, but Dustin doesn't know how to undo
// the damage done in the ControlSettings migration.
switch (kind)
{
@@ -347,9 +345,9 @@ namespace winrt::TerminalApp::implementation
const auto profile{ settings.FindProfile(_profile.Guid()) };
_profile = profile ? profile : settings.ProfileDefaults();
if (const auto& settings{ _cache->TryLookup(_profile) })
if (const auto settings{ _cache->TryLookup(_profile) })
{
_control.UpdateControlSettings(settings.DefaultSettings(), settings.UnfocusedSettings());
_control.UpdateControlSettings(settings->DefaultSettings(), settings->UnfocusedSettings());
}
}

View File

@@ -3,22 +3,27 @@
#include "pch.h"
#include "TerminalSettingsCache.h"
#include "../TerminalSettingsAppAdapterLib/TerminalSettings.h"
namespace winrt
{
namespace MUX = Microsoft::UI::Xaml;
namespace WUX = Windows::UI::Xaml;
namespace MTSM = Microsoft::Terminal::Settings::Model;
}
namespace winrt::TerminalApp::implementation
{
TerminalSettingsCache::TerminalSettingsCache(const MTSM::CascadiaSettings& settings, const TerminalApp::AppKeyBindings& bindings)
TerminalSettingsPair::TerminalSettingsPair(const winrt::Microsoft::Terminal::Settings::TerminalSettingsCreateResult& result)
{
Reset(settings, bindings);
result.DefaultSettings().try_as(_defaultSettings);
result.UnfocusedSettings().try_as(_unfocusedSettings);
}
MTSM::TerminalSettingsCreateResult TerminalSettingsCache::TryLookup(const MTSM::Profile& profile)
TerminalSettingsCache::TerminalSettingsCache(const MTSM::CascadiaSettings& settings)
{
Reset(settings);
}
std::optional<TerminalSettingsPair> TerminalSettingsCache::TryLookup(const MTSM::Profile& profile)
{
const auto found{ profileGuidSettingsMap.find(profile.Guid()) };
// GH#2455: If there are any panes with controls that had been
@@ -30,18 +35,17 @@ namespace winrt::TerminalApp::implementation
auto& pair{ found->second };
if (!pair.second)
{
pair.second = MTSM::TerminalSettings::CreateWithProfile(_settings, pair.first, _bindings);
pair.second = winrt::Microsoft::Terminal::Settings::TerminalSettings::CreateWithProfile(_settings, pair.first);
}
return pair.second;
return std::optional{ TerminalSettingsPair{ *pair.second } };
}
return nullptr;
return std::nullopt;
}
void TerminalSettingsCache::Reset(const MTSM::CascadiaSettings& settings, const TerminalApp::AppKeyBindings& bindings)
void TerminalSettingsCache::Reset(const MTSM::CascadiaSettings& settings)
{
_settings = settings;
_bindings = bindings;
// Mapping by GUID isn't _excellent_ because the defaults profile doesn't have a stable GUID; however,
// when we stabilize its guid this will become fully safe.
@@ -51,12 +55,12 @@ namespace winrt::TerminalApp::implementation
profileGuidSettingsMap.reserve(allProfiles.Size() + 1);
// Include the Defaults profile for consideration
profileGuidSettingsMap.insert_or_assign(profileDefaults.Guid(), std::pair{ profileDefaults, nullptr });
profileGuidSettingsMap.insert_or_assign(profileDefaults.Guid(), std::pair{ profileDefaults, std::nullopt });
for (const auto& newProfile : allProfiles)
{
// Avoid creating a TerminalSettings right now. They're not totally cheap, and we suspect that users with many
// panes may not be using all of their profiles at the same time. Lazy evaluation is king!
profileGuidSettingsMap.insert_or_assign(newProfile.Guid(), std::pair{ newProfile, nullptr });
profileGuidSettingsMap.insert_or_assign(newProfile.Guid(), std::pair{ newProfile, std::nullopt });
}
}
}

View File

@@ -16,17 +16,34 @@ Abstract:
#include "winrt/Microsoft.Terminal.Settings.Model.h"
#include "winrt/TerminalApp.h"
namespace winrt::Microsoft::Terminal::Settings
{
struct TerminalSettingsCreateResult;
}
namespace winrt::TerminalApp::implementation
{
class TerminalSettingsPair
{
public:
TerminalSettingsPair(const winrt::Microsoft::Terminal::Settings::TerminalSettingsCreateResult& result);
winrt::Microsoft::Terminal::Control::IControlSettings DefaultSettings() const { return _defaultSettings; };
winrt::Microsoft::Terminal::Control::IControlSettings UnfocusedSettings() const { return _unfocusedSettings; };
private:
winrt::Microsoft::Terminal::Control::IControlSettings _defaultSettings{ nullptr };
winrt::Microsoft::Terminal::Control::IControlSettings _unfocusedSettings{ nullptr };
};
struct TerminalSettingsCache
{
TerminalSettingsCache(const Microsoft::Terminal::Settings::Model::CascadiaSettings& settings, const TerminalApp::AppKeyBindings& bindings);
Microsoft::Terminal::Settings::Model::TerminalSettingsCreateResult TryLookup(const Microsoft::Terminal::Settings::Model::Profile& profile);
void Reset(const Microsoft::Terminal::Settings::Model::CascadiaSettings& settings, const TerminalApp::AppKeyBindings& bindings);
TerminalSettingsCache(const Microsoft::Terminal::Settings::Model::CascadiaSettings& settings);
std::optional<TerminalSettingsPair> TryLookup(const Microsoft::Terminal::Settings::Model::Profile& profile);
void Reset(const Microsoft::Terminal::Settings::Model::CascadiaSettings& settings);
private:
Microsoft::Terminal::Settings::Model::CascadiaSettings _settings{ nullptr };
TerminalApp::AppKeyBindings _bindings{ nullptr };
std::unordered_map<winrt::guid, std::pair<Microsoft::Terminal::Settings::Model::Profile, Microsoft::Terminal::Settings::Model::TerminalSettingsCreateResult>> profileGuidSettingsMap;
std::unordered_map<winrt::guid, std::pair<Microsoft::Terminal::Settings::Model::Profile, std::optional<winrt::Microsoft::Terminal::Settings::TerminalSettingsCreateResult>>> profileGuidSettingsMap;
};
}

View File

@@ -13,6 +13,8 @@
#include "SettingsLoadEventArgs.g.cpp"
#include "WindowProperties.g.cpp"
#include "../TerminalSettingsAppAdapterLib/TerminalSettings.h"
using namespace winrt::Windows::ApplicationModel;
using namespace winrt::Windows::ApplicationModel::DataTransfer;
using namespace winrt::Windows::Graphics::Display;
@@ -322,10 +324,6 @@ namespace winrt::TerminalApp::implementation
// - an IAsyncOperation with the dialog result
winrt::Windows::Foundation::IAsyncOperation<ContentDialogResult> TerminalWindow::ShowDialog(winrt::WUX::Controls::ContentDialog dialog)
{
const auto weak = get_weak();
const auto dispatcher = _root->Dispatcher();
const auto root = _root->XamlRoot();
// As mentioned on s_activeDialog, dismissing the active dialog is necessary.
// We repeat it a few times in case the resume_foreground failed to work,
// but I found that one iteration will always be enough in practice.
@@ -339,7 +337,7 @@ namespace winrt::TerminalApp::implementation
s_activeDialog.Hide();
// Wait for the current dialog to be hidden.
co_await wil::resume_foreground(dispatcher, CoreDispatcherPriority::Low);
co_await wil::resume_foreground(_root->Dispatcher(), CoreDispatcherPriority::Low);
}
// If two sources call ShowDialog() simultaneously, it may happen that both enter the above loop,
@@ -356,7 +354,7 @@ namespace winrt::TerminalApp::implementation
// IMPORTANT: This is necessary as documented in the ContentDialog MSDN docs.
// Since we're hosting the dialog in a Xaml island, we need to connect it to the
// xaml tree somehow.
dialog.XamlRoot(root);
dialog.XamlRoot(_root->XamlRoot());
// IMPORTANT: Set the requested theme of the dialog, because the
// PopupRoot isn't directly in the Xaml tree of our root. So the dialog
@@ -370,17 +368,14 @@ namespace winrt::TerminalApp::implementation
// theme on each element up to the root. We're relying a bit on Xaml's implementation
// details here, but it does have the desired effect.
// It's not enough to set the theme on the dialog alone.
auto themingLambda{ [weak](const Windows::Foundation::IInspectable& sender, const RoutedEventArgs&) {
if (const auto strong = weak.get())
auto themingLambda{ [this](const Windows::Foundation::IInspectable& sender, const RoutedEventArgs&) {
auto theme{ _settings.GlobalSettings().CurrentTheme() };
auto requestedTheme{ theme.RequestedTheme() };
auto element{ sender.try_as<winrt::Windows::UI::Xaml::FrameworkElement>() };
while (element)
{
auto theme{ strong->_settings.GlobalSettings().CurrentTheme() };
auto requestedTheme{ theme.RequestedTheme() };
auto element{ sender.try_as<winrt::Windows::UI::Xaml::FrameworkElement>() };
while (element)
{
element.RequestedTheme(requestedTheme);
element = element.Parent().try_as<winrt::Windows::UI::Xaml::FrameworkElement>();
}
element.RequestedTheme(requestedTheme);
element = element.Parent().try_as<winrt::Windows::UI::Xaml::FrameworkElement>();
}
} };
@@ -620,11 +615,11 @@ namespace winrt::TerminalApp::implementation
if ((_appArgs && _appArgs->ParsedArgs().GetSize().has_value()) || (proposedSize.Width == 0 && proposedSize.Height == 0))
{
// Use the default profile to determine how big of a window we need.
const auto settings{ TerminalSettings::CreateWithNewTerminalArgs(_settings, nullptr, nullptr) };
const auto settings{ Settings::TerminalSettings::CreateWithNewTerminalArgs(_settings, nullptr) };
const til::size emptySize{};
const auto commandlineSize = _appArgs ? _appArgs->ParsedArgs().GetSize().value_or(emptySize) : til::size{};
proposedSize = TermControl::GetProposedDimensions(settings.DefaultSettings(),
proposedSize = TermControl::GetProposedDimensions(*settings.DefaultSettings(),
dpi,
commandlineSize.width,
commandlineSize.height);
@@ -895,11 +890,6 @@ namespace winrt::TerminalApp::implementation
{
// Manually bubble the OnDirectKeyEvent event up through the focus tree.
auto xamlRoot{ _root->XamlRoot() };
if (!xamlRoot)
{
return false;
}
auto focusedObject{ Windows::UI::Xaml::Input::FocusManager::GetFocusedElement(xamlRoot) };
do
{

View File

@@ -53,16 +53,6 @@ namespace winrt::TerminalApp::implementation
return static_cast<float>(minMaxCloseWidth) / 3.0f;
}
bool TitlebarControl::Focused()
{
return MinMaxCloseControl().Focused();
}
void TitlebarControl::Focused(bool focused)
{
MinMaxCloseControl().Focused(focused);
}
IInspectable TitlebarControl::Content()
{
return ContentRoot().Content();

View File

@@ -17,9 +17,6 @@ namespace winrt::TerminalApp::implementation
void ReleaseButtons();
float CaptionButtonWidth();
bool Focused();
void Focused(bool focused);
IInspectable Content();
void Content(IInspectable content);

View File

@@ -29,7 +29,6 @@ namespace TerminalApp
void ClickButton(CaptionButton button);
void ReleaseButtons();
Single CaptionButtonWidth { get; };
Boolean Focused { get; set; };
IInspectable Content;
Windows.UI.Xaml.Controls.Border DragBar { get; };

View File

@@ -0,0 +1,87 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
#include "pch.h"
#include "ConsoleInputReader.h"
#include "unicode.hpp"
ConsoleInputReader::ConsoleInputReader(HANDLE handle) :
_handle(handle)
{
_buffer.resize(BufferSize);
_convertedString.reserve(BufferSize);
}
void ConsoleInputReader::SetWindowSizeChangedCallback(std::function<void()> callback)
{
_windowSizeChangedCallback = std::move(callback);
}
std::optional<std::wstring_view> ConsoleInputReader::Read()
{
DWORD readCount{ 0 };
_convertedString.clear();
while (_convertedString.empty())
{
_buffer.resize(BufferSize);
auto succeeded =
ReadConsoleInputW(_handle, _buffer.data(), gsl::narrow_cast<DWORD>(_buffer.size()), &readCount);
if (!succeeded)
{
return std::nullopt;
}
_buffer.resize(readCount);
for (auto it = _buffer.begin(); it != _buffer.end(); ++it)
{
if (it->EventType == WINDOW_BUFFER_SIZE_EVENT && _windowSizeChangedCallback)
{
_windowSizeChangedCallback();
}
else if (it->EventType == KEY_EVENT)
{
const auto& keyEvent = it->Event.KeyEvent;
if (keyEvent.bKeyDown || (!keyEvent.bKeyDown && keyEvent.wVirtualKeyCode == VK_MENU))
{
// Got a high surrogate at the end of the buffer
if (IS_HIGH_SURROGATE(keyEvent.uChar.UnicodeChar))
{
_highSurrogate.emplace(keyEvent.uChar.UnicodeChar);
continue; // we've consumed it -- only dispatch it if we get a low
}
if (IS_LOW_SURROGATE(keyEvent.uChar.UnicodeChar))
{
// No matter what we do, we want to destructively consume the high surrogate
if (const auto oldHighSurrogate{ std::exchange(_highSurrogate, std::nullopt) })
{
_convertedString.push_back(*_highSurrogate);
}
else
{
// If we get a low without a high surrogate, we've done everything we can.
// This is an illegal state.
_convertedString.push_back(UNICODE_REPLACEMENT);
continue; // onto the next event
}
}
// (\0 with a scancode is probably a modifier key, not a VT input key)
if (keyEvent.uChar.UnicodeChar != L'\0' || keyEvent.wVirtualScanCode == 0)
{
if (_highSurrogate) // non-destructive: we don't want to set it to nullopt needlessly for every character
{
// If we get a high surrogate *here*, we didn't find a low surrogate.
// This state is also illegal.
_convertedString.push_back(UNICODE_REPLACEMENT);
_highSurrogate.reset();
}
_convertedString.push_back(keyEvent.uChar.UnicodeChar);
}
}
}
}
}
return _convertedString;
}

View File

@@ -0,0 +1,33 @@
/*++
Copyright (c) Microsoft Corporation.
Licensed under the MIT license.
Module Name:
ConsoleInputReader.h
Abstract:
This file contains a class whose sole purpose is to
abstract away a bunch of details you usually need to
know to read VT from a console input handle.
--*/
class ConsoleInputReader
{
public:
explicit ConsoleInputReader(HANDLE handle);
void SetWindowSizeChangedCallback(std::function<void()> callback);
std::optional<std::wstring_view> Read();
private:
static constexpr size_t BufferSize{ 128 };
HANDLE _handle;
std::wstring _convertedString;
std::vector<INPUT_RECORD> _buffer;
std::optional<wchar_t> _highSurrogate;
std::function<void()> _windowSizeChangedCallback;
};

View File

@@ -0,0 +1,93 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Globals">
<ProjectGuid>{067F0A06-FCB7-472C-96E9-B03B54E8E18D}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>TerminalAzBridge</RootNamespace>
<ProjectName>TerminalAzBridge</ProjectName>
<TargetName>TerminalAzBridge</TargetName>
<ConfigurationType>Application</ConfigurationType>
<OpenConsoleUniversalApp>false</OpenConsoleUniversalApp>
<ApplicationType>Windows Store</ApplicationType>
<TargetPlatformIdentifier>Windows</TargetPlatformIdentifier>
<VersionInfoFileDescription>Windows Terminal Azure Cloud Shell Connector</VersionInfoFileDescription>
</PropertyGroup>
<PropertyGroup Label="NuGet Dependencies">
<TerminalCppWinrt>true</TerminalCppWinrt>
</PropertyGroup>
<Import Project="..\..\..\common.openconsole.props" Condition="'$(OpenConsoleDir)'==''" />
<Import Project="$(OpenConsoleDir)src\common.nugetversions.props" />
<Import Project="$(OpenConsoleDir)src\cppwinrt.build.pre.props" />
<PropertyGroup>
<GenerateManifest>true</GenerateManifest>
<EmbedManifest>true</EmbedManifest>
</PropertyGroup>
<!-- Source Files -->
<ItemGroup>
<ClInclude Include="pch.h" />
<ClInclude Include="ConsoleInputReader.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="pch.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="main.cpp" />
<ClCompile Include="ConsoleInputReader.cpp" />
</ItemGroup>
<!-- Dependencies -->
<ItemGroup>
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalConnection\TerminalConnection.vcxproj">
<Project>{CA5CAD1A-C46D-4588-B1C0-40F31AE9100B}</Project>
</ProjectReference>
<ProjectReference Include="$(OpenConsoleDir)src\types\lib\types.vcxproj" />
</ItemGroup>
<!--
This ItemGroup and the Globals PropertyGroup below it are required in order
to enable F5 debugging for the unpackaged application
-->
<ItemGroup>
<PropertyPageSchema Include="$(VCTargetsPath)$(LangID)\debugger_general.xml" />
<PropertyPageSchema Include="$(VCTargetsPath)$(LangID)\debugger_local_windows.xml" />
</ItemGroup>
<PropertyGroup Label="Globals">
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<Import Project="$(OpenConsoleDir)src\cppwinrt.build.post.props" />
<Import Project="$(OpenConsoleDir)src\common.nugetversions.targets" />
<!-- These have to come after post.props because the Cpp common targets will inexplicably overwrite them. -->
<ItemDefinitionGroup>
<ClCompile>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
</Link>
</ItemDefinitionGroup>
<!--
BODGY
The wapproj `GetResolvedWinMD` target tries to get a winmd from every cppwinrt
executable we put in the package. But we DON'T produce a winmd. This makes the
FastUpToDate check fail every time, and leads to the whole wapproj build
running even if you're just f5'ing the package. EVEN AFTER A SUCCESSFUL BUILD.
Setting GenerateWindowsMetadata=false is enough to tell the build system that
we don't produce one, and get it off our backs.
-->
<ItemDefinitionGroup>
<Link>
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
</Link>
</ItemDefinitionGroup>
<Import Project="$(OpenConsoleDir)\build\rules\GenerateSxsManifestsFromWinmds.targets" />
</Project>

View File

@@ -0,0 +1,108 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
#include "pch.h"
#include "winrt/Microsoft.Terminal.TerminalConnection.h"
#include "ConsoleInputReader.h"
using namespace winrt;
using namespace winrt::Windows::Foundation;
using namespace winrt::Microsoft::Terminal::TerminalConnection;
static til::size GetConsoleScreenSize(HANDLE outputHandle)
{
CONSOLE_SCREEN_BUFFER_INFOEX csbiex{};
csbiex.cbSize = sizeof(csbiex);
GetConsoleScreenBufferInfoEx(outputHandle, &csbiex);
return {
(csbiex.srWindow.Right - csbiex.srWindow.Left) + 1,
(csbiex.srWindow.Bottom - csbiex.srWindow.Top) + 1
};
}
static ConnectionState RunConnectionToCompletion(const ITerminalConnection& connection, HANDLE outputHandle, HANDLE inputHandle)
{
connection.TerminalOutput([outputHandle](const winrt::hstring& output) {
WriteConsoleW(outputHandle, output.data(), output.size(), nullptr, nullptr);
});
// Detach a thread to spin the console read indefinitely.
// This application exits when the connection is closed, so
// the connection's lifetime will outlast this thread.
std::thread([connection, outputHandle, inputHandle] {
ConsoleInputReader reader{ inputHandle };
reader.SetWindowSizeChangedCallback([&]() {
const auto size = GetConsoleScreenSize(outputHandle);
connection.Resize(size.height, size.width);
});
while (true)
{
auto input = reader.Read();
if (input)
{
connection.WriteInput(winrt_wstring_to_array_view(*input));
}
}
}).detach();
std::condition_variable stateChangeVar;
std::optional<ConnectionState> state;
std::mutex stateMutex;
connection.StateChanged([&](auto&& /*s*/, auto&& /*e*/) {
std::unique_lock<std::mutex> lg{ stateMutex };
state = connection.State();
stateChangeVar.notify_all();
});
connection.Start();
std::unique_lock<std::mutex> lg{ stateMutex };
stateChangeVar.wait(lg, [&]() {
if (!state.has_value())
{
return false;
}
return state.value() == ConnectionState::Closed || state.value() == ConnectionState::Failed;
});
return state.value();
}
int wmain(int /*argc*/, wchar_t** /*argv*/)
{
winrt::init_apartment(winrt::apartment_type::single_threaded);
DWORD inputMode{}, outputMode{};
auto conIn{ GetStdHandle(STD_INPUT_HANDLE) }, conOut{ GetStdHandle(STD_OUTPUT_HANDLE) };
auto codepage{ GetConsoleCP() }, outputCodepage{ GetConsoleOutputCP() };
RETURN_IF_WIN32_BOOL_FALSE(GetConsoleMode(conIn, &inputMode));
RETURN_IF_WIN32_BOOL_FALSE(GetConsoleMode(conOut, &outputMode));
RETURN_IF_WIN32_BOOL_FALSE(SetConsoleMode(conIn, ENABLE_WINDOW_INPUT | ENABLE_VIRTUAL_TERMINAL_INPUT));
RETURN_IF_WIN32_BOOL_FALSE(SetConsoleMode(conOut, ENABLE_PROCESSED_OUTPUT | ENABLE_VIRTUAL_TERMINAL_PROCESSING | ENABLE_WRAP_AT_EOL_OUTPUT | DISABLE_NEWLINE_AUTO_RETURN));
RETURN_IF_WIN32_BOOL_FALSE(SetConsoleCP(CP_UTF8));
RETURN_IF_WIN32_BOOL_FALSE(SetConsoleOutputCP(CP_UTF8));
auto restoreConsoleModes = wil::scope_exit([&]() {
SetConsoleMode(conIn, inputMode);
SetConsoleMode(conOut, outputMode);
SetConsoleCP(codepage);
SetConsoleOutputCP(outputCodepage);
});
const auto size = GetConsoleScreenSize(conOut);
AzureConnection azureConn{};
winrt::Windows::Foundation::Collections::ValueSet vs{};
vs.Insert(L"initialRows", winrt::Windows::Foundation::PropertyValue::CreateUInt32(gsl::narrow_cast<uint32_t>(size.height)));
vs.Insert(L"initialCols", winrt::Windows::Foundation::PropertyValue::CreateUInt32(gsl::narrow_cast<uint32_t>(size.width)));
azureConn.Initialize(vs);
const auto state = RunConnectionToCompletion(azureConn, conOut, conIn);
return state == ConnectionState::Closed ? 0 : 1;
}

View File

@@ -0,0 +1,4 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
#include "pch.h"

View File

@@ -0,0 +1,40 @@
/*++
Copyright (c) Microsoft Corporation
Licensed under the MIT license.
Module Name:
- pch.h
Abstract:
- Contains external headers to include in the precompile phase of console build process.
- Avoid including internal project headers. Instead include them only in the classes that need them (helps with test project building).
--*/
#pragma once
// Ignore checked iterators warning from VC compiler.
#define _SCL_SECURE_NO_WARNINGS
// Block minwindef.h min/max macros to prevent <algorithm> conflict
#define NOMINMAX
#define WIN32_LEAN_AND_MEAN
#define NOMCX
#define NOHELP
#define NOCOMM
#include <Unknwn.h>
#include <windows.h>
#include "../inc/LibraryIncludes.h"
#include <wil/cppwinrt.h>
#include <winrt/Windows.system.h>
#include <winrt/Windows.Foundation.h>
#include <winrt/Windows.Foundation.Collections.h>
#include <wil/resource.h>
#include <wil/win32_helpers.h>
#include <cppwinrt_utils.h>

View File

@@ -1,49 +0,0 @@
/*++
Copyright (c) Microsoft Corporation
Licensed under the MIT license.
--*/
#pragma once
#include "../../inc/cppwinrt_utils.h"
#include "../../inc/ControlProperties.h"
#include <DefaultSettings.h>
#include <conattrs.hpp>
namespace winrt::Microsoft::Terminal::Control::implementation
{
struct ControlAppearance : public winrt::implements<ControlAppearance, Microsoft::Terminal::Core::ICoreAppearance, Microsoft::Terminal::Control::IControlAppearance>
{
#define SETTINGS_GEN(type, name, ...) WINRT_PROPERTY(type, name, __VA_ARGS__);
CORE_APPEARANCE_SETTINGS(SETTINGS_GEN)
CONTROL_APPEARANCE_SETTINGS(SETTINGS_GEN)
#undef SETTINGS_GEN
private:
// Color Table is special because it's an array
std::array<winrt::Microsoft::Terminal::Core::Color, COLOR_TABLE_SIZE> _ColorTable;
public:
winrt::Microsoft::Terminal::Core::Color GetColorTableEntry(int32_t index) noexcept
{
return _ColorTable.at(index);
}
void SetColorTableEntry(int32_t index,
winrt::Microsoft::Terminal::Core::Color color) noexcept
{
_ColorTable.at(index) = color;
}
ControlAppearance(Control::IControlAppearance appearance)
{
#define COPY_SETTING(type, name, ...) _##name = appearance.name();
CORE_APPEARANCE_SETTINGS(COPY_SETTING)
CONTROL_APPEARANCE_SETTINGS(COPY_SETTING)
#undef COPY_SETTING
for (size_t i = 0; i < _ColorTable.size(); i++)
{
_ColorTable[i] = appearance.GetColorTableEntry(static_cast<int32_t>(i));
}
}
};
}

View File

@@ -19,10 +19,12 @@
#include "../../renderer/base/renderer.hpp"
#include "../../renderer/uia/UiaRenderer.hpp"
#include "../../types/inc/CodepointWidthDetector.hpp"
#include "../../types/inc/utils.hpp"
#include "ControlCore.g.cpp"
#include "SelectionColor.g.cpp"
using namespace ::Microsoft::Console;
using namespace ::Microsoft::Console::Types;
using namespace ::Microsoft::Console::VirtualTerminal;
using namespace ::Microsoft::Terminal::Core;
@@ -89,7 +91,9 @@ namespace winrt::Microsoft::Terminal::Control::implementation
return true;
}();
_settings = winrt::make_self<implementation::ControlSettings>(settings, unfocusedAppearance);
_settings = settings;
_hasUnfocusedAppearance = static_cast<bool>(unfocusedAppearance);
_unfocusedAppearance = _hasUnfocusedAppearance ? unfocusedAppearance : settings;
_terminal = std::make_shared<::Microsoft::Terminal::Core::Terminal>();
const auto lock = _terminal->LockForWriting();
@@ -102,7 +106,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
});
// GH#8969: pre-seed working directory to prevent potential races
_terminal->SetWorkingDirectory(_settings->StartingDirectory());
_terminal->SetWorkingDirectory(_settings.StartingDirectory());
_terminal->SetCopyToClipboardCallback([this](wil::zwstring_view wstr) {
WriteToClipboard.raise(*this, winrt::make<WriteToClipboardEventArgs>(winrt::hstring{ std::wstring_view{ wstr } }, std::string{}, std::string{}));
@@ -149,27 +153,12 @@ namespace winrt::Microsoft::Terminal::Control::implementation
_renderer->SetBackgroundColorChangedCallback([this]() { _rendererBackgroundColorChanged(); });
_renderer->SetFrameColorChangedCallback([this]() { _rendererTabColorChanged(); });
_renderer->SetRendererEnteredErrorStateCallback([this]() { _rendererEnteredErrorState(); });
_renderer->SetRendererEnteredErrorStateCallback([this]() { RendererEnteredErrorState.raise(nullptr, nullptr); });
}
UpdateSettings(settings, unfocusedAppearance);
}
void ControlCore::_rendererEnteredErrorState()
{
// The first time the renderer fails out (after all of its own retries), switch it to D2D and WARP
// and force it to try again. If it _still_ fails, we can let it halt.
if (_renderFailures++ == 0)
{
const auto lock = _terminal->LockForWriting();
_renderEngine->SetGraphicsAPI(parseGraphicsAPI(GraphicsAPI::Direct2D));
_renderEngine->SetSoftwareRendering(true);
_renderer->EnablePainting();
return;
}
RendererEnteredErrorState.raise(nullptr, nullptr);
}
void ControlCore::_setupDispatcherAndCallbacks()
{
// Get our dispatcher. If we're hosted in-proc with XAML, this will get
@@ -280,9 +269,8 @@ namespace winrt::Microsoft::Terminal::Control::implementation
shared->updateScrollBar.reset();
}
void ControlCore::AttachToNewControl(const Microsoft::Terminal::Control::IKeyBindings& keyBindings)
void ControlCore::AttachToNewControl()
{
_settings->KeyBindings(keyBindings);
_setupDispatcherAndCallbacks();
const auto actualNewSize = _actualFont.GetSize();
// Bubble this up, so our new control knows how big we want the font.
@@ -349,12 +337,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation
}
}
void ControlCore::HardResetWithoutErase()
{
const auto lock = _terminal->LockForWriting();
_terminal->HardResetWithoutErase();
}
bool ControlCore::Initialize(const float actualWidth,
const float actualHeight,
const float compositionScale)
@@ -420,10 +402,12 @@ namespace winrt::Microsoft::Terminal::Control::implementation
}
// Override the default width and height to match the size of the swapChainPanel
_settings->InitialCols(width);
_settings->InitialRows(height);
const til::size viewportSize{ Utils::ClampToShortMax(width, 1),
Utils::ClampToShortMax(height, 1) };
_terminal->CreateFromSettings(*_settings, *_renderer);
// TODO:MSFT:20642297 - Support infinite scrollback here, if HistorySize is -1
_terminal->Create(viewportSize, Utils::ClampToShortMax(_settings.HistorySize(), 0), *_renderer);
_terminal->UpdateSettings(_settings);
// Tell the render engine to notify us when the swap chain changes.
// We do this after we initially set the swapchain so as to avoid
@@ -432,12 +416,12 @@ namespace winrt::Microsoft::Terminal::Control::implementation
_renderEngineSwapChainChanged(handle);
});
_renderEngine->SetRetroTerminalEffect(_settings->RetroTerminalEffect());
_renderEngine->SetPixelShaderPath(_settings->PixelShaderPath());
_renderEngine->SetPixelShaderImagePath(_settings->PixelShaderImagePath());
_renderEngine->SetGraphicsAPI(parseGraphicsAPI(_settings->GraphicsAPI()));
_renderEngine->SetDisablePartialInvalidation(_settings->DisablePartialInvalidation());
_renderEngine->SetSoftwareRendering(_settings->SoftwareRendering());
_renderEngine->SetRetroTerminalEffect(_settings.RetroTerminalEffect());
_renderEngine->SetPixelShaderPath(_settings.PixelShaderPath());
_renderEngine->SetPixelShaderImagePath(_settings.PixelShaderImagePath());
_renderEngine->SetGraphicsAPI(parseGraphicsAPI(_settings.GraphicsAPI()));
_renderEngine->SetDisablePartialInvalidation(_settings.DisablePartialInvalidation());
_renderEngine->SetSoftwareRendering(_settings.SoftwareRendering());
_updateAntiAliasingMode();
@@ -594,7 +578,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
_updateSelectionUI();
return true;
}
else if (vkey == VK_TAB && !mods.IsAltPressed() && !mods.IsCtrlPressed() && _settings->DetectURLs())
else if (vkey == VK_TAB && !mods.IsAltPressed() && !mods.IsCtrlPressed() && _settings.DetectURLs())
{
// [Shift +] Tab --> next/previous hyperlink
const auto direction = mods.IsShiftPressed() ? ::Terminal::SearchDirection::Backward : ::Terminal::SearchDirection::Forward;
@@ -621,7 +605,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
else if (vkey == VK_RETURN && !mods.IsCtrlPressed() && !mods.IsAltPressed())
{
// [Shift +] Enter --> copy text
CopySelectionToClipboard(mods.IsShiftPressed(), false, _settings->CopyFormatting());
CopySelectionToClipboard(mods.IsShiftPressed(), false, _settings.CopyFormatting());
_terminal->ClearSelection();
_updateSelectionUI();
return true;
@@ -779,7 +763,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
_runtimeFocusedOpacity = focused ? newOpacity : _runtimeFocusedOpacity;
// Manually turn off acrylic if they turn off transparency.
_runtimeUseAcrylic = newOpacity < 1.0f && _settings->UseAcrylic();
_runtimeUseAcrylic = newOpacity < 1.0f && _settings.UseAcrylic();
// Update the renderer as well. It might need to fall back from
// cleartype -> grayscale if the BG is transparent / acrylic.
@@ -796,7 +780,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
void ControlCore::ToggleShaderEffects()
{
const auto path = _settings->PixelShaderPath();
const auto path = _settings.PixelShaderPath();
const auto lock = _terminal->LockForWriting();
// Originally, this action could be used to enable the retro effects
// even when they're set to `false` in the settings. If the user didn't
@@ -901,24 +885,26 @@ namespace winrt::Microsoft::Terminal::Control::implementation
// - INVARIANT: This method can only be called if the caller DOES NOT HAVE writing lock on the terminal.
void ControlCore::UpdateSettings(const IControlSettings& settings, const IControlAppearance& newAppearance)
{
_settings = winrt::make_self<implementation::ControlSettings>(settings, newAppearance);
_settings = settings;
_hasUnfocusedAppearance = static_cast<bool>(newAppearance);
_unfocusedAppearance = _hasUnfocusedAppearance ? newAppearance : settings;
const auto lock = _terminal->LockForWriting();
_builtinGlyphs = _settings->EnableBuiltinGlyphs();
_colorGlyphs = _settings->EnableColorGlyphs();
_cellWidth = CSSLengthPercentage::FromString(_settings->CellWidth().c_str());
_cellHeight = CSSLengthPercentage::FromString(_settings->CellHeight().c_str());
_builtinGlyphs = _settings.EnableBuiltinGlyphs();
_colorGlyphs = _settings.EnableColorGlyphs();
_cellWidth = CSSLengthPercentage::FromString(_settings.CellWidth().c_str());
_cellHeight = CSSLengthPercentage::FromString(_settings.CellHeight().c_str());
_runtimeOpacity = std::nullopt;
_runtimeFocusedOpacity = std::nullopt;
// Manually turn off acrylic if they turn off transparency.
_runtimeUseAcrylic = _settings->Opacity() < 1.0 && _settings->UseAcrylic();
_runtimeUseAcrylic = _settings.Opacity() < 1.0 && _settings.UseAcrylic();
const auto sizeChanged = _setFontSizeUnderLock(_settings->FontSize());
const auto sizeChanged = _setFontSizeUnderLock(_settings.FontSize());
// Update the terminal core with its new Core settings
_terminal->UpdateSettings(*_settings);
_terminal->UpdateSettings(_settings);
if (!_initializedTerminal.load(std::memory_order_relaxed))
{
@@ -927,12 +913,11 @@ namespace winrt::Microsoft::Terminal::Control::implementation
return;
}
_renderEngine->SetGraphicsAPI(parseGraphicsAPI(_settings->GraphicsAPI()));
_renderEngine->SetDisablePartialInvalidation(_settings->DisablePartialInvalidation());
_renderEngine->SetSoftwareRendering(_settings->SoftwareRendering());
_renderEngine->SetGraphicsAPI(parseGraphicsAPI(_settings.GraphicsAPI()));
_renderEngine->SetDisablePartialInvalidation(_settings.DisablePartialInvalidation());
_renderEngine->SetSoftwareRendering(_settings.SoftwareRendering());
// Inform the renderer of our opacity
_renderEngine->EnableTransparentBackground(_isBackgroundTransparent());
_renderFailures = 0; // We may have changed the engine; reset the failure counter.
// Trigger a redraw to repaint the window background and tab colors.
_renderer->TriggerRedrawAll(true, true);
@@ -951,30 +936,34 @@ namespace winrt::Microsoft::Terminal::Control::implementation
void ControlCore::ApplyAppearance(const bool focused)
{
const auto lock = _terminal->LockForWriting();
const auto& newAppearance{ focused ? _settings->FocusedAppearance() : _settings->UnfocusedAppearance() };
const IControlAppearance newAppearance{ focused ? _settings : _unfocusedAppearance };
// Update the terminal core with its new Core settings
_terminal->UpdateAppearance(*newAppearance);
_terminal->UpdateAppearance(newAppearance);
if ((focused || !_hasUnfocusedAppearance) && _focusedColorSchemeOverride)
{
_terminal->UpdateColorScheme(_focusedColorSchemeOverride);
}
// Update AtlasEngine settings under the lock
if (_renderEngine)
{
// Update AtlasEngine settings under the lock
_renderEngine->SetRetroTerminalEffect(newAppearance->RetroTerminalEffect());
_renderEngine->SetPixelShaderPath(newAppearance->PixelShaderPath());
_renderEngine->SetPixelShaderImagePath(newAppearance->PixelShaderImagePath());
_renderEngine->SetRetroTerminalEffect(newAppearance.RetroTerminalEffect());
_renderEngine->SetPixelShaderPath(newAppearance.PixelShaderPath());
_renderEngine->SetPixelShaderImagePath(newAppearance.PixelShaderImagePath());
// Incase EnableUnfocusedAcrylic is disabled and Focused Acrylic is set to true,
// the terminal should ignore the unfocused opacity from settings.
// The Focused Opacity from settings should be ignored if overridden at runtime.
const auto useFocusedRuntimeOpacity = focused || (!_settings->EnableUnfocusedAcrylic() && UseAcrylic());
const auto newOpacity = useFocusedRuntimeOpacity ? FocusedOpacity() : newAppearance->Opacity();
const auto useFocusedRuntimeOpacity = focused || (!_settings.EnableUnfocusedAcrylic() && UseAcrylic());
const auto newOpacity = useFocusedRuntimeOpacity ? FocusedOpacity() : newAppearance.Opacity();
_setOpacity(newOpacity, focused);
// No need to update Acrylic if UnfocusedAcrylic is disabled
if (_settings->EnableUnfocusedAcrylic())
if (_settings.EnableUnfocusedAcrylic())
{
// Manually turn off acrylic if they turn off transparency.
_runtimeUseAcrylic = Opacity() < 1.0 && newAppearance->UseAcrylic();
_runtimeUseAcrylic = Opacity() < 1.0 && newAppearance.UseAcrylic();
}
// Update the renderer as well. It might need to fall back from
@@ -996,24 +985,68 @@ namespace winrt::Microsoft::Terminal::Control::implementation
Control::IControlSettings ControlCore::Settings()
{
return *_settings;
return _settings;
}
Control::IControlAppearance ControlCore::FocusedAppearance() const
{
return *_settings->FocusedAppearance();
return _settings;
}
Control::IControlAppearance ControlCore::UnfocusedAppearance() const
{
return *_settings->UnfocusedAppearance();
return _unfocusedAppearance;
}
void ControlCore::ApplyPreviewColorScheme(const Core::ICoreScheme& scheme)
{
const auto lock = _terminal->LockForReading();
auto& renderSettings = _terminal->GetRenderSettings();
if (!_stashedColorScheme)
{
_stashedColorScheme = std::make_unique_for_overwrite<StashedColorScheme>();
*_stashedColorScheme = {
.scheme = renderSettings.GetColorTable(),
.foregroundAlias = renderSettings.GetColorAliasIndex(ColorAlias::DefaultForeground),
.backgroundAlias = renderSettings.GetColorAliasIndex(ColorAlias::DefaultBackground),
};
}
_terminal->UpdateColorScheme(scheme);
_renderer->TriggerRedrawAll(true);
}
void ControlCore::ResetPreviewColorScheme()
{
if (_stashedColorScheme)
{
const auto lock = _terminal->LockForWriting();
auto& renderSettings = _terminal->GetRenderSettings();
decltype(auto) stashedScheme{ *_stashedColorScheme.get() };
for (size_t i = 0; i < TextColor::TABLE_SIZE; ++i)
{
renderSettings.SetColorTableEntry(i, til::at(stashedScheme.scheme, i));
}
renderSettings.SetColorAliasIndex(ColorAlias::DefaultForeground, stashedScheme.foregroundAlias);
renderSettings.SetColorAliasIndex(ColorAlias::DefaultBackground, stashedScheme.backgroundAlias);
_renderer->TriggerRedrawAll(true);
}
_stashedColorScheme.reset();
}
void ControlCore::SetOverrideColorScheme(const Core::ICoreScheme& scheme)
{
const auto lock = _terminal->LockForWriting();
_focusedColorSchemeOverride = scheme;
_terminal->UpdateColorScheme(scheme ? scheme : _settings.as<Core::ICoreScheme>());
_renderer->TriggerRedrawAll(true);
}
void ControlCore::_updateAntiAliasingMode()
{
D2D1_TEXT_ANTIALIAS_MODE mode;
// Update AtlasEngine's AntialiasingMode
switch (_settings->AntialiasingMode())
switch (_settings.AntialiasingMode())
{
case TextAntialiasingMode::Cleartype:
mode = D2D1_TEXT_ANTIALIAS_MODE_CLEARTYPE;
@@ -1046,7 +1079,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
if (_renderEngine)
{
static constexpr auto cloneMap = [](const IFontFeatureMap& map) {
static constexpr auto cloneMap = [](const auto& map) {
std::unordered_map<std::wstring_view, float> clone;
if (map)
{
@@ -1059,8 +1092,8 @@ namespace winrt::Microsoft::Terminal::Control::implementation
return clone;
};
const auto fontFeatures = _settings->FontFeatures();
const auto fontAxes = _settings->FontAxes();
const auto fontFeatures = _settings.FontFeatures();
const auto fontAxes = _settings.FontAxes();
const auto featureMap = cloneMap(fontFeatures);
const auto axesMap = cloneMap(fontAxes);
@@ -1084,8 +1117,8 @@ namespace winrt::Microsoft::Terminal::Control::implementation
{
// Make sure we have a non-zero font size
const auto newSize = std::max(fontSize, 1.0f);
const auto fontFace = _settings->FontFace();
const auto fontWeight = _settings->FontWeight();
const auto fontFace = _settings.FontFace();
const auto fontWeight = _settings.FontWeight();
_desiredFont = { fontFace, 0, fontWeight.Weight, newSize, CP_UTF8 };
_actualFont = { fontFace, 0, fontWeight.Weight, _desiredFont.GetEngineSize(), CP_UTF8, false };
@@ -1107,7 +1140,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
{
const auto lock = _terminal->LockForWriting();
if (_setFontSizeUnderLock(_settings->FontSize()))
if (_setFontSizeUnderLock(_settings.FontSize()))
{
_refreshSizeUnderLock();
}
@@ -1664,7 +1697,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
bool ControlCore::CopyOnSelect() const
{
return _settings->CopyOnSelect();
return _settings.CopyOnSelect();
}
winrt::hstring ControlCore::SelectedText(bool trimTrailingWhitespace) const
@@ -1690,7 +1723,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
// - resetOnly: If true, only Reset() will be called, if anything. FindNext() will never be called.
// Return Value:
// - <none>
SearchResults ControlCore::Search(const SearchRequest& request)
SearchResults ControlCore::Search(SearchRequest request)
{
const auto lock = _terminal->LockForWriting();
@@ -1699,9 +1732,15 @@ namespace winrt::Microsoft::Terminal::Control::implementation
WI_SetFlagIf(flags, SearchFlag::RegularExpression, request.RegularExpression);
const auto searchInvalidated = _searcher.IsStale(*_terminal.get(), request.Text, flags);
if (searchInvalidated || request.ExecuteSearch)
if (searchInvalidated || !request.ResetOnly)
{
std::vector<til::point_span> oldResults;
til::point_span oldFocused;
if (const auto focused = _terminal->GetSearchHighlightFocused())
{
oldFocused = *focused;
}
if (searchInvalidated)
{
@@ -1710,18 +1749,18 @@ namespace winrt::Microsoft::Terminal::Control::implementation
_terminal->SetSearchHighlights(_searcher.Results());
}
if (request.ExecuteSearch)
if (!request.ResetOnly)
{
_searcher.FindNext(!request.GoForward);
}
_terminal->SetSearchHighlightFocused(gsl::narrow<size_t>(std::max<ptrdiff_t>(0, _searcher.CurrentMatch())));
_renderer->TriggerSearchHighlight(oldResults);
}
if (request.ScrollIntoView)
{
_terminal->ScrollToSearchHighlight(request.ScrollOffset);
if (const auto focused = _terminal->GetSearchHighlightFocused(); focused && *focused != oldFocused)
{
_terminal->ScrollToSearchHighlight(request.ScrollOffset);
}
}
int32_t totalMatches = 0;
@@ -1928,7 +1967,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation
{
// The lock must be held, because it calls into IRenderData which is shared state.
const auto lock = _terminal->LockForWriting();
_renderFailures = 0;
_renderer->EnablePainting();
}
@@ -2016,7 +2054,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
_terminal->MultiClickSelection(terminalPosition, mode);
selectionNeedsToBeCopied = true;
}
else if (_settings->RepositionCursorWithMouse() && !selectionNeedsToBeCopied) // Don't reposition cursor if this is part of a selection operation
else if (_settings.RepositionCursorWithMouse() && !selectionNeedsToBeCopied) // Don't reposition cursor if this is part of a selection operation
{
_repositionCursorWithMouse(terminalPosition);
}
@@ -2350,109 +2388,9 @@ namespace winrt::Microsoft::Terminal::Control::implementation
_cachedQuickFixes = quickFixes;
}
Core::Scheme ControlCore::ColorScheme() const noexcept
{
Core::Scheme s;
// This part is definitely a hack.
//
// This function is usually used by the "Preview Color Scheme"
// functionality in TerminalPage. If we've got an unfocused appearance,
// then we've applied that appearance before this is even getting called
// (because the command palette is open with focus on top of us). If we
// return the _current_ colors now, we'll return out the _unfocused_
// colors. If we do that, and the user dismisses the command palette,
// then the scheme that will get restored is the _unfocused_ one, which
// is not what we want.
//
// So if that's the case, then let's grab the colors from the focused
// appearance as the scheme instead. We'll lose any current runtime
// changes to the color table, but those were already blown away when we
// switched to an unfocused appearance.
//
// IF WE DON'T HAVE AN UNFOCUSED APPEARANCE: then just ask the Terminal
// for its current color table. That way, we can restore those colors
// back.
if (HasUnfocusedAppearance())
{
s.Foreground = _settings->FocusedAppearance()->DefaultForeground();
s.Background = _settings->FocusedAppearance()->DefaultBackground();
s.CursorColor = _settings->FocusedAppearance()->CursorColor();
s.Black = _settings->FocusedAppearance()->GetColorTableEntry(0);
s.Red = _settings->FocusedAppearance()->GetColorTableEntry(1);
s.Green = _settings->FocusedAppearance()->GetColorTableEntry(2);
s.Yellow = _settings->FocusedAppearance()->GetColorTableEntry(3);
s.Blue = _settings->FocusedAppearance()->GetColorTableEntry(4);
s.Purple = _settings->FocusedAppearance()->GetColorTableEntry(5);
s.Cyan = _settings->FocusedAppearance()->GetColorTableEntry(6);
s.White = _settings->FocusedAppearance()->GetColorTableEntry(7);
s.BrightBlack = _settings->FocusedAppearance()->GetColorTableEntry(8);
s.BrightRed = _settings->FocusedAppearance()->GetColorTableEntry(9);
s.BrightGreen = _settings->FocusedAppearance()->GetColorTableEntry(10);
s.BrightYellow = _settings->FocusedAppearance()->GetColorTableEntry(11);
s.BrightBlue = _settings->FocusedAppearance()->GetColorTableEntry(12);
s.BrightPurple = _settings->FocusedAppearance()->GetColorTableEntry(13);
s.BrightCyan = _settings->FocusedAppearance()->GetColorTableEntry(14);
s.BrightWhite = _settings->FocusedAppearance()->GetColorTableEntry(15);
}
else
{
const auto lock = _terminal->LockForReading();
s = _terminal->GetColorScheme();
}
// This might be a tad bit of a hack. This event only gets called by set
// color scheme / preview color scheme, and in that case, we know the
// control _is_ focused.
s.SelectionBackground = _settings->FocusedAppearance()->SelectionBackground();
return s;
}
// Method Description:
// - Apply the given color scheme to this control. We'll take the colors out
// of it and apply them to our focused appearance, and update the terminal
// buffer with the new color table.
// - This is here to support the Set Color Scheme action, and the ability to
// preview schemes in the control.
// Arguments:
// - scheme: the collection of colors to apply.
// Return Value:
// - <none>
void ControlCore::ColorScheme(const Core::Scheme& scheme)
{
_settings->FocusedAppearance()->DefaultForeground(scheme.Foreground);
_settings->FocusedAppearance()->DefaultBackground(scheme.Background);
_settings->FocusedAppearance()->CursorColor(scheme.CursorColor);
_settings->FocusedAppearance()->SelectionBackground(scheme.SelectionBackground);
_settings->FocusedAppearance()->SetColorTableEntry(0, scheme.Black);
_settings->FocusedAppearance()->SetColorTableEntry(1, scheme.Red);
_settings->FocusedAppearance()->SetColorTableEntry(2, scheme.Green);
_settings->FocusedAppearance()->SetColorTableEntry(3, scheme.Yellow);
_settings->FocusedAppearance()->SetColorTableEntry(4, scheme.Blue);
_settings->FocusedAppearance()->SetColorTableEntry(5, scheme.Purple);
_settings->FocusedAppearance()->SetColorTableEntry(6, scheme.Cyan);
_settings->FocusedAppearance()->SetColorTableEntry(7, scheme.White);
_settings->FocusedAppearance()->SetColorTableEntry(8, scheme.BrightBlack);
_settings->FocusedAppearance()->SetColorTableEntry(9, scheme.BrightRed);
_settings->FocusedAppearance()->SetColorTableEntry(10, scheme.BrightGreen);
_settings->FocusedAppearance()->SetColorTableEntry(11, scheme.BrightYellow);
_settings->FocusedAppearance()->SetColorTableEntry(12, scheme.BrightBlue);
_settings->FocusedAppearance()->SetColorTableEntry(13, scheme.BrightPurple);
_settings->FocusedAppearance()->SetColorTableEntry(14, scheme.BrightCyan);
_settings->FocusedAppearance()->SetColorTableEntry(15, scheme.BrightWhite);
const auto lock = _terminal->LockForWriting();
_terminal->ApplyScheme(scheme);
_renderer->TriggerRedrawAll(true);
}
bool ControlCore::HasUnfocusedAppearance() const
{
return _settings->HasUnfocusedAppearance();
return _hasUnfocusedAppearance;
}
void ControlCore::AdjustOpacity(const float opacityAdjust, const bool relative)
@@ -2540,7 +2478,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
// then the renderer should not render "default background" text with a
// fully opaque background. Doing that would cover up our nice
// transparency, or our acrylic, or our image.
return Opacity() < 1.0f || !_settings->BackgroundImage().empty() || _settings->UseBackgroundImageForWindow();
return Opacity() < 1.0f || !_settings.BackgroundImage().empty() || _settings.UseBackgroundImageForWindow();
}
uint64_t ControlCore::OwningHwnd()

View File

@@ -19,7 +19,6 @@
#include "SelectionColor.g.h"
#include "CommandHistoryContext.g.h"
#include "ControlSettings.h"
#include "../../audio/midi/MidiAudio.hpp"
#include "../../buffer/out/search.h"
#include "../../cascadia/TerminalCore/Terminal.hpp"
@@ -100,12 +99,13 @@ namespace winrt::Microsoft::Terminal::Control::implementation
Control::IControlAppearance UnfocusedAppearance() const;
bool HasUnfocusedAppearance() const;
winrt::Microsoft::Terminal::Core::Scheme ColorScheme() const noexcept;
void ColorScheme(const winrt::Microsoft::Terminal::Core::Scheme& scheme);
void ApplyPreviewColorScheme(const Core::ICoreScheme&);
void ResetPreviewColorScheme();
void SetOverrideColorScheme(const Core::ICoreScheme&);
::Microsoft::Console::Render::Renderer* GetRenderer() const noexcept;
uint64_t SwapChainHandle() const;
void AttachToNewControl(const Microsoft::Terminal::Control::IKeyBindings& keyBindings);
void AttachToNewControl();
void SizeChanged(const float width, const float height);
void ScaleChanged(const float scale);
@@ -228,7 +228,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
void SetSelectionAnchor(const til::point position);
void SetEndSelectionPoint(const til::point position);
SearchResults Search(const SearchRequest& request);
SearchResults Search(SearchRequest request);
const std::vector<til::point_span>& SearchResultRows() const noexcept;
void ClearSearch();
@@ -260,7 +260,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation
TerminalConnection::ITerminalConnection Connection();
void Connection(const TerminalConnection::ITerminalConnection& connection);
void HardResetWithoutErase();
void AnchorContextMenu(til::point viewportRelativeCharacterPosition);
@@ -269,9 +268,9 @@ namespace winrt::Microsoft::Terminal::Control::implementation
void PreviewInput(std::wstring_view input);
RUNTIME_SETTING(float, Opacity, _settings->Opacity());
RUNTIME_SETTING(float, Opacity, _settings.Opacity());
RUNTIME_SETTING(float, FocusedOpacity, FocusedAppearance().Opacity());
RUNTIME_SETTING(bool, UseAcrylic, _settings->UseAcrylic());
RUNTIME_SETTING(bool, UseAcrylic, _settings.UseAcrylic());
// -------------------------------- WinRT Events ---------------------------------
// clang-format off
@@ -348,7 +347,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation
safe_void_coroutine _renderEngineSwapChainChanged(const HANDLE handle);
void _rendererBackgroundColorChanged();
void _rendererTabColorChanged();
void _rendererEnteredErrorState();
#pragma endregion
void _raiseReadOnlyWarning();
@@ -403,7 +401,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation
float _panelWidth{ 0 };
float _panelHeight{ 0 };
float _compositionScale{ 0 };
uint8_t _renderFailures{ 0 };
// Audio stuff.
MidiAudio _midiAudio;
@@ -411,7 +408,10 @@ namespace winrt::Microsoft::Terminal::Control::implementation
// Other stuff.
winrt::Windows::System::DispatcherQueue _dispatcher{ nullptr };
winrt::com_ptr<ControlSettings> _settings{ nullptr };
IControlSettings _settings{ nullptr };
bool _hasUnfocusedAppearance{ false };
IControlAppearance _unfocusedAppearance{ nullptr };
Core::ICoreScheme _focusedColorSchemeOverride{ nullptr };
til::point _contextMenuBufferPosition{ 0, 0 };
Windows::Foundation::Collections::IVector<hstring> _cachedQuickFixes{ nullptr };
::Search _searcher;
@@ -423,6 +423,14 @@ namespace winrt::Microsoft::Terminal::Control::implementation
bool _isReadOnly{ false };
bool _closing{ false };
struct StashedColorScheme
{
std::array<COLORREF, TextColor::TABLE_SIZE> scheme;
size_t foregroundAlias;
size_t backgroundAlias;
};
std::unique_ptr<StashedColorScheme> _stashedColorScheme;
// ----------------------------------------------------------------------------------------
// These are ordered last to ensure they're destroyed first.
// This ensures that their respective contents stops taking dependency on the above.

View File

@@ -55,8 +55,7 @@ namespace Microsoft.Terminal.Control
Boolean GoForward;
Boolean CaseSensitive;
Boolean RegularExpression;
Boolean ExecuteSearch;
Boolean ScrollIntoView;
Boolean ResetOnly;
Int32 ScrollOffset;
};
@@ -98,7 +97,6 @@ namespace Microsoft.Terminal.Control
void ApplyAppearance(Boolean focused);
Microsoft.Terminal.TerminalConnection.ITerminalConnection Connection;
void HardResetWithoutErase();
IControlSettings Settings { get; };
IControlAppearance FocusedAppearance { get; };
@@ -106,6 +104,11 @@ namespace Microsoft.Terminal.Control
Boolean HasUnfocusedAppearance();
void SetHighContrastMode(Boolean enabled);
void ApplyPreviewColorScheme(Microsoft.Terminal.Core.ICoreScheme scheme);
void ResetPreviewColorScheme();
void SetOverrideColorScheme(Microsoft.Terminal.Core.ICoreScheme scheme);
UInt64 SwapChainHandle { get; };
Windows.Foundation.Size FontSize { get; };

View File

@@ -55,20 +55,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation
self->Attached.raise(*self, nullptr);
}
});
// GH#14464: Mark mode and quick-edit (shift+arrow) selections update
// the selection through ControlCore, bypassing SetEndSelectionPoint.
// Listen for selection changes so _selectionNeedsToBeCopied is set
// for ALL selection types, not just mouse drag.
_core->UpdateSelectionMarkers([weakThis = get_weak()](auto&&, auto&&) {
if (auto self{ weakThis.get() })
{
if (self->_core->HasSelection())
{
self->_selectionNeedsToBeCopied = true;
}
}
});
}
uint64_t ControlInteractivity::Id()
@@ -98,9 +84,9 @@ namespace winrt::Microsoft::Terminal::Control::implementation
_core->Detach();
}
void ControlInteractivity::AttachToNewControl(const Microsoft::Terminal::Control::IKeyBindings& keyBindings)
void ControlInteractivity::AttachToNewControl()
{
_core->AttachToNewControl(keyBindings);
_core->AttachToNewControl();
}
// Method Description:
@@ -329,18 +315,13 @@ namespace winrt::Microsoft::Terminal::Control::implementation
}
else
{
// GH#19942, GH#14464: Don't re-copy a selection that was
// already copied via copyOnSelect on mouse-up. But DO copy
// if the selection was made via mark mode or modified with
// quick-edit keys (shift+arrow), since those paths never
// triggered an automatic copy.
const auto copied = (_selectionNeedsToBeCopied || !_core->CopyOnSelect()) &&
CopySelectionToClipboard(shiftEnabled, false, _core->Settings().CopyFormatting());
// Try to copy the text and clear the selection
const auto successfulCopy = CopySelectionToClipboard(shiftEnabled, false, _core->Settings().CopyFormatting());
_core->ClearSelection();
if (_core->CopyOnSelect() || !copied)
if (_core->CopyOnSelect() || !successfulCopy)
{
// CopyOnSelect: right-click always pastes.
// Otherwise: no selection paste.
// CopyOnSelect: right click always pastes!
// Otherwise: no selection --> paste
RequestPasteTextFromClipboard();
}
}

View File

@@ -89,7 +89,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
void SetEndSelectionPoint(const Core::Point pixelPosition);
uint64_t Id();
void AttachToNewControl(const Microsoft::Terminal::Control::IKeyBindings& keyBindings);
void AttachToNewControl();
til::typed_event<IInspectable, Control::OpenHyperlinkEventArgs> OpenHyperlink;
til::typed_event<IInspectable, Control::PasteFromClipboardEventArgs> PasteFromClipboard;

View File

@@ -25,7 +25,7 @@ namespace Microsoft.Terminal.Control
UInt64 Id { get; };
void AttachToNewControl(Microsoft.Terminal.Control.IKeyBindings keyBindings);
void AttachToNewControl();
void Detach();
void Close();

View File

@@ -1,87 +0,0 @@
/*++
Copyright (c) Microsoft Corporation
Licensed under the MIT license.
--*/
#pragma once
#include "../../inc/cppwinrt_utils.h"
#include "../../inc/ControlProperties.h"
#include <DefaultSettings.h>
#include <conattrs.hpp>
#include "ControlAppearance.h"
using IFontFeatureMap = winrt::Windows::Foundation::Collections::IMap<winrt::hstring, float>;
using IFontAxesMap = winrt::Windows::Foundation::Collections::IMap<winrt::hstring, float>;
namespace winrt::Microsoft::Terminal::Control::implementation
{
struct ControlSettings : public winrt::implements<ControlSettings, Microsoft::Terminal::Control::IControlSettings, Microsoft::Terminal::Control::IControlAppearance, Microsoft::Terminal::Core::ICoreSettings, Microsoft::Terminal::Core::ICoreAppearance>
{
// Getters and setters for each *Setting member. We're not using
// WINRT_PROPERTY for these, because they actually exist inside the
// _focusedAppearance member. We don't need to reserve another member to
// hold them.
#define SETTINGS_GEN(type, name, ...) WINRT_PROPERTY(type, name, __VA_ARGS__);
CORE_SETTINGS(SETTINGS_GEN)
CONTROL_SETTINGS(SETTINGS_GEN)
#undef SETTINGS_GEN
private:
winrt::com_ptr<ControlAppearance> _unfocusedAppearance{ nullptr };
winrt::com_ptr<ControlAppearance> _focusedAppearance{ nullptr };
bool _hasUnfocusedAppearance{ false };
public:
ControlSettings(const Control::IControlSettings& settings,
const Control::IControlAppearance& unfocusedAppearance)
{
_hasUnfocusedAppearance = unfocusedAppearance != nullptr;
_focusedAppearance = winrt::make_self<implementation::ControlAppearance>(settings);
_unfocusedAppearance = unfocusedAppearance ?
winrt::make_self<implementation::ControlAppearance>(unfocusedAppearance) :
_focusedAppearance;
// Copy every value from the passed in settings, into us.
#define COPY_SETTING(type, name, ...) _##name = settings.name();
CORE_SETTINGS(COPY_SETTING)
CONTROL_SETTINGS(COPY_SETTING)
#undef COPY_SETTING
}
winrt::com_ptr<ControlAppearance> UnfocusedAppearance() { return _unfocusedAppearance; }
winrt::com_ptr<ControlAppearance> FocusedAppearance() { return _focusedAppearance; }
bool HasUnfocusedAppearance() { return _hasUnfocusedAppearance; }
// Getters and setters for each Appearance member. We're not using
// WINRT_PROPERTY for these, because they actually exist inside the
// _focusedAppearance member. We don't need to reserve another member to
// hold them.
//
// The Appearance members (including GetColorTableEntry below) are used
// when this ControlSettings is cast to a IControlAppearance or
// ICoreAppearance. In those cases, we'll always return the Focused
// appearance's version of the member. Callers who care about which
// appearance is being used should be more careful. Fortunately, this
// situation is generally only used when a control is first created, or
// when calling UpdateSettings.
#define APPEARANCE_GEN(type, name, ...) \
type name() const noexcept \
{ \
return _focusedAppearance->name(); \
} \
void name(const type& value) noexcept \
{ \
_focusedAppearance->name(value); \
}
CORE_APPEARANCE_SETTINGS(APPEARANCE_GEN)
CONTROL_APPEARANCE_SETTINGS(APPEARANCE_GEN)
#undef APPEARANCE_GEN
winrt::Microsoft::Terminal::Core::Color GetColorTableEntry(int32_t index) noexcept
{
return _focusedAppearance->GetColorTableEntry(index);
}
};
}

View File

@@ -462,11 +462,6 @@ void HwndTerminal::SendOutput(std::wstring_view data)
_terminal->Write(data);
}
void _stdcall AvoidBuggyTSFConsoleFlags()
{
Microsoft::Console::TSF::Handle::AvoidBuggyTSFConsoleFlags();
}
HRESULT _stdcall CreateTerminal(HWND parentHwnd, _Out_ void** hwnd, _Out_ void** terminal)
{
auto publicTerminal = std::make_unique<HwndTerminal>(parentHwnd);

View File

@@ -41,7 +41,6 @@ typedef struct _TerminalTheme
} TerminalTheme, *LPTerminalTheme;
extern "C" {
__declspec(dllexport) void _stdcall AvoidBuggyTSFConsoleFlags();
__declspec(dllexport) HRESULT _stdcall CreateTerminal(HWND parentHwnd, _Out_ void** hwnd, _Out_ void** terminal);
__declspec(dllexport) void _stdcall TerminalSendOutput(void* terminal, LPCWSTR data);
__declspec(dllexport) void _stdcall TerminalRegisterScrollCallback(void* terminal, void __stdcall callback(int, int, int));

View File

@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import "IKeyBindings.idl";
import "IControlAppearance.idl";
import "EventArgs.idl";
@@ -53,8 +52,6 @@ namespace Microsoft.Terminal.Control
String CellWidth { get; };
String CellHeight { get; };
Microsoft.Terminal.Control.IKeyBindings KeyBindings { get; };
Boolean CopyOnSelect { get; };
Microsoft.Terminal.Control.CopyFormat CopyFormatting { get; };
Boolean FocusFollowMouse { get; };

View File

@@ -50,8 +50,6 @@ namespace Microsoft.Terminal.Control
Microsoft.Terminal.TerminalConnection.ConnectionState ConnectionState { get; };
Microsoft.Terminal.Core.Scheme ColorScheme { get; set; };
UInt64 OwningHwnd;
void AddMark(ScrollMark mark);

View File

@@ -330,14 +330,10 @@ namespace winrt::Microsoft::Terminal::Control::implementation
// - bool: whether the current focus is on the search box
bool SearchBoxControl::ContainsFocus()
{
// BODGY: It is possible for this to get called with no XAML root. We are unsure why.
if (auto root = XamlRoot())
auto focusedElement = Input::FocusManager::GetFocusedElement(this->XamlRoot());
if (_focusableElements.count(focusedElement) > 0)
{
auto focusedElement = Input::FocusManager::GetFocusedElement(root);
if (_focusableElements.count(focusedElement) > 0)
{
return true;
}
return true;
}
return false;

View File

@@ -487,25 +487,22 @@ namespace winrt::Microsoft::Terminal::Control::implementation
// Function Description:
// - Static helper for building a new TermControl from an already existing
// content. We'll attach the existing swapchain to this new control's
// SwapChainPanel. The IKeyBindings might belong to a non-agile object on
// a new thread, so we'll hook up the core to these new bindings.
// SwapChainPanel.
// Arguments:
// - content: The preexisting ControlInteractivity to connect to.
// - keybindings: The new IKeyBindings instance to use for this control.
// Return Value:
// - The newly constructed TermControl.
Control::TermControl TermControl::NewControlByAttachingContent(Control::ControlInteractivity content,
const Microsoft::Terminal::Control::IKeyBindings& keyBindings)
Control::TermControl TermControl::NewControlByAttachingContent(Control::ControlInteractivity content)
{
const auto term{ winrt::make_self<TermControl>(content) };
term->_initializeForAttach(keyBindings);
term->_initializeForAttach();
return *term;
}
void TermControl::_initializeForAttach(const Microsoft::Terminal::Control::IKeyBindings& keyBindings)
void TermControl::_initializeForAttach()
{
_AttachDxgiSwapChainToXaml(reinterpret_cast<HANDLE>(_core.SwapChainHandle()));
_interactivity.AttachToNewControl(keyBindings);
_interactivity.AttachToNewControl();
// Initialize the terminal only once the swapchainpanel is loaded - that
// way, we'll be able to query the real pixel size it got on layout
@@ -536,11 +533,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation
_core.Connection(newConnection);
}
void TermControl::HardResetWithoutErase()
{
_core.HardResetWithoutErase();
}
void TermControl::_throttledUpdateScrollbar(const ScrollBarUpdate& update)
{
if (!_initializedTerminal)
@@ -723,15 +715,8 @@ namespace winrt::Microsoft::Terminal::Control::implementation
}
else
{
_handleSearchResults(_core.Search(SearchRequest{
.Text = _searchBox->Text(),
.GoForward = goForward,
.CaseSensitive = _searchBox->CaseSensitive(),
.RegularExpression = _searchBox->RegularExpression(),
.ExecuteSearch = true,
.ScrollIntoView = true,
.ScrollOffset = _searchScrollOffset,
}));
const auto request = SearchRequest{ _searchBox->Text(), goForward, _searchBox->CaseSensitive(), _searchBox->RegularExpression(), false, _searchScrollOffset };
_handleSearchResults(_core.Search(request));
}
}
@@ -765,15 +750,8 @@ namespace winrt::Microsoft::Terminal::Control::implementation
{
if (_searchBox && _searchBox->IsOpen())
{
_handleSearchResults(_core.Search(SearchRequest{
.Text = text,
.GoForward = goForward,
.CaseSensitive = caseSensitive,
.RegularExpression = regularExpression,
.ExecuteSearch = true,
.ScrollIntoView = true,
.ScrollOffset = _searchScrollOffset,
}));
const auto request = SearchRequest{ text, goForward, caseSensitive, regularExpression, false, _searchScrollOffset };
_handleSearchResults(_core.Search(request));
}
}
@@ -792,15 +770,11 @@ namespace winrt::Microsoft::Terminal::Control::implementation
{
if (_searchBox && _searchBox->IsOpen())
{
_handleSearchResults(_core.Search(SearchRequest{
.Text = text,
.GoForward = goForward,
.CaseSensitive = caseSensitive,
.RegularExpression = regularExpression,
.ExecuteSearch = false,
.ScrollIntoView = true,
.ScrollOffset = _searchScrollOffset,
}));
// We only want to update the search results based on the new text. Set
// `resetOnly` to true so we don't accidentally update the current match index.
const auto request = SearchRequest{ text, goForward, caseSensitive, regularExpression, true, _searchScrollOffset };
const auto result = _core.Search(request);
_handleSearchResults(result);
}
}
@@ -1844,16 +1818,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation
return true;
}
// While TSF has an active composition, key events must not be forwarded
// to the PTY directly. The IME re-injects navigation/confirmation keys
// after composition ends, at which point HasActiveComposition() == false
// and they are forwarded normally. This mirrors conhost v1 behavior in
// src/interactivity/win32/windowio.cpp.
if (GetTSFHandle().HasActiveComposition())
{
return true;
}
if (_TrySendKeyEvent(vkey, scanCode, modifiers, keyDown))
{
return true;
@@ -1881,13 +1845,12 @@ namespace winrt::Microsoft::Terminal::Control::implementation
return true;
}
auto bindings = _core.Settings().KeyBindings();
if (!bindings)
if (!_keyBindings)
{
return false;
}
auto success = bindings.TryKeyChord({
auto success = _keyBindings.TryKeyChord({
modifiers.IsCtrlPressed(),
modifiers.IsAltPressed(),
modifiers.IsShiftPressed(),
@@ -2028,13 +1991,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
const auto point = args.GetCurrentPoint(*this);
const auto type = ptr.PointerDeviceType();
// GH#19908: _focused can be true even when the search box has
// keyboard focus, because GotFocus bubbles from the search box
// child and _GotFocusHandler sets _focused=true. If the user
// click-drags in the terminal while the search box is focused,
// we need to explicitly call Focus() to move keyboard focus back
// to the terminal so that Ctrl+C copies the selection.
if (!_focused || (_searchBox && _searchBox->ContainsFocus()))
if (!_focused)
{
Focus(FocusState::Pointer);
}
@@ -2630,9 +2587,9 @@ namespace winrt::Microsoft::Terminal::Control::implementation
_updateScrollBar->Run(update);
// If we have a selection with markers (exposed via selection mode),
// update the position of the markers
if (_core.HasSelection() && _core.SelectionMode() >= SelectionInteractionMode::Keyboard)
// if a selection marker is already visible,
// update the position of those markers
if (SelectionStartMarker().Visibility() == Visibility::Visible || SelectionEndMarker().Visibility() == Visibility::Visible)
{
_updateSelectionMarkers(nullptr, winrt::make<UpdateSelectionMarkersEventArgs>(false));
}
@@ -3198,17 +3155,12 @@ namespace winrt::Microsoft::Terminal::Control::implementation
co_return;
}
const auto weak = get_weak();
if (e.DataView().Contains(StandardDataFormats::ApplicationLink()))
{
try
{
auto link{ co_await e.DataView().GetApplicationLinkAsync() };
if (const auto strong = weak.get())
{
_pasteTextWithBroadcast(link.AbsoluteUri());
}
_pasteTextWithBroadcast(link.AbsoluteUri());
}
CATCH_LOG();
}
@@ -3217,10 +3169,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
try
{
auto link{ co_await e.DataView().GetWebLinkAsync() };
if (const auto strong = weak.get())
{
_pasteTextWithBroadcast(link.AbsoluteUri());
}
_pasteTextWithBroadcast(link.AbsoluteUri());
}
CATCH_LOG();
}
@@ -3229,10 +3178,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
try
{
auto text{ co_await e.DataView().GetTextAsync() };
if (const auto strong = weak.get())
{
_pasteTextWithBroadcast(text);
}
_pasteTextWithBroadcast(text);
}
CATCH_LOG();
}
@@ -3294,12 +3240,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation
}
}
const auto strong = weak.get();
if (!strong)
{
co_return;
}
std::wstring allPathsString;
for (auto& fullPath : fullPaths)
{
@@ -3642,14 +3582,9 @@ namespace winrt::Microsoft::Terminal::Control::implementation
safe_void_coroutine TermControl::_updateSelectionMarkers(IInspectable /*sender*/, Control::UpdateSelectionMarkersEventArgs args)
{
if (!args)
{
co_return;
}
auto weakThis{ get_weak() };
co_await resume_foreground(Dispatcher());
if (const auto strong = weakThis.get())
if (weakThis.get() && args)
{
if (_core.HasSelection() && !args.ClearMarkers())
{
@@ -3848,16 +3783,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation
get_self<ControlCore>(_core)->UpdateQuickFixes(suggestions);
}
Core::Scheme TermControl::ColorScheme() const noexcept
{
return _core.ColorScheme();
}
void TermControl::ColorScheme(const Core::Scheme& scheme) const noexcept
{
_core.ColorScheme(scheme);
}
void TermControl::AdjustOpacity(const float opacity, const bool relative)
{
_core.AdjustOpacity(opacity, relative);
@@ -3901,15 +3826,8 @@ namespace winrt::Microsoft::Terminal::Control::implementation
const auto goForward = _searchBox->GoForward();
const auto caseSensitive = _searchBox->CaseSensitive();
const auto regularExpression = _searchBox->RegularExpression();
_handleSearchResults(_core.Search(SearchRequest{
.Text = text,
.GoForward = goForward,
.CaseSensitive = caseSensitive,
.RegularExpression = regularExpression,
.ExecuteSearch = false,
.ScrollIntoView = false,
.ScrollOffset = _searchScrollOffset,
}));
const auto request = SearchRequest{ text, goForward, caseSensitive, regularExpression, true, _searchScrollOffset };
_handleSearchResults(_core.Search(request));
}
void TermControl::_handleSearchResults(SearchResults results)

View File

@@ -11,7 +11,6 @@
#include "../../tsf/Handle.h"
#include "ControlInteractivity.h"
#include "ControlSettings.h"
namespace Microsoft::Console::VirtualTerminal
{
@@ -50,12 +49,14 @@ namespace winrt::Microsoft::Terminal::Control::implementation
TermControl(IControlSettings settings, Control::IControlAppearance unfocusedAppearance, TerminalConnection::ITerminalConnection connection);
static Control::TermControl NewControlByAttachingContent(Control::ControlInteractivity content, const Microsoft::Terminal::Control::IKeyBindings& keyBindings);
static Control::TermControl NewControlByAttachingContent(Control::ControlInteractivity content);
void UpdateControlSettings(Control::IControlSettings settings);
void UpdateControlSettings(Control::IControlSettings settings, Control::IControlAppearance unfocusedAppearance);
IControlSettings Settings() const;
void KeyBindings(const Control::IKeyBindings& bindings) { _keyBindings = bindings; }
uint64_t ContentId() const;
hstring GetStartingTitle() const;
@@ -176,9 +177,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation
Control::CommandHistoryContext CommandHistory() const;
void UpdateWinGetSuggestions(Windows::Foundation::Collections::IVector<hstring> suggestions);
winrt::Microsoft::Terminal::Core::Scheme ColorScheme() const noexcept;
void ColorScheme(const winrt::Microsoft::Terminal::Core::Scheme& scheme) const noexcept;
void AdjustOpacity(const float opacity, const bool relative);
bool RawWriteKeyEvent(const WORD vkey, const WORD scanCode, const winrt::Microsoft::Terminal::Core::ControlKeyStates modifiers, const bool keyDown);
@@ -194,11 +192,14 @@ namespace winrt::Microsoft::Terminal::Control::implementation
TerminalConnection::ITerminalConnection Connection();
void Connection(const TerminalConnection::ITerminalConnection& connection);
void HardResetWithoutErase();
Control::CursorDisplayState CursorVisibility() const noexcept;
void CursorVisibility(Control::CursorDisplayState cursorVisibility);
void ApplyPreviewColorScheme(const Core::ICoreScheme& scheme) { _core.ApplyPreviewColorScheme(scheme); }
void ResetPreviewColorScheme() { _core.ResetPreviewColorScheme(); }
void SetOverrideColorScheme(const Core::ICoreScheme& scheme) { _core.SetOverrideColorScheme(scheme); }
// -------------------------------- WinRT Events ---------------------------------
// clang-format off
til::property_changed_event PropertyChanged;
@@ -250,6 +251,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
Control::TermControlAutomationPeer _automationPeer{ nullptr };
Control::ControlInteractivity _interactivity{ nullptr };
Control::ControlCore _core{ nullptr };
Control::IKeyBindings _keyBindings{ nullptr };
TsfDataProvider _tsfDataProvider{ this };
winrt::com_ptr<SearchBoxControl> _searchBox;
@@ -341,7 +343,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
return _closing;
}
void _initializeForAttach(const Microsoft::Terminal::Control::IKeyBindings& keyBindings);
void _initializeForAttach();
void _UpdateSettingsFromUIThread();
void _UpdateAppearanceFromUIThread(Control::IControlAppearance newAppearance);

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