Compare commits

...

18 Commits

Author SHA1 Message Date
Windows Console Service Bot
bc365c9542 Localization Updates - main - associated with #17259 (#17272)
(cherry picked from commit 26cc5da7f1)
Service-Card-Id: 92577949
Service-Version: 1.21
2024-05-17 12:44:25 -05:00
Leonard Hecker
0d8e43c697 Improve font related help text (#17259)
A few minor changes to better guide people along new features in 1.21.
The font face box gets a sub-text that explains how to add multiple
fonts and the builtin glyph toggle now explains its dependence to D3D.

(cherry picked from commit 0d39c008cb)
Service-Card-Id: 92546504
Service-Version: 1.21
2024-05-17 12:44:23 -05:00
Dustin L. Howett
967dcfc5b0 build: move ESRP to a parameterized subtask which takes signingId (#17216)
This centralized all our ESRP calls in one file, which will make it
easier in the future when we are invariable required to change how we
call it again.

(cherry picked from commit 5ce7fb7403)
Service-Card-Id: 92577955
Service-Version: 1.21
2024-05-17 12:44:21 -05:00
Leonard Hecker
e56a557c93 Fix persistence of handoff'd tabs (#17268)
As it turns out, for handoff'd connections `Initialize` isn't called
and this meant the `_sessionId` was always null.
After this PR we still don't have a `_profileGuid` but that's probably
not a critical issue, since that's an inherent flaw with handoff.
It can only be solved in a robust manner if WT gets launched before the
console app is launched, but it's unlikely for that to ever happen.

## Validation Steps Performed
* Launch
* Register that version of WT as the default
* Close all tabs (Ctrl+Shift+W)
* `persistedWindowLayouts` is empty 
* Launch cmd/pwsh via handoff
* You get 1 window 
* Close the window (= press the X button)
* Launch
* You get 2 windows 

(cherry picked from commit 9054c81934)
Service-Card-Id: 92556178
Service-Version: 1.21
2024-05-16 19:00:48 -05:00
Leonard Hecker
52eba74316 AtlasEngine: Improve robustness against weird font sizes (#17258)
This clamps the font sizes between 1 and 100. Additionally, it fixes
a warning that I randomly noticed when reproducing the issue: D2D
complained that `EndDraw` must be called before releasing resources.
Finally, this fixes a crash when the terminal size is exactly (1,1)
cells, which happened because the initial (invalid) size was (1,1) too.

This doesn't fully fix all font-size related issues, but that's
currently difficult to achieve, as for instance the swap chain size
isn't actually based on the window size, nay, it's based on the cell
size multiplied by the cell count. So if the cell size is egregiously
large then we get a swap chain size that's larger than the display and
potentially larger than what the GPU supports which results in errors.

Closes #17227

(cherry picked from commit f62d2d5d2c)
Service-Card-Id: 92546470
Service-Version: 1.21
2024-05-16 19:00:48 -05:00
Dustin L. Howett
27de22d0e5 ServicingPipeline: Warn when local release-XX branch is not uptodate (#17260)
This prevents me from making dumb mistakes, really.

(cherry picked from commit bf55c44460)
Service-Card-Id: 92546838
Service-Version: 1.21
2024-05-16 19:00:48 -05:00
Leonard Hecker
52ab4c467a Fix race conditions in UiaTextRangeBase (#17257)
We need to lock the buffer when getting the viewport/cursor position.
This caused the UIA overlay to randomly fail to update.

## Validation Steps Performed
* Open a cmd tab and hold any key immediately
* Repeat until you're somewhat confident it's gone 

(cherry picked from commit e1b102a354)
Service-Card-Id: 92546408
Service-Version: 1.21
2024-05-13 12:34:05 -05:00
Mike Griese
ece2ef7f84 Remove the animations from the suggestions UI (#17247)
gotta go fast, and these animations are not fast

noted in #15845

(cherry picked from commit 46526bc00c)
Service-Card-Id: 92546875
Service-Version: 1.21
2024-05-13 12:34:04 -05:00
Tushar Singh
ef283da5cb Fix single-tab window tear-off crash (#17251)
## Validation Steps Performed
- Opened multi-tab terminal window with Narrator. Narrator can read
characters from the tabs.
- Started a drag and drop (tear-off) of a tab, and it didn't crash. This
was repeated multiple times.

(cherry picked from commit 30ef1f461d)
Service-Card-Id: 92546869
Service-Version: 1.21
2024-05-13 12:34:03 -05:00
krzysdz
18c3f72fe0 PowerShell menu completion parser thread-safety fix (#17221)
Fix Terminal crashing when experimental PowerShell menu completion is
very quickly invoked multiple times.

`Command::ParsePowerShellMenuComplete` can be called from multiple
threads, but it uses a `static` `Json::CharReader`, which cannot safely
parse data from multiple threads at the same time. Removing `static`
fixes the problem, since every function call gets its own `reader`.

Validation: Pressed Ctrl+Space quickly a few times with hardcoded huge
JSON as the completion payload. Also shown at the end of the second
video in #17220.

Closes #17220

(cherry picked from commit 44516ad7cf)
Service-Card-Id: 92524217
Service-Version: 1.21
2024-05-13 11:32:09 -05:00
Leonard Hecker
4d1b543a9e Fix session being persisted even when disabled (#17211)
This fixes 2 bugs:
* `PersistState` being called when the window is closed
  (as opposed to closing the tab). The settings check was missing.
* Session cleanup running depending on whether the feature is
  currently enabled as opposed to whether it was enabled on launch.

Closes #17206
Closes #17207

## Validation Steps Performed
* Create a bunch of leftover buffer_*.txt files by running
  the current Dev version off of main
* Build this branch, then open and close a window
* All buffer_*.txt are gone and state.json is cleaned up 

(cherry picked from commit dbac3a1fa3)
Service-Card-Id: 92515454
Service-Version: 1.21
2024-05-13 11:32:08 -05:00
Leonard Hecker
d838ce5e67 Fix !_noFlushOnEnd not flushing (#17212)
This simply copies a bit more from `VtEngine::EndPaint`'s
`_noFlushOnEnd` handling which already seems to fix the linked issue.

Closes #17204

(cherry picked from commit 0b76c51ba1)
Service-Card-Id: 92516193
Service-Version: 1.21
2024-05-13 11:32:06 -05:00
Leonard Hecker
1f54562f04 Add nullptr checks to shared_ptr conversions (#17199)
We use `if (auto self = weakSelf.get())` in a lot of places.
That assigns the value to `self` and then checks if it's truthy.
Sometimes we need to add a "is (app) closing" check because XAML,
so we wrote something akin to `if (self = ...; !closing)`.

But that's wrong because the correct `if (foo)` is the same as
`if (void; foo)` and not `if (foo; void)` and that meant that
we didn't check for `self`'s truthiness anymore.

This issue became apparent now, because we added a new kind of
delayed callback invocation (which is a lot cheaper).
This made the lack of a `nullptr` check finally obvious.

(cherry picked from commit 6d0342f0bb)
Service-Card-Id: 92509288
Service-Version: 1.21
2024-05-07 17:14:56 -05:00
James Holderness
f0fc1b5701 Make sure DCS strings are flushed to conpty without delay (#17195)
When the `DCS` passthrough code was first implemented, it relied on the
`ActionPassThroughString` method flushing the given string immediately.
However, that has since stopped being the case, so `DCS` operations end
up being delayed until the entire sequence has been parsed.

This PR fixes the issue by introducing a `flush` parameter to force an
immediate flush on the `ActionPassThroughString` method, as well as the
`XtermEngine::WriteTerminalW` method that it calls.

## Validation Steps Performed

I've confirmed that the test case in issue #17111 now updates the color
table as soon as each color entry is parsed, instead of delaying the
updates until the end of the sequence.

Closes #17111

(cherry picked from commit 9c16c5ca82)
Service-Card-Id: 92501226
Service-Version: 1.21
2024-05-06 16:02:40 -05:00
Windows Console Service Bot
a6819c5384 Localization Updates - 05/03/2024 19:01:37 (#17188)
(cherry picked from commit 80d2e58944)
Service-Card-Id: 92501389
Service-Version: 1.21
2024-05-06 16:02:38 -05:00
James Holderness
3c6b2af578 Prevent the VT engine painting unnecessarily (#17194)
When the VT render engine starts a paint operation, it first checks to
see whether there is actually something to do, and if not it can end the
frame early. However, the result of that check was being ignored, which
could sometimes result in an unwanted `SGR` reset being written to the
conpty pipe.

This was particular concerning when passing through `DCS` sequences,
because an unexpected `SGR` in the middle of the `DCS` string would
cause it to abort early.

This PR addresses the problem by making sure the `VtEngine::StartPaint`
return value is appropriately handled in the `XtermEngine` class.

## Detailed Description of the Pull Request / Additional comments

To make this work, I also needed to correct the `_cursorMoved` flag,
because that is one of things that determines whether a paint is needed
or not, but it was being set in the `InvalidateCursor` method at the
start of ever frame, regardless of whether the cursor had actually
moved.

I also took this opportunity to get rid of the `_WillWriteSingleChar`
method and the `_quickReturn` flag, which have been mostly obsolete for
a long time now. The only place the flag was still used was to optimize
single char writes when line renditions are active. But that could more
easily be handled by testing the `_invalidMap` directly.

## Validation Steps Performed

I've confirmed that the test case in issue #17117 is no longer aborting
the `DCS` color table sequence early.

Closes #17117

(cherry picked from commit 432dfcc490)
Service-Card-Id: 92501130
Service-Version: 1.21
2024-05-06 16:02:37 -05:00
Leonard Hecker
fe237afc25 AtlasEngine: Fix several error handling bugs (#17193)
This fixes:
* `HRESULT`s not being shown as unsigned hex
* `D2DERR_RECREATE_TARGET` not being handled
* 4 calls not checking their `HRESULT` return
  Out of the 4 only `CreateCompatibleRenderTarget` will throw in
  practice, however it throws `D2DERR_RECREATE_TARGET` which is common.
  Without this error handling, AtlasEngine may crash.

## Validation Steps Performed
* Set Graphics API to Direct2D
* Use `DXGIAdapterRemovalSupportTest.exe` to trigger
  `D2DERR_RECREATE_TARGET`
* No error message is shown 
* If the `D2DERR_RECREATE_TARGET` handling is removed, the application
  never crashes due to `cursorRenderTarget` being `nullptr` 

(cherry picked from commit b31059e53e)
Service-Card-Id: 92492429
Service-Version: 1.21
2024-05-06 16:02:36 -05:00
Dustin L. Howett
3600ee42f0 PGO: train 1.21 separately 2024-05-06 16:02:22 -05:00
56 changed files with 387 additions and 247 deletions

View File

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

@@ -100,36 +100,32 @@ jobs:
flattenFolders: true
- ${{ if eq(parameters.codeSign, true) }}:
- task: EsrpCodeSigning@5
displayName: Submit *.nupkg to ESRP for code signing
inputs:
ConnectedServiceName: ${{ parameters.signingIdentity.serviceName }}
AppRegistrationClientId: ${{ parameters.signingIdentity.appId }}
AppRegistrationTenantId: ${{ parameters.signingIdentity.tenantId }}
AuthAKVName: ${{ parameters.signingIdentity.akvName }}
AuthCertName: ${{ parameters.signingIdentity.authCertName }}
AuthSignCertName: ${{ parameters.signingIdentity.signCertName }}
FolderPath: $(Build.ArtifactStagingDirectory)/nupkg
Pattern: '*.nupkg'
UseMinimatch: true
signConfigType: inlineSignParams
inlineOperation: >-
[
{
"KeyCode": "CP-401405",
"OperationCode": "NuGetSign",
"Parameters": {},
"ToolName": "sign",
"ToolVersion": "1.0"
},
{
"KeyCode": "CP-401405",
"OperationCode": "NuGetVerify",
"Parameters": {},
"ToolName": "sign",
"ToolVersion": "1.0"
}
]
- template: steps-esrp-signing.yml
parameters:
displayName: Submit *.nupkg to ESRP for code signing
signingIdentity: ${{ parameters.signingIdentity }}
inputs:
FolderPath: $(Build.ArtifactStagingDirectory)/nupkg
Pattern: '*.nupkg'
UseMinimatch: true
signConfigType: inlineSignParams
inlineOperation: >-
[
{
"KeyCode": "CP-401405",
"OperationCode": "NuGetSign",
"Parameters": {},
"ToolName": "sign",
"ToolVersion": "1.0"
},
{
"KeyCode": "CP-401405",
"OperationCode": "NuGetVerify",
"Parameters": {},
"ToolName": "sign",
"ToolVersion": "1.0"
}
]
- ${{ if eq(parameters.generateSbom, true) }}:
- task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0

View File

@@ -242,18 +242,14 @@ jobs:
# Code-sign everything we just put together.
# We run the signing in Terminal.BinDir, because all of the signing batches are relative to the final architecture/configuration output folder.
- task: EsrpCodeSigning@5
displayName: Submit Signing Request
inputs:
ConnectedServiceName: ${{ parameters.signingIdentity.serviceName }}
AppRegistrationClientId: ${{ parameters.signingIdentity.appId }}
AppRegistrationTenantId: ${{ parameters.signingIdentity.tenantId }}
AuthAKVName: ${{ parameters.signingIdentity.akvName }}
AuthCertName: ${{ parameters.signingIdentity.authCertName }}
AuthSignCertName: ${{ parameters.signingIdentity.signCertName }}
FolderPath: '$(Terminal.BinDir)'
signType: batchSigning
batchSignPolicyFile: '$(Build.SourcesDirectory)/ESRPSigningConfig.json'
- template: steps-esrp-signing.yml
parameters:
displayName: Submit Signing Request
signingIdentity: ${{ parameters.signingIdentity }}
inputs:
FolderPath: '$(Terminal.BinDir)'
signType: batchSigning
batchSignPolicyFile: '$(Build.SourcesDirectory)/ESRPSigningConfig.json'
# We only need to re-pack the MSIX if we actually signed, so this can stay in the codeSign conditional
- ${{ if or(parameters.buildTerminal, parameters.buildEverything) }}:

View File

@@ -97,45 +97,41 @@ jobs:
displayName: Create msixbundle
- ${{ if eq(parameters.codeSign, true) }}:
- task: EsrpCodeSigning@5
displayName: Submit *.msixbundle to ESRP for code signing
inputs:
ConnectedServiceName: ${{ parameters.signingIdentity.serviceName }}
AppRegistrationClientId: ${{ parameters.signingIdentity.appId }}
AppRegistrationTenantId: ${{ parameters.signingIdentity.tenantId }}
AuthAKVName: ${{ parameters.signingIdentity.akvName }}
AuthCertName: ${{ parameters.signingIdentity.authCertName }}
AuthSignCertName: ${{ parameters.signingIdentity.signCertName }}
FolderPath: $(System.ArtifactsDirectory)\bundle
Pattern: $(BundleStemName)*.msixbundle
UseMinimatch: true
signConfigType: inlineSignParams
inlineOperation: >-
[
{
"KeyCode": "Dynamic",
"CertTemplateName": "WINMSAPP1ST",
"CertSubjectName": "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US",
"OperationCode": "SigntoolSign",
"Parameters": {
"OpusName": "Microsoft",
"OpusInfo": "http://www.microsoft.com",
"FileDigest": "/fd \"SHA256\"",
"TimeStamp": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
},
"ToolName": "sign",
"ToolVersion": "1.0"
},
{
"KeyCode": "Dynamic",
"CertTemplateName": "WINMSAPP1ST",
"CertSubjectName": "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US",
"OperationCode": "SigntoolVerify",
"Parameters": {},
"ToolName": "sign",
"ToolVersion": "1.0"
}
]
- template: steps-esrp-signing.yml
parameters:
displayName: Submit *.msixbundle to ESRP for code signing
signingIdentity: ${{ parameters.signingIdentity }}
inputs:
FolderPath: $(System.ArtifactsDirectory)\bundle
Pattern: $(BundleStemName)*.msixbundle
UseMinimatch: true
signConfigType: inlineSignParams
inlineOperation: >-
[
{
"KeyCode": "Dynamic",
"CertTemplateName": "WINMSAPP1ST",
"CertSubjectName": "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US",
"OperationCode": "SigntoolSign",
"Parameters": {
"OpusName": "Microsoft",
"OpusInfo": "http://www.microsoft.com",
"FileDigest": "/fd \"SHA256\"",
"TimeStamp": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
},
"ToolName": "sign",
"ToolVersion": "1.0"
},
{
"KeyCode": "Dynamic",
"CertTemplateName": "WINMSAPP1ST",
"CertSubjectName": "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US",
"OperationCode": "SigntoolVerify",
"Parameters": {},
"ToolName": "sign",
"ToolVersion": "1.0"
}
]
- ${{ if eq(parameters.generateSbom, true) }}:
- task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0

View File

@@ -85,36 +85,32 @@ jobs:
versionEnvVar: XES_PACKAGEVERSIONNUMBER
- ${{ if eq(parameters.codeSign, true) }}:
- task: EsrpCodeSigning@5
displayName: Submit *.nupkg to ESRP for code signing
inputs:
ConnectedServiceName: ${{ parameters.signingIdentity.serviceName }}
AppRegistrationClientId: ${{ parameters.signingIdentity.appId }}
AppRegistrationTenantId: ${{ parameters.signingIdentity.tenantId }}
AuthAKVName: ${{ parameters.signingIdentity.akvName }}
AuthCertName: ${{ parameters.signingIdentity.authCertName }}
AuthSignCertName: ${{ parameters.signingIdentity.signCertName }}
FolderPath: $(Build.ArtifactStagingDirectory)/nupkg
Pattern: '*.nupkg'
UseMinimatch: true
signConfigType: inlineSignParams
inlineOperation: >-
[
{
"KeyCode": "CP-401405",
"OperationCode": "NuGetSign",
"Parameters": {},
"ToolName": "sign",
"ToolVersion": "1.0"
},
{
"KeyCode": "CP-401405",
"OperationCode": "NuGetVerify",
"Parameters": {},
"ToolName": "sign",
"ToolVersion": "1.0"
}
]
- template: steps-esrp-signing.yml
parameters:
displayName: Submit *.nupkg to ESRP for code signing
signingIdentity: ${{ parameters.signingIdentity }}
inputs:
FolderPath: $(Build.ArtifactStagingDirectory)/nupkg
Pattern: '*.nupkg'
UseMinimatch: true
signConfigType: inlineSignParams
inlineOperation: >-
[
{
"KeyCode": "CP-401405",
"OperationCode": "NuGetSign",
"Parameters": {},
"ToolName": "sign",
"ToolVersion": "1.0"
},
{
"KeyCode": "CP-401405",
"OperationCode": "NuGetVerify",
"Parameters": {},
"ToolName": "sign",
"ToolVersion": "1.0"
}
]
- ${{ if eq(parameters.generateSbom, true) }}:
- task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0

View File

@@ -0,0 +1,22 @@
parameters:
- name: displayName
type: string
default: ESRP Code Signing
- name: inputs
type: object
default: {}
- name: signingIdentity
type: object
default: {}
steps:
- task: EsrpCodeSigning@5
displayName: ${{ parameters.displayName }}
inputs:
ConnectedServiceName: ${{ parameters.signingIdentity.serviceName }}
AppRegistrationClientId: ${{ parameters.signingIdentity.appId }}
AppRegistrationTenantId: ${{ parameters.signingIdentity.tenantId }}
AuthAKVName: ${{ parameters.signingIdentity.akvName }}
AuthCertName: ${{ parameters.signingIdentity.authCertName }}
AuthSignCertName: ${{ parameters.signingIdentity.signCertName }}
${{ insert }}: ${{ parameters.inputs }}

View File

@@ -12,6 +12,7 @@
xmlns:model="using:Microsoft.Terminal.Settings.Model"
xmlns:mtu="using:Microsoft.Terminal.UI"
xmlns:mux="using:Microsoft.UI.Xaml.Controls"
MinWidth="256"
AllowFocusOnInteraction="True"
AutomationProperties.Name="{x:Bind ControlName, Mode=OneWay}"
IsTabStop="True"
@@ -99,6 +100,24 @@
GeneralItemTemplate="{StaticResource GeneralItemTemplate}"
NestedItemTemplate="{StaticResource NestedItemTemplate}" />
<!--
Remove all item animations from the suggestions UI. They're
entirely too slow to let that UI be usable.
-->
<Style x:Key="NoAnimationsPlease"
TargetType="ListView">
<Setter Property="ItemContainerTransitions">
<Setter.Value>
<TransitionCollection>
<!-- (deleted transitions are left for reference for what we removed) -->
<ContentThemeTransition />
<!--<AddDeleteThemeTransition/>-->
<!--<ReorderThemeTransition/>-->
<!--<EntranceThemeTransition IsStaggeringEnabled="False"/>-->
</TransitionCollection>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
</UserControl.Resources>
@@ -203,7 +222,8 @@
ItemClick="_listItemClicked"
ItemsSource="{x:Bind FilteredActions}"
SelectionChanged="_listItemSelectionChanged"
SelectionMode="Single" />
SelectionMode="Single"
Style="{StaticResource NoAnimationsPlease}" />
</Grid>

View File

@@ -1899,7 +1899,10 @@ namespace winrt::TerminalApp::implementation
void TerminalPage::PersistState()
{
if (_startupState != StartupState::Initialized)
// This method may be called for a window even if it hasn't had a tab yet or lost all of them.
// We shouldn't persist such windows.
const auto tabCount = _tabs.Size();
if (_startupState != StartupState::Initialized || tabCount == 0)
{
return;
}
@@ -1915,7 +1918,7 @@ namespace winrt::TerminalApp::implementation
// if the focused tab was not the last tab, restore that
auto idx = _GetFocusedTabIndex();
if (idx && idx != _tabs.Size() - 1)
if (idx && idx != tabCount - 1)
{
ActionAndArgs action;
action.Action(ShortcutAction::SwitchToTab);

View File

@@ -263,7 +263,7 @@ namespace winrt::TerminalApp::implementation
AppLogic::Current()->NotifyRootInitialized();
}
void TerminalWindow::Quit()
void TerminalWindow::PersistState()
{
if (_root)
{

View File

@@ -73,7 +73,7 @@ namespace winrt::TerminalApp::implementation
void Create();
void Quit();
void PersistState();
winrt::fire_and_forget UpdateSettings(winrt::TerminalApp::SettingsLoadEventArgs args);

View File

@@ -61,7 +61,7 @@ namespace TerminalApp
Boolean ShouldImmediatelyHandoffToElevated();
void HandoffToElevated();
void Quit();
void PersistState();
Windows.UI.Xaml.UIElement GetRoot();

View File

@@ -180,12 +180,14 @@ namespace winrt::Microsoft::Terminal::TerminalConnection::implementation
const HANDLE hRef,
const HANDLE hServerProcess,
const HANDLE hClientProcess,
TERMINAL_STARTUP_INFO startupInfo) :
const TERMINAL_STARTUP_INFO& startupInfo) :
_rows{ 25 },
_cols{ 80 },
_inPipe{ hIn },
_outPipe{ hOut }
{
_sessionId = Utils::CreateGuid();
THROW_IF_FAILED(ConptyPackPseudoConsole(hServerProcess, hRef, hSig, &_hPC));
_piClient.hProcess = hClientProcess;

View File

@@ -19,7 +19,7 @@ namespace winrt::Microsoft::Terminal::TerminalConnection::implementation
const HANDLE hRef,
const HANDLE hServerProcess,
const HANDLE hClientProcess,
TERMINAL_STARTUP_INFO startupInfo);
const TERMINAL_STARTUP_INFO& startupInfo);
ConptyConnection() noexcept = default;
void Initialize(const Windows::Foundation::Collections::ValueSet& settings);

View File

@@ -161,7 +161,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
std::chrono::milliseconds{ 100 },
[weakTerminal = std::weak_ptr{ _terminal }, weakThis = get_weak(), dispatcher = _dispatcher]() {
dispatcher.TryEnqueue(DispatcherQueuePriority::Normal, [weakThis]() {
if (const auto self = weakThis.get(); !self->_IsClosing())
if (const auto self = weakThis.get(); self && !self->_IsClosing())
{
self->OutputIdle.raise(*self, nullptr);
}
@@ -179,7 +179,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
_dispatcher,
std::chrono::milliseconds{ 8 },
[weakThis = get_weak()](const auto& update) {
if (auto core{ weakThis.get() }; !core->_IsClosing())
if (auto core{ weakThis.get() }; core && !core->_IsClosing())
{
core->ScrollPositionChanged.raise(*core, update);
}

View File

@@ -248,7 +248,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
dispatcher,
TerminalWarningBellInterval,
[weakThis = get_weak()]() {
if (auto control{ weakThis.get() }; !control->_IsClosing())
if (auto control{ weakThis.get() }; control && !control->_IsClosing())
{
control->WarningBell.raise(*control, nullptr);
}
@@ -258,7 +258,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
dispatcher,
ScrollBarUpdateInterval,
[weakThis = get_weak()](const auto& update) {
if (auto control{ weakThis.get() }; !control->_IsClosing())
if (auto control{ weakThis.get() }; control && !control->_IsClosing())
{
control->_throttledUpdateScrollbar(update);
}
@@ -301,7 +301,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
_originalSelectedSecondaryElements.Append(e);
}
ContextMenu().Closed([weakThis = get_weak()](auto&&, auto&&) {
if (auto control{ weakThis.get() }; !control->_IsClosing())
if (auto control{ weakThis.get() }; control && !control->_IsClosing())
{
const auto& menu{ control->ContextMenu() };
menu.PrimaryCommands().Clear();
@@ -317,7 +317,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
}
});
SelectionContextMenu().Closed([weakThis = get_weak()](auto&&, auto&&) {
if (auto control{ weakThis.get() }; !control->_IsClosing())
if (auto control{ weakThis.get() }; control && !control->_IsClosing())
{
const auto& menu{ control->SelectionContextMenu() };
menu.PrimaryCommands().Clear();
@@ -544,7 +544,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
}
_searchBox->Open([weakThis = get_weak()]() {
if (const auto self = weakThis.get(); !self->_IsClosing())
if (const auto self = weakThis.get(); self && !self->_IsClosing())
{
self->_searchBox->SetFocusOnTextbox();
self->_refreshSearch();
@@ -1055,8 +1055,11 @@ namespace winrt::Microsoft::Terminal::Control::implementation
// MSFT 33353327: We're purposefully not using _initializedTerminal to ensure we're fully initialized.
// Doing so makes us return nullptr when XAML requests an automation peer.
// Instead, we need to give XAML an automation peer, then fix it later.
if (!_IsClosing())
if (!_IsClosing() && !_detached)
{
// It's unexpected that interactivity is null even when we're not closing or in detached state.
THROW_HR_IF_NULL(E_UNEXPECTED, _interactivity);
// create a custom automation peer with this code pattern:
// (https://docs.microsoft.com/en-us/windows/uwp/design/accessibility/custom-automation-peers)
if (const auto& interactivityAutoPeer{ _interactivity.OnCreateAutomationPeer() })
@@ -1120,7 +1123,9 @@ namespace winrt::Microsoft::Terminal::Control::implementation
co_return;
}
const auto hr = args.Result();
// HRESULT is a signed 32-bit integer which would result in a hex output like "-0x7766FFF4",
// but canonically HRESULTs are displayed unsigned as "0x8899000C". See GH#11556.
const auto hr = std::bit_cast<uint32_t>(args.Result());
const auto parameter = args.Parameter();
winrt::hstring message;

View File

@@ -895,6 +895,9 @@
<value>Schriftart</value>
<comment>Name for a control to select the font for text in the app.</comment>
</data>
<data name="Profile_FontFace.HelpText" xml:space="preserve">
<value>Sie können mehrere Schriftarten verwenden, indem Sie sie durch ein ASCII-Komma voneinander trennen.</value>
</data>
<data name="Profile_FontSize.Header" xml:space="preserve">
<value>Schriftgrad</value>
<comment>Header for a control to determine the size of the text in the app.</comment>
@@ -928,7 +931,7 @@
<comment>The main label of a toggle. When enabled, certain characters (glyphs) are replaced with better looking ones.</comment>
</data>
<data name="Profile_EnableBuiltinGlyphs.HelpText" xml:space="preserve">
<value>Wenn diese Option aktiviert ist, zeichnet das Terminal benutzerdefinierte Glyphen für Blockelement- und Feldzeichnungszeichen, anstatt die Schriftart zu verwenden. Dieses Feature funktioniert nur, wenn GPU-Beschleunigung verfügbar ist.</value>
<value>Wenn diese Option aktiviert ist, zeichnet das Terminal benutzerdefinierte Glyphen für Blockelement- und Feldzeichnungszeichen, anstatt die Schriftart zu verwenden. Dieses Feature ist nicht verfügbar, wenn Direct2D als Grafik-API verwendet wird.</value>
<comment>A longer description of the "Profile_EnableBuiltinGlyphs" toggle. "glyphs", "block element" and "box drawing characters" are technical terms from the Unicode specification.</comment>
</data>
<data name="Profile_EnableColorGlyphs.Header" xml:space="preserve">

View File

@@ -895,6 +895,9 @@
<value>Font face</value>
<comment>Name for a control to select the font for text in the app.</comment>
</data>
<data name="Profile_FontFace.HelpText" xml:space="preserve">
<value>You can use multiple fonts by separating them with an ASCII comma.</value>
</data>
<data name="Profile_FontSize.Header" xml:space="preserve">
<value>Font size</value>
<comment>Header for a control to determine the size of the text in the app.</comment>
@@ -928,7 +931,7 @@
<comment>The main label of a toggle. When enabled, certain characters (glyphs) are replaced with better looking ones.</comment>
</data>
<data name="Profile_EnableBuiltinGlyphs.HelpText" xml:space="preserve">
<value>When enabled, the terminal draws custom glyphs for block element and box drawing characters instead of using the font. This feature only works when GPU Acceleration is available.</value>
<value>When enabled, the terminal draws custom glyphs for block element and box drawing characters instead of using the font. This feature is unavailable when using Direct2D as the Graphics API.</value>
<comment>A longer description of the "Profile_EnableBuiltinGlyphs" toggle. "glyphs", "block element" and "box drawing characters" are technical terms from the Unicode specification.</comment>
</data>
<data name="Profile_EnableColorGlyphs.Header" xml:space="preserve">

View File

@@ -733,10 +733,16 @@
<value>Examinar...</value>
<comment>Button label that opens a file picker in a new window. The "..." is standard to mean it will open a new window.</comment>
</data>
<data name="Profile_AddFontAxisButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Agregar nuevo eje de fuente</value>
</data>
<data name="Profile_AddNewFontAxis.Text" xml:space="preserve">
<value>Agregar nuevo</value>
<comment>Button label that adds a new font axis for the current font.</comment>
</data>
<data name="Profile_AddFontFeatureButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Agregar nueva característica de fuente</value>
</data>
<data name="Profile_AddNewFontFeature.Text" xml:space="preserve">
<value>Agregar nuevo</value>
<comment>Button label that adds a new font feature for the current font.</comment>
@@ -889,6 +895,9 @@
<value>Tipo de fuente</value>
<comment>Name for a control to select the font for text in the app.</comment>
</data>
<data name="Profile_FontFace.HelpText" xml:space="preserve">
<value>Puede usar varias fuentes separándolas con una coma ASCII.</value>
</data>
<data name="Profile_FontSize.Header" xml:space="preserve">
<value>Tamaño de la fuente</value>
<comment>Header for a control to determine the size of the text in the app.</comment>
@@ -922,7 +931,7 @@
<comment>The main label of a toggle. When enabled, certain characters (glyphs) are replaced with better looking ones.</comment>
</data>
<data name="Profile_EnableBuiltinGlyphs.HelpText" xml:space="preserve">
<value>Cuando está habilitado, el terminal dibuja glifos personalizados para los caracteres de dibujo de elementos de bloque y cuadros, en lugar de usar la fuente. Esta característica solo funciona cuando la aceleración de GPU está disponible.</value>
<value>Cuando está habilitado, el terminal dibuja glifos personalizados para los caracteres de dibujo de elementos de bloque y cuadros, en lugar de usar la fuente. Esta característica no está disponible cuando se usa Direct2D como API de gráficos.</value>
<comment>A longer description of the "Profile_EnableBuiltinGlyphs" toggle. "glyphs", "block element" and "box drawing characters" are technical terms from the Unicode specification.</comment>
</data>
<data name="Profile_EnableColorGlyphs.Header" xml:space="preserve">

View File

@@ -895,6 +895,9 @@
<value>Type de police</value>
<comment>Name for a control to select the font for text in the app.</comment>
</data>
<data name="Profile_FontFace.HelpText" xml:space="preserve">
<value>Vous pouvez utiliser plusieurs polices en les séparant par une virgule ASCII.</value>
</data>
<data name="Profile_FontSize.Header" xml:space="preserve">
<value>Taille de police</value>
<comment>Header for a control to determine the size of the text in the app.</comment>
@@ -928,7 +931,7 @@
<comment>The main label of a toggle. When enabled, certain characters (glyphs) are replaced with better looking ones.</comment>
</data>
<data name="Profile_EnableBuiltinGlyphs.HelpText" xml:space="preserve">
<value>Lorsque cette option est activée, le terminal dessine des glyphes personnalisés pour les éléments de bloc et les caractères de dessin de boîte au lieu dutiliser la police. Cette fonctionnalité ne fonctionne que lorsque laccélération GPU est disponible.</value>
<value>Lorsque cette option est activée, le terminal dessine des glyphes personnalisés pour les éléments de bloc et les caractères de dessin de boîte au lieu dutiliser la police. Cette fonctionnalité nest pas disponible lors de lutilisation de Direct2D comme API Graphics.</value>
<comment>A longer description of the "Profile_EnableBuiltinGlyphs" toggle. "glyphs", "block element" and "box drawing characters" are technical terms from the Unicode specification.</comment>
</data>
<data name="Profile_EnableColorGlyphs.Header" xml:space="preserve">

View File

@@ -733,10 +733,16 @@
<value>Sfoglia...</value>
<comment>Button label that opens a file picker in a new window. The "..." is standard to mean it will open a new window.</comment>
</data>
<data name="Profile_AddFontAxisButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Aggiungi nuovo asse dei tipi di carattere</value>
</data>
<data name="Profile_AddNewFontAxis.Text" xml:space="preserve">
<value>Aggiungi nuovo</value>
<comment>Button label that adds a new font axis for the current font.</comment>
</data>
<data name="Profile_AddFontFeatureButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Aggiungi nuova funzionalità dei tipi di carattere</value>
</data>
<data name="Profile_AddNewFontFeature.Text" xml:space="preserve">
<value>Aggiungi nuovo</value>
<comment>Button label that adds a new font feature for the current font.</comment>
@@ -889,6 +895,9 @@
<value>Tipo di carattere</value>
<comment>Name for a control to select the font for text in the app.</comment>
</data>
<data name="Profile_FontFace.HelpText" xml:space="preserve">
<value>Puoi usare più tipi di carattere separandoli con una virgola ASCII.</value>
</data>
<data name="Profile_FontSize.Header" xml:space="preserve">
<value>Dimensioni del carattere</value>
<comment>Header for a control to determine the size of the text in the app.</comment>
@@ -922,7 +931,7 @@
<comment>The main label of a toggle. When enabled, certain characters (glyphs) are replaced with better looking ones.</comment>
</data>
<data name="Profile_EnableBuiltinGlyphs.HelpText" xml:space="preserve">
<value>Se abilitata, il terminale disegna glifi personalizzati per i caratteri di disegno a blocchi di elementi e caselle anziché usare il tipo di carattere. Questa funzionalità funziona solo quando è disponibile l'accelerazione GPU.</value>
<value>Se abilitata, il terminale disegna glifi personalizzati per i caratteri di disegno a blocchi di elementi e caselle anziché usare il tipo di carattere. Questa funzionalità non è disponibile quando si usa Direct2D come API grafica.</value>
<comment>A longer description of the "Profile_EnableBuiltinGlyphs" toggle. "glyphs", "block element" and "box drawing characters" are technical terms from the Unicode specification.</comment>
</data>
<data name="Profile_EnableColorGlyphs.Header" xml:space="preserve">

View File

@@ -733,10 +733,16 @@
<value>参照...</value>
<comment>Button label that opens a file picker in a new window. The "..." is standard to mean it will open a new window.</comment>
</data>
<data name="Profile_AddFontAxisButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>新しいフォント軸の追加</value>
</data>
<data name="Profile_AddNewFontAxis.Text" xml:space="preserve">
<value>新規追加</value>
<comment>Button label that adds a new font axis for the current font.</comment>
</data>
<data name="Profile_AddFontFeatureButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>新しいフォント機能の追加</value>
</data>
<data name="Profile_AddNewFontFeature.Text" xml:space="preserve">
<value>新規追加</value>
<comment>Button label that adds a new font feature for the current font.</comment>
@@ -889,6 +895,9 @@
<value>フォント フェイス</value>
<comment>Name for a control to select the font for text in the app.</comment>
</data>
<data name="Profile_FontFace.HelpText" xml:space="preserve">
<value>複数のフォントを使用するには、複数のフォントを ASCII コンマで区切ります。</value>
</data>
<data name="Profile_FontSize.Header" xml:space="preserve">
<value>フォント サイズ</value>
<comment>Header for a control to determine the size of the text in the app.</comment>
@@ -922,7 +931,7 @@
<comment>The main label of a toggle. When enabled, certain characters (glyphs) are replaced with better looking ones.</comment>
</data>
<data name="Profile_EnableBuiltinGlyphs.HelpText" xml:space="preserve">
<value>有効にすると、ターミナルは、フォントを使用する代わりに、ブロック要素とボックス描画文字のカスタム グリフを描画します。この機能は、GPU アクセラレーションが使用可能な場合にのみ機能します。</value>
<value>有効にすると、ターミナルは、フォントを使用する代わりに、ブロック要素とボックス描画文字のカスタム グリフを描画します。グラフィックス API として Direct2D を使用している場合、この機能は使用できません。</value>
<comment>A longer description of the "Profile_EnableBuiltinGlyphs" toggle. "glyphs", "block element" and "box drawing characters" are technical terms from the Unicode specification.</comment>
</data>
<data name="Profile_EnableColorGlyphs.Header" xml:space="preserve">

View File

@@ -733,10 +733,16 @@
<value>찾아보기...</value>
<comment>Button label that opens a file picker in a new window. The "..." is standard to mean it will open a new window.</comment>
</data>
<data name="Profile_AddFontAxisButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>새 글꼴 추가 축</value>
</data>
<data name="Profile_AddNewFontAxis.Text" xml:space="preserve">
<value>새로 추가</value>
<comment>Button label that adds a new font axis for the current font.</comment>
</data>
<data name="Profile_AddFontFeatureButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>새 글꼴 추가 기능</value>
</data>
<data name="Profile_AddNewFontFeature.Text" xml:space="preserve">
<value>새로 추가</value>
<comment>Button label that adds a new font feature for the current font.</comment>
@@ -889,6 +895,9 @@
<value>글꼴</value>
<comment>Name for a control to select the font for text in the app.</comment>
</data>
<data name="Profile_FontFace.HelpText" xml:space="preserve">
<value>여러 글꼴을 ASCII 쉼표로 구분하여 사용할 수 있습니다.</value>
</data>
<data name="Profile_FontSize.Header" xml:space="preserve">
<value>글꼴 크기</value>
<comment>Header for a control to determine the size of the text in the app.</comment>
@@ -922,7 +931,7 @@
<comment>The main label of a toggle. When enabled, certain characters (glyphs) are replaced with better looking ones.</comment>
</data>
<data name="Profile_EnableBuiltinGlyphs.HelpText" xml:space="preserve">
<value>사용하도록 설정하면 터미널은 글꼴을 사용하는 대신 블록 요소 및 상자 그리기 문자에 대한 사용자 지정 문자 모양을 그립니다. 이 기능은 GPU 가속을 사용할 수 있는 경우에만 작동합니다.</value>
<value>사용하도록 설정하면 터미널은 글꼴을 사용하는 대신 블록 요소 및 상자 그리기 문자에 대한 사용자 지정 문자 모양을 그립니다. Direct2D를 그래픽 API로 사용할 때는 이 기능을 사용할 수 없습니다.</value>
<comment>A longer description of the "Profile_EnableBuiltinGlyphs" toggle. "glyphs", "block element" and "box drawing characters" are technical terms from the Unicode specification.</comment>
</data>
<data name="Profile_EnableColorGlyphs.Header" xml:space="preserve">

View File

@@ -733,10 +733,16 @@
<value>Procurar...</value>
<comment>Button label that opens a file picker in a new window. The "..." is standard to mean it will open a new window.</comment>
</data>
<data name="Profile_AddFontAxisButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Adicionar novo eixo de fonte</value>
</data>
<data name="Profile_AddNewFontAxis.Text" xml:space="preserve">
<value>Adicionar novo</value>
<comment>Button label that adds a new font axis for the current font.</comment>
</data>
<data name="Profile_AddFontFeatureButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Adicionar novo recurso de fonte</value>
</data>
<data name="Profile_AddNewFontFeature.Text" xml:space="preserve">
<value>Adicionar novo</value>
<comment>Button label that adds a new font feature for the current font.</comment>
@@ -889,6 +895,9 @@
<value>Tipo de fonte</value>
<comment>Name for a control to select the font for text in the app.</comment>
</data>
<data name="Profile_FontFace.HelpText" xml:space="preserve">
<value>Pode utilizar vários tipos de letra separando-os com uma vírgula ASCII.</value>
</data>
<data name="Profile_FontSize.Header" xml:space="preserve">
<value>Tamanho da fonte</value>
<comment>Header for a control to determine the size of the text in the app.</comment>
@@ -922,7 +931,7 @@
<comment>The main label of a toggle. When enabled, certain characters (glyphs) are replaced with better looking ones.</comment>
</data>
<data name="Profile_EnableBuiltinGlyphs.HelpText" xml:space="preserve">
<value>Quando habilitado, o terminal desenha glifos personalizados para caracteres de desenho de elemento de bloco e caixa em vez de usar a fonte. Esse recurso só funciona quando a Aceleração de GPU está disponível.</value>
<value>Quando habilitado, o terminal desenha glifos personalizados para caracteres de desenho de elemento de bloco e caixa em vez de usar a fonte. Esse recurso não está disponível ao usar o Direct2D como a API de Gráficos.</value>
<comment>A longer description of the "Profile_EnableBuiltinGlyphs" toggle. "glyphs", "block element" and "box drawing characters" are technical terms from the Unicode specification.</comment>
</data>
<data name="Profile_EnableColorGlyphs.Header" xml:space="preserve">

View File

@@ -895,6 +895,9 @@
<value>₣øñŧ ƒдсέ !!!</value>
<comment>Name for a control to select the font for text in the app.</comment>
</data>
<data name="Profile_FontFace.HelpText" xml:space="preserve">
<value>Ýоύ ĉąи ύŝè мύŀŧΐρļĕ ƒőйτš ъý ѕéραгдŧĭʼnğ ţнэm щїţђ áп ∆ŚČĨĨ çőмmа. !!! !!! !!! !!! !!! !!! !</value>
</data>
<data name="Profile_FontSize.Header" xml:space="preserve">
<value>₣ŏňτ şίźε !!!</value>
<comment>Header for a control to determine the size of the text in the app.</comment>
@@ -928,7 +931,7 @@
<comment>The main label of a toggle. When enabled, certain characters (glyphs) are replaced with better looking ones.</comment>
</data>
<data name="Profile_EnableBuiltinGlyphs.HelpText" xml:space="preserve">
<value>Ẅħĕň еņªъℓёð, тћз τēгмïπдℓ ðѓáшş çύšτом ģļўφħѕ ƒǿя ъĺôсĸ éêmήŧ àñð ъο× ðгдωΐπĝ čћдŗąςŧέѓś ìπŝţėãđ ŏƒ ũŝіⁿğ ťћę ƒбηŧ. Ţћιş ƒзаτџŕè οʼnĺŷ ωóгκŝ ẁĥéŋ ĢΡŬ Àςĉеŀèѓдτισñ ĩѕ ǻνãîļåвłę. !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!</value>
<value>Ẅħĕň еņªъℓёð, тћз τēгмïπдℓ ðѓáшş çύšτом ģļўφħѕ ƒǿя ъĺôсĸ éêmήŧ àñð ъο× ðгдωΐπĝ čћдŗąςŧέѓś ìπŝţėãđ ŏƒ ũŝіⁿğ ťћę ƒбηŧ. Ţћιş ƒзаτџŕè ίš úπâνάίļǻвĺз ẅнέи μşιńĝ Ďΐґеčт2Ď άѕ тħë Ĝяãрнĩςŝ ÃРÌ. !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!</value>
<comment>A longer description of the "Profile_EnableBuiltinGlyphs" toggle. "glyphs", "block element" and "box drawing characters" are technical terms from the Unicode specification.</comment>
</data>
<data name="Profile_EnableColorGlyphs.Header" xml:space="preserve">

View File

@@ -895,6 +895,9 @@
<value>₣øñŧ ƒдсέ !!!</value>
<comment>Name for a control to select the font for text in the app.</comment>
</data>
<data name="Profile_FontFace.HelpText" xml:space="preserve">
<value>Ýоύ ĉąи ύŝè мύŀŧΐρļĕ ƒőйτš ъý ѕéραгдŧĭʼnğ ţнэm щїţђ áп ∆ŚČĨĨ çőмmа. !!! !!! !!! !!! !!! !!! !</value>
</data>
<data name="Profile_FontSize.Header" xml:space="preserve">
<value>₣ŏňτ şίźε !!!</value>
<comment>Header for a control to determine the size of the text in the app.</comment>
@@ -928,7 +931,7 @@
<comment>The main label of a toggle. When enabled, certain characters (glyphs) are replaced with better looking ones.</comment>
</data>
<data name="Profile_EnableBuiltinGlyphs.HelpText" xml:space="preserve">
<value>Ẅħĕň еņªъℓёð, тћз τēгмïπдℓ ðѓáшş çύšτом ģļўφħѕ ƒǿя ъĺôсĸ éêmήŧ àñð ъο× ðгдωΐπĝ čћдŗąςŧέѓś ìπŝţėãđ ŏƒ ũŝіⁿğ ťћę ƒбηŧ. Ţћιş ƒзаτџŕè οʼnĺŷ ωóгκŝ ẁĥéŋ ĢΡŬ Àςĉеŀèѓдτισñ ĩѕ ǻνãîļåвłę. !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!</value>
<value>Ẅħĕň еņªъℓёð, тћз τēгмïπдℓ ðѓáшş çύšτом ģļўφħѕ ƒǿя ъĺôсĸ éêmήŧ àñð ъο× ðгдωΐπĝ čћдŗąςŧέѓś ìπŝţėãđ ŏƒ ũŝіⁿğ ťћę ƒбηŧ. Ţћιş ƒзаτџŕè ίš úπâνάίļǻвĺз ẅнέи μşιńĝ Ďΐґеčт2Ď άѕ тħë Ĝяãрнĩςŝ ÃРÌ. !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!</value>
<comment>A longer description of the "Profile_EnableBuiltinGlyphs" toggle. "glyphs", "block element" and "box drawing characters" are technical terms from the Unicode specification.</comment>
</data>
<data name="Profile_EnableColorGlyphs.Header" xml:space="preserve">

View File

@@ -895,6 +895,9 @@
<value>₣øñŧ ƒдсέ !!!</value>
<comment>Name for a control to select the font for text in the app.</comment>
</data>
<data name="Profile_FontFace.HelpText" xml:space="preserve">
<value>Ýоύ ĉąи ύŝè мύŀŧΐρļĕ ƒőйτš ъý ѕéραгдŧĭʼnğ ţнэm щїţђ áп ∆ŚČĨĨ çőмmа. !!! !!! !!! !!! !!! !!! !</value>
</data>
<data name="Profile_FontSize.Header" xml:space="preserve">
<value>₣ŏňτ şίźε !!!</value>
<comment>Header for a control to determine the size of the text in the app.</comment>
@@ -928,7 +931,7 @@
<comment>The main label of a toggle. When enabled, certain characters (glyphs) are replaced with better looking ones.</comment>
</data>
<data name="Profile_EnableBuiltinGlyphs.HelpText" xml:space="preserve">
<value>Ẅħĕň еņªъℓёð, тћз τēгмïπдℓ ðѓáшş çύšτом ģļўφħѕ ƒǿя ъĺôсĸ éêmήŧ àñð ъο× ðгдωΐπĝ čћдŗąςŧέѓś ìπŝţėãđ ŏƒ ũŝіⁿğ ťћę ƒбηŧ. Ţћιş ƒзаτџŕè οʼnĺŷ ωóгκŝ ẁĥéŋ ĢΡŬ Àςĉеŀèѓдτισñ ĩѕ ǻνãîļåвłę. !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!</value>
<value>Ẅħĕň еņªъℓёð, тћз τēгмïπдℓ ðѓáшş çύšτом ģļўφħѕ ƒǿя ъĺôсĸ éêmήŧ àñð ъο× ðгдωΐπĝ čћдŗąςŧέѓś ìπŝţėãđ ŏƒ ũŝіⁿğ ťћę ƒбηŧ. Ţћιş ƒзаτџŕè ίš úπâνάίļǻвĺз ẅнέи μşιńĝ Ďΐґеčт2Ď άѕ тħë Ĝяãрнĩςŝ ÃРÌ. !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!</value>
<comment>A longer description of the "Profile_EnableBuiltinGlyphs" toggle. "glyphs", "block element" and "box drawing characters" are technical terms from the Unicode specification.</comment>
</data>
<data name="Profile_EnableColorGlyphs.Header" xml:space="preserve">

View File

@@ -895,6 +895,9 @@
<value>Начертание шрифта</value>
<comment>Name for a control to select the font for text in the app.</comment>
</data>
<data name="Profile_FontFace.HelpText" xml:space="preserve">
<value>Вы можете использовать несколько шрифтов, разделив их запятой ASCII.</value>
</data>
<data name="Profile_FontSize.Header" xml:space="preserve">
<value>Размер шрифта</value>
<comment>Header for a control to determine the size of the text in the app.</comment>
@@ -928,7 +931,7 @@
<comment>The main label of a toggle. When enabled, certain characters (glyphs) are replaced with better looking ones.</comment>
</data>
<data name="Profile_EnableBuiltinGlyphs.HelpText" xml:space="preserve">
<value>Если этот параметр включен, терминал рисует собственные глифы для элементов блока и символов рисования прямоугольников вместо использования шрифта. Эта функция работает только тогда, когда доступно ускорение графического процессора.</value>
<value>Если этот параметр включен, терминал рисует собственные глифы для элементов блока и символов рисования прямоугольников вместо использования шрифта. Эта функция недоступна при использовании Direct2D в качестве API графики.</value>
<comment>A longer description of the "Profile_EnableBuiltinGlyphs" toggle. "glyphs", "block element" and "box drawing characters" are technical terms from the Unicode specification.</comment>
</data>
<data name="Profile_EnableColorGlyphs.Header" xml:space="preserve">

View File

@@ -895,6 +895,9 @@
<value>字体</value>
<comment>Name for a control to select the font for text in the app.</comment>
</data>
<data name="Profile_FontFace.HelpText" xml:space="preserve">
<value>通过使用 ASCII 逗号分隔多个字体,可以使用这些字体。</value>
</data>
<data name="Profile_FontSize.Header" xml:space="preserve">
<value>字号</value>
<comment>Header for a control to determine the size of the text in the app.</comment>
@@ -928,7 +931,7 @@
<comment>The main label of a toggle. When enabled, certain characters (glyphs) are replaced with better looking ones.</comment>
</data>
<data name="Profile_EnableBuiltinGlyphs.HelpText" xml:space="preserve">
<value>启用后,终端将为块元素和制表符绘制自定义标志符号,而不是使用字体。仅当 GPU 加速可用时,此功能才有效。</value>
<value>启用后,终端会使用自定义字形来绘制块元素和框线绘图字符,而不是使用字体。使用 Direct2D 作为图形 API 时,此功能不可用。</value>
<comment>A longer description of the "Profile_EnableBuiltinGlyphs" toggle. "glyphs", "block element" and "box drawing characters" are technical terms from the Unicode specification.</comment>
</data>
<data name="Profile_EnableColorGlyphs.Header" xml:space="preserve">

View File

@@ -895,6 +895,9 @@
<value>字體</value>
<comment>Name for a control to select the font for text in the app.</comment>
</data>
<data name="Profile_FontFace.HelpText" xml:space="preserve">
<value>您可以使用 ASCII 逗號分隔多個字型。</value>
</data>
<data name="Profile_FontSize.Header" xml:space="preserve">
<value>字型大小</value>
<comment>Header for a control to determine the size of the text in the app.</comment>
@@ -928,7 +931,7 @@
<comment>The main label of a toggle. When enabled, certain characters (glyphs) are replaced with better looking ones.</comment>
</data>
<data name="Profile_EnableBuiltinGlyphs.HelpText" xml:space="preserve">
<value>啟用時,終端機會為區塊元素和方塊繪圖字元繪製自訂字符,而非使用字型。此功能僅在可使用 GPU 加速時作用。</value>
<value>啟用時,終端機會為區塊元素和方塊繪圖字元繪製自訂字符,而非使用字型。此功能無法在使用 Direct2D 做為圖形 API 時使用。</value>
<comment>A longer description of the "Profile_EnableBuiltinGlyphs" toggle. "glyphs", "block element" and "box drawing characters" are technical terms from the Unicode specification.</comment>
</data>
<data name="Profile_EnableColorGlyphs.Header" xml:space="preserve">

View File

@@ -690,7 +690,7 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
auto data = winrt::to_string(json);
std::string errs;
static std::unique_ptr<Json::CharReader> reader{ Json::CharReaderBuilder{}.newCharReader() };
std::unique_ptr<Json::CharReader> reader{ Json::CharReaderBuilder{}.newCharReader() };
Json::Value root;
if (!reader->parse(data.data(), data.data() + data.size(), &root, &errs))
{

View File

@@ -1184,13 +1184,16 @@ winrt::fire_and_forget AppHost::_QuitRequested(const winrt::Windows::Foundation:
co_await wil::resume_foreground(_windowLogic.GetRoot().Dispatcher());
const auto strongThis = weakThis.lock();
// GH #16235: If we don't have a window logic, we're already refrigerating, and won't have our _window either.
if (!strongThis || _windowLogic == nullptr)
if (!strongThis)
{
co_return;
}
_windowLogic.Quit();
if (_appLogic && _windowLogic && _appLogic.ShouldUsePersistedLayout())
{
_windowLogic.PersistState();
}
PostQuitMessage(0);
}

View File

@@ -348,6 +348,14 @@ void WindowEmperor::_becomeMonarch()
_revokers.WindowCreated = _manager.WindowCreated(winrt::auto_revoke, { this, &WindowEmperor::_numberOfWindowsChanged });
_revokers.WindowClosed = _manager.WindowClosed(winrt::auto_revoke, { this, &WindowEmperor::_numberOfWindowsChanged });
// If a previous session of Windows Terminal stored buffer_*.txt files, then we need to clean all those up on exit
// that aren't needed anymore, even if the user disabled the ShouldUsePersistedLayout() setting in the meantime.
{
const auto state = ApplicationState::SharedInstance();
const auto layouts = state.PersistedWindowLayouts();
_requiresPersistenceCleanupOnExit = layouts && layouts.Size() > 0;
}
}
// sender and args are always nullptr
@@ -486,7 +494,7 @@ void WindowEmperor::_finalizeSessionPersistence() const
// Ensure to write the state.json before we TerminateProcess()
state.Flush();
if (!_app.Logic().ShouldUsePersistedLayout())
if (!_requiresPersistenceCleanupOnExit)
{
return;
}

View File

@@ -51,6 +51,7 @@ private:
std::unique_ptr<NotificationIcon> _notificationIcon;
bool _requiresPersistenceCleanupOnExit = false;
bool _quitting{ false };
void _windowStartedHandlerPostXAML(const std::shared_ptr<WindowThread>& sender);

View File

@@ -636,7 +636,7 @@ void AtlasEngine::_resolveFontMetrics(const FontInfoDesired& fontInfoDesired, Fo
const auto& faceName = fontInfoDesired.GetFaceName();
const auto requestedFamily = fontInfoDesired.GetFamily();
auto requestedWeight = fontInfoDesired.GetWeight();
auto fontSize = fontInfoDesired.GetFontSize();
auto fontSize = std::clamp(fontInfoDesired.GetFontSize(), 1.0f, 100.0f);
auto requestedSize = fontInfoDesired.GetEngineSize();
if (!requestedSize.height)

View File

@@ -55,7 +55,7 @@ catch (const wil::ResultException& exception)
{
const auto hr = exception.GetErrorCode();
if (hr == DXGI_ERROR_DEVICE_REMOVED || hr == DXGI_ERROR_DEVICE_RESET)
if (hr == DXGI_ERROR_DEVICE_REMOVED || hr == DXGI_ERROR_DEVICE_RESET || hr == D2DERR_RECREATE_TARGET)
{
_p.dxgi = {};
return E_PENDING;

View File

@@ -39,18 +39,28 @@ void BackendD2D::Render(RenderingPayload& p)
}
_renderTarget->BeginDraw();
try
{
#if ATLAS_DEBUG_SHOW_DIRTY || ATLAS_DEBUG_DUMP_RENDER_TARGET
// Invalidating the render target helps with spotting Present1() bugs.
_renderTarget->Clear();
// Invalidating the render target helps with spotting Present1() bugs.
_renderTarget->Clear();
#endif
_drawBackground(p);
_drawCursorPart1(p);
_drawText(p);
_drawCursorPart2(p);
_drawSelection(p);
_drawBackground(p);
_drawCursorPart1(p);
_drawText(p);
_drawCursorPart2(p);
_drawSelection(p);
#if ATLAS_DEBUG_SHOW_DIRTY
_debugShowDirty(p);
_debugShowDirty(p);
#endif
}
catch (...)
{
// In case an exception is thrown for some reason between BeginDraw() and EndDraw()
// we still technically need to call EndDraw() before releasing any resources.
LOG_IF_FAILED(_renderTarget->EndDraw());
throw;
}
THROW_IF_FAILED(_renderTarget->EndDraw());
#if ATLAS_DEBUG_DUMP_RENDER_TARGET
@@ -148,11 +158,11 @@ void BackendD2D::_handleSettingsUpdate(const RenderingPayload& p)
_viewportCellCount = p.s->viewportCellCount;
}
void BackendD2D::_drawBackground(const RenderingPayload& p) noexcept
void BackendD2D::_drawBackground(const RenderingPayload& p)
{
if (_backgroundBitmapGeneration != p.colorBitmapGenerations[0])
{
_backgroundBitmap->CopyFromMemory(nullptr, p.backgroundBitmap.data(), gsl::narrow_cast<UINT32>(p.colorBitmapRowStride * sizeof(u32)));
THROW_IF_FAILED(_backgroundBitmap->CopyFromMemory(nullptr, p.backgroundBitmap.data(), gsl::narrow_cast<UINT32>(p.colorBitmapRowStride * sizeof(u32))));
_backgroundBitmapGeneration = p.colorBitmapGenerations[0];
}
@@ -356,7 +366,7 @@ f32r BackendD2D::_getGlyphRunDesignBounds(const DWRITE_GLYPH_RUN& glyphRun, f32
_glyphMetrics = Buffer<DWRITE_GLYPH_METRICS>{ size };
}
glyphRun.fontFace->GetDesignGlyphMetrics(glyphRun.glyphIndices, glyphRun.glyphCount, _glyphMetrics.data(), false);
THROW_IF_FAILED(glyphRun.fontFace->GetDesignGlyphMetrics(glyphRun.glyphIndices, glyphRun.glyphCount, _glyphMetrics.data(), false));
const f32 fontScale = glyphRun.fontEmSize / fontMetrics.designUnitsPerEm;
f32r accumulatedBounds{
@@ -541,7 +551,8 @@ void BackendD2D::_resizeCursorBitmap(const RenderingPayload& p, const til::size
const D2D1_SIZE_F sizeF{ static_cast<f32>(newSizeInPx.width), static_cast<f32>(newSizeInPx.height) };
const D2D1_SIZE_U sizeU{ gsl::narrow_cast<UINT32>(newSizeInPx.width), gsl::narrow_cast<UINT32>(newSizeInPx.height) };
wil::com_ptr<ID2D1BitmapRenderTarget> cursorRenderTarget;
_renderTarget->CreateCompatibleRenderTarget(&sizeF, &sizeU, nullptr, D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE, cursorRenderTarget.addressof());
THROW_IF_FAILED(_renderTarget->CreateCompatibleRenderTarget(&sizeF, &sizeU, nullptr, D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE, cursorRenderTarget.addressof()));
cursorRenderTarget->SetAntialiasMode(D2D1_ANTIALIAS_MODE_ALIASED);
cursorRenderTarget->BeginDraw();
@@ -553,7 +564,7 @@ void BackendD2D::_resizeCursorBitmap(const RenderingPayload& p, const til::size
}
THROW_IF_FAILED(cursorRenderTarget->EndDraw());
cursorRenderTarget->GetBitmap(_cursorBitmap.put());
THROW_IF_FAILED(cursorRenderTarget->GetBitmap(_cursorBitmap.put()));
_cursorBitmapSize = newSize;
}

View File

@@ -17,7 +17,7 @@ namespace Microsoft::Console::Render::Atlas
private:
ATLAS_ATTR_COLD void _handleSettingsUpdate(const RenderingPayload& p);
void _drawBackground(const RenderingPayload& p) noexcept;
void _drawBackground(const RenderingPayload& p);
void _drawText(RenderingPayload& p);
ATLAS_ATTR_COLD f32 _drawTextPrepareLineRendition(const RenderingPayload& p, const ShapedRow* row, f32 baselineY) const noexcept;
ATLAS_ATTR_COLD void _drawTextResetLineRendition(const ShapedRow* row) const noexcept;

View File

@@ -184,6 +184,18 @@ BackendD3D::BackendD3D(const RenderingPayload& p)
#endif
}
#pragma warning(suppress : 26432) // If you define or delete any default operation in the type '...', define or delete them all (c.21).
BackendD3D::~BackendD3D()
{
// In case an exception is thrown for some reason between BeginDraw() and EndDraw()
// we still technically need to call EndDraw() before releasing any resources.
if (_d2dBeganDrawing)
{
#pragma warning(suppress : 26447) // The function is declared 'noexcept' but calls function '...' which may throw exceptions (f.6).
LOG_IF_FAILED(_d2dRenderTarget->EndDraw());
}
}
void BackendD3D::ReleaseResources() noexcept
{
_renderTargetView.reset();

View File

@@ -13,6 +13,7 @@ namespace Microsoft::Console::Render::Atlas
struct BackendD3D : IBackend
{
BackendD3D(const RenderingPayload& p);
~BackendD3D() override;
void ReleaseResources() noexcept override;
void Render(RenderingPayload& payload) override;

View File

@@ -404,9 +404,9 @@ namespace Microsoft::Console::Render::Atlas
til::generational<CursorSettings> cursor;
til::generational<MiscellaneousSettings> misc;
// Size of the viewport / swap chain in pixel.
u16x2 targetSize{ 1, 1 };
u16x2 targetSize{ 0, 0 };
// Size of the portion of the text buffer that we're drawing on the screen.
u16x2 viewportCellCount{ 1, 1 };
u16x2 viewportCellCount{ 0, 0 };
// The position of the viewport inside the text buffer (in cells).
u16x2 viewportOffset{ 0, 0 };
};

View File

@@ -37,7 +37,20 @@ XtermEngine::XtermEngine(_In_ wil::unique_hfile hPipe,
// the pipe.
[[nodiscard]] HRESULT XtermEngine::StartPaint() noexcept
{
RETURN_IF_FAILED(VtEngine::StartPaint());
const auto hr = VtEngine::StartPaint();
if (hr != S_OK)
{
// If _noFlushOnEnd was set, and we didn't return early, it would usually
// have been reset in the EndPaint call. But since that's not going to
// happen now, we need to reset it here, otherwise we may mistakenly skip
// the flush on the next frame.
if (!_noFlushOnEnd)
{
_Flush();
}
_noFlushOnEnd = false;
return hr;
}
_trace.TraceLastText(_lastText);
@@ -83,15 +96,6 @@ XtermEngine::XtermEngine(_In_ wil::unique_hfile hPipe,
}
}
if (!_quickReturn)
{
if (_WillWriteSingleChar())
{
// Don't re-enable the cursor.
_quickReturn = true;
}
}
return S_OK;
}
@@ -520,9 +524,10 @@ CATCH_RETURN();
// proper utf-8 string, depending on our mode.
// Arguments:
// - wstr - wstring of text to be written
// - flush - set to true if the string should be flushed immediately
// Return Value:
// - S_OK or suitable HRESULT error from either conversion or writing pipe.
[[nodiscard]] HRESULT XtermEngine::WriteTerminalW(const std::wstring_view wstr) noexcept
[[nodiscard]] HRESULT XtermEngine::WriteTerminalW(const std::wstring_view wstr, const bool flush) noexcept
{
RETURN_IF_FAILED(_fUseAsciiOnly ?
VtEngine::_WriteTerminalAscii(wstr) :
@@ -535,8 +540,11 @@ CATCH_RETURN();
// cause flickering (where we've buffered some state but not the whole
// "frame" as specified by the app). We'll just immediately buffer this
// sequence, and flush it when the render thread comes around to paint the
// frame normally.
// frame normally, unless a flush has been explicitly requested.
if (flush)
{
_flushImpl();
}
return S_OK;
}

View File

@@ -51,7 +51,7 @@ namespace Microsoft::Console::Render
[[nodiscard]] HRESULT InvalidateScroll(const til::point* const pcoordDelta) noexcept override;
[[nodiscard]] HRESULT WriteTerminalW(const std::wstring_view str) noexcept override;
[[nodiscard]] HRESULT WriteTerminalW(const std::wstring_view str, const bool flush) noexcept override;
[[nodiscard]] HRESULT SetWindowVisibility(const bool showOrHide) noexcept override;

View File

@@ -75,7 +75,7 @@ CATCH_RETURN();
}
_skipCursor = false;
_cursorMoved = true;
_cursorMoved = psrRegion->origin() != _lastText;
return S_OK;
}

View File

@@ -52,38 +52,3 @@ void VtEngine::_OrRect(_Inout_ til::inclusive_rect* const pRectExisting, const t
pRectExisting->right = std::max(pRectExisting->right, pRectToOr->right);
pRectExisting->bottom = std::max(pRectExisting->bottom, pRectToOr->bottom);
}
// Method Description:
// - Returns true if the invalidated region indicates that we only need to
// simply print text from the current cursor position. This will prevent us
// from sending extra VT set-up/tear down sequences (?12h/l) when all we
// need to do is print more text at the current cursor position.
// Arguments:
// - <none>
// Return Value:
// - true iff only the next character is invalid
bool VtEngine::_WillWriteSingleChar() const
{
// If there is no scroll delta, return false.
if (til::point{ 0, 0 } != _scrollDelta)
{
return false;
}
// If there is more than one invalid char, return false.
if (!_invalidMap.one())
{
return false;
}
// Get the single point at which things are invalid.
const auto invalidPoint = _invalidMap.runs().front().origin();
// Either the next character to the right or the immediately previous
// character should follow this code path
// (The immediate previous character would suggest a backspace)
auto invalidIsNext = invalidPoint == _lastText;
auto invalidIsLast = invalidPoint == til::point{ _lastText.x - 1, _lastText.y };
return invalidIsNext || invalidIsLast;
}

View File

@@ -20,30 +20,30 @@ using namespace Microsoft::Console::Types;
// HRESULT error code if painting didn't start successfully.
[[nodiscard]] HRESULT VtEngine::StartPaint() noexcept
{
// When unit testing, there may be no pipe, but we still need to paint.
if (!_hFile)
{
return S_FALSE;
return S_OK;
}
// If we're using line renditions, and this is a full screen paint, we can
// potentially stop using them at the end of this frame.
_stopUsingLineRenditions = _usingLineRenditions && _AllIsInvalid();
// If there's nothing to do, quick return
// If there's nothing to do, we won't need to paint.
auto somethingToDo = _invalidMap.any() ||
_scrollDelta != til::point{ 0, 0 } ||
_cursorMoved ||
_titleChanged;
_quickReturn = !somethingToDo;
_trace.TraceStartPaint(_quickReturn,
_trace.TraceStartPaint(!somethingToDo,
_invalidMap,
_lastViewport.ToExclusive(),
_scrollDelta,
_cursorMoved,
_wrappedRow);
return _quickReturn ? S_FALSE : S_OK;
return somethingToDo ? S_OK : S_FALSE;
}
// Routine Description:
@@ -142,9 +142,9 @@ using namespace Microsoft::Console::Types;
_usingLineRenditions = true;
}
// One simple optimization is that we can skip sending the line attributes
// when _quickReturn is true. That indicates that we're writing out a single
// character, which should preclude there being a rendition switch.
if (_usingLineRenditions && !_quickReturn)
// when we're writing out a single character, which should preclude there
// being a rendition switch.
if (_usingLineRenditions && !_invalidMap.one())
{
RETURN_IF_FAILED(_MoveCursor({ _lastText.x, targetRow }));
switch (lineRendition)

View File

@@ -37,7 +37,6 @@ VtEngine::VtEngine(_In_ wil::unique_hfile pipe,
_pool(til::pmr::get_default_resource()),
_invalidMap(initialViewport.Dimensions(), false, &_pool),
_scrollDelta(0, 0),
_quickReturn(false),
_clearedAllThisFrame(false),
_cursorMoved(false),
_resized(false),

View File

@@ -78,7 +78,7 @@ namespace Microsoft::Console::Render
[[nodiscard]] HRESULT RequestCursor() noexcept;
[[nodiscard]] HRESULT InheritCursor(const til::point coordCursor) noexcept;
[[nodiscard]] HRESULT WriteTerminalUtf8(const std::string_view str) noexcept;
[[nodiscard]] virtual HRESULT WriteTerminalW(const std::wstring_view str) noexcept = 0;
[[nodiscard]] virtual HRESULT WriteTerminalW(const std::wstring_view str, const bool flush = false) noexcept = 0;
void SetTerminalOwner(Microsoft::Console::VirtualTerminal::VtIo* const terminalOwner);
void SetResizeQuirk(const bool resizeQuirk);
void SetLookingForDSRCallback(std::function<void(bool)> pfnLooking) noexcept;
@@ -113,7 +113,6 @@ namespace Microsoft::Console::Render
til::point _lastText;
til::point _scrollDelta;
bool _quickReturn;
bool _clearedAllThisFrame;
bool _cursorMoved;
bool _resized;
@@ -214,8 +213,6 @@ namespace Microsoft::Console::Render
[[nodiscard]] HRESULT _RgbUpdateDrawingBrushes(const TextAttribute& textAttributes) noexcept;
[[nodiscard]] HRESULT _16ColorUpdateDrawingBrushes(const TextAttribute& textAttributes) noexcept;
bool _WillWriteSingleChar() const;
// buffer space for these two functions to build their lines
// so they don't have to alloc/free in a tight loop
std::wstring _bufferLine;

View File

@@ -4882,7 +4882,7 @@ ITermDispatch::StringHandler AdaptDispatch::_CreatePassthroughHandler()
{
buffer += L'\\';
}
engine.ActionPassThroughString(buffer);
engine.ActionPassThroughString(buffer, true);
buffer.clear();
}
return !endOfString;

View File

@@ -35,7 +35,7 @@ namespace Microsoft::Console::VirtualTerminal
virtual bool ActionPrint(const wchar_t wch) = 0;
virtual bool ActionPrintString(const std::wstring_view string) = 0;
virtual bool ActionPassThroughString(const std::wstring_view string) = 0;
virtual bool ActionPassThroughString(const std::wstring_view string, const bool flush = false) = 0;
virtual bool ActionEscDispatch(const VTID id) = 0;
virtual bool ActionVt52EscDispatch(const VTID id, const VTParameters parameters) = 0;

View File

@@ -276,9 +276,10 @@ bool InputStateMachineEngine::ActionPrintString(const std::wstring_view string)
// string of characters given.
// Arguments:
// - string - string to dispatch.
// - flush - not applicable to the input state machine.
// Return Value:
// - true iff we successfully dispatched the sequence.
bool InputStateMachineEngine::ActionPassThroughString(const std::wstring_view string)
bool InputStateMachineEngine::ActionPassThroughString(const std::wstring_view string, const bool /*flush*/)
{
if (_pDispatch->IsVtInputEnabled())
{

View File

@@ -142,7 +142,7 @@ namespace Microsoft::Console::VirtualTerminal
bool ActionPrintString(const std::wstring_view string) override;
bool ActionPassThroughString(const std::wstring_view string) override;
bool ActionPassThroughString(const std::wstring_view string, const bool flush) override;
bool ActionEscDispatch(const VTID id) override;

View File

@@ -180,14 +180,15 @@ bool OutputStateMachineEngine::ActionPrintString(const std::wstring_view string)
// we don't know what to do with it)
// Arguments:
// - string - string to dispatch.
// - flush - set to true if the string should be flushed immediately.
// Return Value:
// - true iff we successfully dispatched the sequence.
bool OutputStateMachineEngine::ActionPassThroughString(const std::wstring_view string)
bool OutputStateMachineEngine::ActionPassThroughString(const std::wstring_view string, const bool flush)
{
auto success = true;
if (_pTtyConnection != nullptr)
{
const auto hr = _pTtyConnection->WriteTerminalW(string);
const auto hr = _pTtyConnection->WriteTerminalW(string, flush);
LOG_IF_FAILED(hr);
success = SUCCEEDED(hr);
}

View File

@@ -38,7 +38,7 @@ namespace Microsoft::Console::VirtualTerminal
bool ActionPrintString(const std::wstring_view string) override;
bool ActionPassThroughString(const std::wstring_view string) override;
bool ActionPassThroughString(const std::wstring_view string, const bool flush) override;
bool ActionEscDispatch(const VTID id) override;

View File

@@ -59,7 +59,7 @@ public:
return true;
};
bool ActionPassThroughString(const std::wstring_view string) override
bool ActionPassThroughString(const std::wstring_view string, const bool /*flush*/) override
{
passedThrough += string;
return true;

View File

@@ -22,10 +22,15 @@ try
RETURN_HR_IF_NULL(E_INVALIDARG, pProvider);
RETURN_HR_IF_NULL(E_INVALIDARG, pData);
pData->LockConsole();
const auto unlock = wil::scope_exit([&]() noexcept {
pData->UnlockConsole();
});
_pProvider = pProvider;
_pData = pData;
_start = pData->GetViewport().Origin();
_end = pData->GetViewport().Origin();
_end = _start;
_blockRange = false;
_wordDelimiters = wordDelimiters;
@@ -41,9 +46,16 @@ HRESULT UiaTextRangeBase::RuntimeClassInitialize(_In_ Render::IRenderData* pData
_In_ std::wstring_view wordDelimiters) noexcept
try
{
RETURN_HR_IF_NULL(E_INVALIDARG, pProvider);
RETURN_HR_IF_NULL(E_INVALIDARG, pData);
RETURN_IF_FAILED(RuntimeClassInitialize(pData, pProvider, wordDelimiters));
pData->LockConsole();
const auto unlock = wil::scope_exit([&]() noexcept {
pData->UnlockConsole();
});
_pProvider = pProvider;
_pData = pData;
// GH#8730: The cursor position may be in a delayed state, resulting in it being out of bounds.
// If that's the case, clamp it to be within bounds.
// TODO GH#12440: We should be able to just check some fields off of the Cursor object,
@@ -51,6 +63,8 @@ try
_start = cursor.GetPosition();
pData->GetTextBuffer().GetSize().Clamp(_start);
_end = _start;
_blockRange = false;
_wordDelimiters = wordDelimiters;
UiaTracing::TextRange::Constructor(*this);
return S_OK;
@@ -66,15 +80,15 @@ HRESULT UiaTextRangeBase::RuntimeClassInitialize(_In_ Render::IRenderData* pData
_In_ std::wstring_view wordDelimiters) noexcept
try
{
RETURN_IF_FAILED(RuntimeClassInitialize(pData, pProvider, wordDelimiters));
RETURN_HR_IF_NULL(E_INVALIDARG, pProvider);
RETURN_HR_IF_NULL(E_INVALIDARG, pData);
// start must be before or equal to end
_pProvider = pProvider;
_pData = pData;
_start = std::min(start, end);
_end = std::max(start, end);
// This should be the only way to set if we are a blockRange
// This is used for blockSelection
_blockRange = blockRange;
_wordDelimiters = wordDelimiters;
UiaTracing::TextRange::Constructor(*this);
return S_OK;
@@ -148,9 +162,6 @@ til::point UiaTextRangeBase::GetEndpoint(TextPatternRangeEndpoint endpoint) cons
// - true if range is degenerate, false otherwise.
bool UiaTextRangeBase::SetEndpoint(TextPatternRangeEndpoint endpoint, const til::point val) noexcept
{
// GH#6402: Get the actual buffer size here, instead of the one
// constrained by the virtual bottom.
const auto bufferSize = _pData->GetTextBuffer().GetSize();
switch (endpoint)
{
case TextPatternRangeEndpoint_End:

View File

@@ -89,6 +89,20 @@ $Cards = Get-GithubProjectCard -ColumnId $ToPickColumn.id
& git fetch --all 2>&1 | Out-Null
$Branch = & git rev-parse --abbrev-ref HEAD
$RemoteForCurrentBranch = & git config "branch.$Branch.remote"
$CommitsBehind = [int](& git rev-list --count "$RemoteForCurrentBranch/$Branch" "^$Branch")
If ($LASTEXITCODE -Ne 0) {
Write-Error "Failed to determine branch divergence"
Exit 1
}
If ($CommitsBehind -Gt 0) {
Write-Error "Local branch $Branch is out of date with $RemoteForCurrentBranch; consider git pull"
Exit 1
}
$Entries = @(& git log $SourceBranch --first-parent --grep "(#\($($Cards.Number -Join "\|")\))" "--pretty=format:%H%x1C%s" |
ConvertFrom-CSV -Delimiter "`u{001C}" -Header CommitID,Subject)