Compare commits

..

6 Commits

Author SHA1 Message Date
Dustin L. Howett
40f6f17e07 hbu? 2025-03-31 17:53:44 -05:00
Dustin L. Howett
a052a8033d try some more crap 2025-03-31 17:23:53 -05:00
Dustin L. Howett
2a2b6800c2 I have the sneaking suspicion that the order matters here 2025-03-31 17:16:05 -05:00
Dustin L. Howett
f4440eaa28 FOR DEBUG ONLY 2025-03-31 16:57:09 -05:00
Dustin L. Howett
51ab0fee88 yes I have to get approval for ANOTHER build 2025-03-31 16:53:59 -05:00
Dustin L. Howett
979049bd15 build: pull PowerShell modules from an internal feed... 2025-03-31 15:41:07 -05:00
346 changed files with 2000 additions and 12079 deletions

View File

@@ -2,14 +2,14 @@
# Reference: https://github.com/microsoft/terminal/blob/main/README.md#developer-guidance
properties:
resources:
- resource: Microsoft.Windows.Settings/WindowsSettings
- resource: Microsoft.Windows.Developer/DeveloperMode
directives:
description: Enable Developer Mode
allowPrerelease: true
# Requires elevation for the set operation
securityContext: elevated
settings:
DeveloperMode: true
Ensure: Present
- resource: Microsoft.WinGet.DSC/WinGetPackage
id: powershell
directives:

View File

@@ -2,14 +2,14 @@
# Reference: https://github.com/microsoft/terminal/blob/main/README.md#developer-guidance
properties:
resources:
- resource: Microsoft.Windows.Settings/WindowsSettings
- resource: Microsoft.Windows.Developer/DeveloperMode
directives:
description: Enable Developer Mode
allowPrerelease: true
# Requires elevation for the set operation
securityContext: elevated
settings:
DeveloperMode: true
Ensure: Present
- resource: Microsoft.WinGet.DSC/WinGetPackage
id: powershell
directives:

View File

@@ -2,14 +2,14 @@
# Reference: https://github.com/microsoft/terminal/blob/main/README.md#developer-guidance
properties:
resources:
- resource: Microsoft.Windows.Settings/WindowsSettings
- resource: Microsoft.Windows.Developer/DeveloperMode
directives:
description: Enable Developer Mode
allowPrerelease: true
# Requires elevation for the set operation
securityContext: elevated
settings:
DeveloperMode: true
Ensure: Present
- resource: Microsoft.WinGet.DSC/WinGetPackage
id: powershell
directives:

View File

@@ -11,7 +11,6 @@ colorbrewer
commandlines
consvc
copyable
CText
dalet
dcs
deselection

View File

@@ -144,7 +144,6 @@ NCHITTEST
NCLBUTTONDBLCLK
NCMOUSELEAVE
NCMOUSEMOVE
NCPOINTERUPDATE
NCRBUTTONDBLCLK
NIF
NIN
@@ -223,7 +222,6 @@ Stubless
Subheader
Subpage
syscall
syscolors
SYSTEMBACKDROP
TABROW
TASKBARCREATED
@@ -291,5 +289,4 @@ xtree
xutility
YIcon
YMax
zstring
zwstring

View File

@@ -133,4 +133,3 @@ Resources/(?!en)
^\Qsrc/terminal/parser/ft_fuzzwrapper/run.bat\E$
^\Qsrc/tools/lnkd/lnkd.bat\E$
^\Qsrc/tools/pixels/pixels.bat\E$
^\Qsrc/cascadia/ut_app/FzfTests.cpp\E$

View File

@@ -86,7 +86,6 @@ autoscrolling
Autowrap
AVerify
awch
AZCOPY
azurecr
AZZ
backgrounded
@@ -128,7 +127,6 @@ Blt
blu
BLUESCROLL
bmi
bodgy
BODGY
BOLDFONT
Borland
@@ -372,8 +370,8 @@ Dcd
DColor
dcommon
DComposition
DDDCCC
dde
DDDCCC
DDESHARE
DDevice
DEADCHAR
@@ -651,7 +649,6 @@ FONTSTRING
FONTTYPE
FONTWIDTH
FONTWINDOW
foob
FORCEOFFFEEDBACK
FORCEONFEEDBACK
FRAMECHANGED
@@ -669,11 +666,9 @@ fuzzer
fuzzmain
fuzzmap
fuzzwrapper
fuzzyfinder
fwdecl
fwe
fwlink
fzf
gci
gcx
gdi
@@ -1251,7 +1246,6 @@ onecoreuuid
ONECOREWINDOWS
onehalf
oneseq
oob
openbash
opencode
opencon
@@ -1422,7 +1416,6 @@ propvar
propvariant
propvarutil
psa
PSCRED
PSECURITY
pseudoconsole
pseudoterminal
@@ -1684,7 +1677,6 @@ SMARTQUOTE
SMTO
snapcx
snapcy
snk
SOLIDBOX
Solutiondir
somefile

View File

@@ -8,7 +8,7 @@ where:
configuration:
resourceManagementConfiguration:
scheduledSearches:
- description: '"Needs-Author-Feedback" and "No-Recent-Activity" issues are closed after 3 days of inactivity'
- description:
frequencies:
- hourly:
hour: 3
@@ -23,7 +23,7 @@ configuration:
days: 3
actions:
- closeIssue
- description: '"Needs-Author-Feedback" issues are labelled "No-Recent-Activity" after 4 days of inactivity'
- description:
frequencies:
- hourly:
hour: 3
@@ -41,7 +41,7 @@ configuration:
label: No-Recent-Activity
- addReply:
reply: This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **4 days**. It will be closed if no further activity occurs **within 3 days of this comment**.
- description: '"Resolution-Duplicate" issues are closed after 1 day of inactivity'
- description:
frequencies:
- hourly:
hour: 3
@@ -56,7 +56,7 @@ configuration:
- addReply:
reply: This issue has been marked as duplicate and has not had any activity for **1 day**. It will be closed for housekeeping purposes.
- closeIssue
- description: '"Needs-Author-Feedback" and "No-Recent-Activity" PRs are closed after 7 days of inactivity'
- description:
frequencies:
- hourly:
hour: 3
@@ -71,7 +71,7 @@ configuration:
days: 7
actions:
- closeIssue
- description: Add "No-Recent-Activity" label to PRs with "Needs-Author-Feedback" label after 7 days of inactivity
- description:
frequencies:
- hourly:
hour: 3
@@ -90,8 +90,7 @@ configuration:
- addReply:
reply: This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **7 days**. It will be closed if no further activity occurs **within 7 days of this comment**.
eventResponderTasks:
- description: Add "Needs-Triage" to new issues
if:
- if:
- payloadType: Issues
- or:
- and:
@@ -103,8 +102,8 @@ configuration:
then:
- addLabel:
label: Needs-Triage
- description: Replace "Needs-Author-Feedback" with "Needs-Attention" when author comments
if:
description:
- if:
- payloadType: Issue_Comment
- isAction:
action: Created
@@ -117,8 +116,8 @@ configuration:
label: Needs-Attention
- removeLabel:
label: Needs-Author-Feedback
- description: Remove "No-Recent-Activity" when closing an issue
if:
description:
- if:
- payloadType: Issues
- not:
isAction:
@@ -128,16 +127,16 @@ configuration:
then:
- removeLabel:
label: No-Recent-Activity
- description: Remove "No-Recent-Activity" when someone comments on an issue
if:
description:
- if:
- payloadType: Issue_Comment
- hasLabel:
label: No-Recent-Activity
then:
- removeLabel:
label: No-Recent-Activity
- description: Add "Needs-Author-Feedback" when changes are requested on a PR
if:
description:
- if:
- payloadType: Pull_Request_Review
- isAction:
action: Submitted
@@ -146,8 +145,8 @@ configuration:
then:
- addLabel:
label: Needs-Author-Feedback
- description: Remove "Needs-Author-Feedback" when author performs activity on their PR
if:
description:
- if:
- payloadType: Pull_Request
- isActivitySender:
issueAuthor: True
@@ -159,8 +158,8 @@ configuration:
then:
- removeLabel:
label: Needs-Author-Feedback
- description: Remove "Needs-Author-Feedback" when author comments on their issue
if:
description:
- if:
- payloadType: Issue_Comment
- isActivitySender:
issueAuthor: True
@@ -169,8 +168,8 @@ configuration:
then:
- removeLabel:
label: Needs-Author-Feedback
- description: Remove "Needs-Author-Feedback" when the author reviews the PR
if:
description:
- if:
- payloadType: Pull_Request_Review
- isActivitySender:
issueAuthor: True
@@ -179,8 +178,8 @@ configuration:
then:
- removeLabel:
label: Needs-Author-Feedback
- description: Remove "No-Recent-Activity"" when activity occurs on the PR (aside from closing it)
if:
description:
- if:
- payloadType: Pull_Request
- not:
isAction:
@@ -190,39 +189,39 @@ configuration:
then:
- removeLabel:
label: No-Recent-Activity
- description: Remove "No-Recent-Activity" when someone comments on the PR
if:
description:
- if:
- payloadType: Issue_Comment
- hasLabel:
label: No-Recent-Activity
then:
- removeLabel:
label: No-Recent-Activity
- description: Remove "No-Recent-Activity" when someone reviews the PR
if:
description:
- if:
- payloadType: Pull_Request_Review
- hasLabel:
label: No-Recent-Activity
then:
- removeLabel:
label: No-Recent-Activity
- description: Enable auto-merge on PRs with the "AutoMerge" label
if:
description:
- if:
- payloadType: Pull_Request
- hasLabel:
label: AutoMerge
then:
- enableAutoMerge:
mergeMethod: Squash
- description: Disable auto-merge on PRs when the "AutoMerge" label is removed
if:
description:
- if:
- payloadType: Pull_Request
- labelRemoved:
label: AutoMerge
then:
- disableAutoMerge
- description: Add "Needs-Tag-Fix" label to issues without an Area, Issue, or Product label
if:
description:
- if:
- payloadType: Issues
- or:
- and:
@@ -239,45 +238,15 @@ configuration:
- not:
hasLabel:
label: Area-Accessibility
- not:
hasLabel:
label: Area-AtlasEngine
- not:
hasLabel:
label: Area-AzureShell
- not:
hasLabel:
label: Area-Build
- not:
hasLabel:
label: Area-Chat
- not:
hasLabel:
label: Area-CmdPal
- not:
hasLabel:
label: Area-CodeHealth
- not:
hasLabel:
label: Area-Commandline
- not:
hasLabel:
label: Area-CookedRead
- not:
hasLabel:
label: Area-DefApp
- not:
hasLabel:
label: Area-Extensibility
- not:
hasLabel:
label: Area-Fonts
- not:
hasLabel:
label: Area-GroupPolicy
- not:
hasLabel:
label: Area-i18n
- not:
hasLabel:
label: Area-Input
@@ -287,45 +256,21 @@ configuration:
- not:
hasLabel:
label: Area-Interop
- not:
hasLabel:
label: Area-Localization
- not:
hasLabel:
label: Area-Output
- not:
hasLabel:
label: Area-Performance
- not:
hasLabel:
label: Area-Portable
- not:
hasLabel:
label: Area-Quality
- not:
hasLabel:
label: Area-Remoting
- not:
hasLabel:
label: Area-Rendering
- not:
hasLabel:
label: Area-Schema
- not:
hasLabel:
label: Area-Server
- not:
hasLabel:
label: Area-Settings
- not:
hasLabel:
label: Area-SettingsUI
- not:
hasLabel:
label: Area-ShellExtension
- not:
hasLabel:
label: Area-Suggestions
- not:
hasLabel:
label: Area-TerminalConnection
@@ -334,19 +279,49 @@ configuration:
label: Area-TerminalControl
- not:
hasLabel:
label: Area-Theming
- not:
hasLabel:
label: Area-UserInterface
label: Area-User Interface
- not:
hasLabel:
label: Area-VT
- not:
hasLabel:
label: Area-Windowing
label: Area-CodeHealth
- not:
hasLabel:
label: Area-Quality
- not:
hasLabel:
label: Area-AzureShell
- not:
hasLabel:
label: Area-Schema
- not:
hasLabel:
label: Area-Commandline
- not:
hasLabel:
label: Area-ShellExtension
- not:
hasLabel:
label: Area-WPFControl
- not:
hasLabel:
label: Area-Settings UI
- not:
hasLabel:
label: Area-DefApp
- not:
hasLabel:
label: Area-Remoting
- not:
hasLabel:
label: Area-Windowing
- not:
hasLabel:
label: Area-Theming
- not:
hasLabel:
label: Area-Localization
- and:
- not:
hasLabel:
@@ -433,8 +408,8 @@ configuration:
then:
- addLabel:
label: Needs-Tag-Fix
- description: Remove "Needs-Tag-Fix" label when an issue is tagged with an Area, Issue, and Product label
if:
description:
- if:
- payloadType: Issues
- and:
- isLabeled
@@ -442,117 +417,66 @@ configuration:
label: Needs-Tag-Fix
- and:
- or:
- not:
hasLabel:
label: Area-Accessibility
- not:
hasLabel:
label: Area-AtlasEngine
- not:
hasLabel:
label: Area-AzureShell
- not:
hasLabel:
label: Area-Build
- not:
hasLabel:
label: Area-Chat
- not:
hasLabel:
label: Area-CmdPal
- not:
hasLabel:
label: Area-CodeHealth
- not:
hasLabel:
label: Area-Commandline
- not:
hasLabel:
label: Area-CookedRead
- not:
hasLabel:
label: Area-DefApp
- not:
hasLabel:
label: Area-Extensibility
- not:
hasLabel:
label: Area-Fonts
- not:
hasLabel:
label: Area-GroupPolicy
- not:
hasLabel:
label: Area-i18n
- not:
hasLabel:
label: Area-Input
- not:
hasLabel:
label: Area-Interaction
- not:
hasLabel:
label: Area-Interop
- not:
hasLabel:
label: Area-Localization
- not:
hasLabel:
label: Area-Output
- not:
hasLabel:
label: Area-Performance
- not:
hasLabel:
label: Area-Portable
- not:
hasLabel:
label: Area-Quality
- not:
hasLabel:
label: Area-Remoting
- not:
hasLabel:
label: Area-Rendering
- not:
hasLabel:
label: Area-Schema
- not:
hasLabel:
label: Area-Server
- not:
hasLabel:
label: Area-Settings
- not:
hasLabel:
label: Area-SettingsUI
- not:
hasLabel:
label: Area-ShellExtension
- not:
hasLabel:
label: Area-Suggestions
- not:
hasLabel:
label: Area-TerminalConnection
- not:
hasLabel:
label: Area-TerminalControl
- not:
hasLabel:
label: Area-Theming
- not:
hasLabel:
label: Area-UserInterface
- not:
hasLabel:
label: Area-VT
- not:
hasLabel:
label: Area-Windowing
- not:
hasLabel:
label: Area-WPFControl
- hasLabel:
label: Area-Accessibility
- hasLabel:
label: Area-Build
- hasLabel:
label: Area-Extensibility
- hasLabel:
label: Area-Fonts
- hasLabel:
label: Area-Input
- hasLabel:
label: Area-Interaction
- hasLabel:
label: Area-Interop
- hasLabel:
label: Area-Output
- hasLabel:
label: Area-Performance
- hasLabel:
label: Area-Rendering
- hasLabel:
label: Area-Server
- hasLabel:
label: Area-Settings
- hasLabel:
label: Area-TerminalConnection
- hasLabel:
label: Area-TerminalControl
- hasLabel:
label: Area-User Interface
- hasLabel:
label: Area-VT
- hasLabel:
label: Area-CodeHealth
- hasLabel:
label: Area-Quality
- hasLabel:
label: Area-Schema
- hasLabel:
label: Area-AzureShell
- hasLabel:
label: Area-Commandline
- hasLabel:
label: Area-ShellExtension
- hasLabel:
label: Area-WPFControl
- hasLabel:
label: Area-Settings UI
- hasLabel:
label: Area-DefApp
- hasLabel:
label: Area-Localization
- hasLabel:
label: Area-Windowing
- hasLabel:
label: Area-Theming
- hasLabel:
label: Area-AtlasEngine
- hasLabel:
label: Area-CmdPal
- or:
- hasLabel:
label: Issue-Bug
@@ -609,14 +533,14 @@ configuration:
then:
- removeLabel:
label: Needs-Tag-Fix
- description: Add "In-PR" label to issues that are referenced in a PR
if:
description:
- if:
- payloadType: Pull_Request
then:
- inPrLabel:
label: In-PR
- description: Remove "Needs-Tag-Fix" label when an issue also has the "Resolution-Duplicate" label
if:
description:
- if:
- payloadType: Issues
- hasLabel:
label: Needs-Tag-Fix
@@ -625,8 +549,8 @@ configuration:
then:
- removeLabel:
label: Needs-Tag-Fix
- description: Close issues that are opened and have the template title
if:
description:
- if:
- payloadType: Issues
- or:
- titleContains:
@@ -652,8 +576,8 @@ configuration:
label: Needs-Author-Feedback
- addReply:
reply: Hi! Thanks for attempting to open an issue. Unfortunately, your title wasn't changed from the original template which makes it very hard for us to track and triage. You are welcome to fix up the title and try again with a new issue.
- description: Close issues that are opened and have no body
if:
description:
- if:
- payloadType: Issues
- or:
- isAction:
@@ -671,8 +595,8 @@ configuration:
label: Needs-Author-Feedback
- addReply:
reply: "Hi! Thanks for attempting to open an issue. Unfortunately, you didn't write anything in the body which makes it impossible to understand your concern. You are welcome to fix up the issue and try again by opening another issue with the body filled out. "
- description: Request a review from the team when a PR is labeled "Needs-Second"
if:
description:
- if:
- payloadType: Pull_Request
- isLabeled
- hasLabel:
@@ -689,8 +613,8 @@ configuration:
reviewer: dhowett
- requestReview:
reviewer: lhecker
- description: Remove "Needs-Second" label when a PR is reviewed
if:
description:
- if:
- payloadType: Pull_Request_Review
- not: isOpen
- hasLabel:
@@ -698,8 +622,8 @@ configuration:
then:
- removeLabel:
label: Needs-Second
- description: Remove "Help-Wanted" label from issues that are in a PR
if:
description:
- if:
- payloadType: Issues
- hasLabel:
label: In-PR
@@ -709,8 +633,8 @@ configuration:
then:
- removeLabel:
label: Help-Wanted
- description: Comments with "/dup", "/dupe", or "/duplicate" will close the issue as a duplicate and remove "Needs-" labels
if:
description:
- if:
- payloadType: Issue_Comment
- commentContains:
pattern: '\/dup(licate|e)?(\s+of)?\s+\#[\d]+'
@@ -738,8 +662,8 @@ configuration:
label: Needs-Repro
- removeLabel:
label: Needs-Second
- description: Comments with "/feedback" will direct people to Feedback Hub
if:
description:
- if:
- payloadType: Issue_Comment
- commentContains:
pattern: '\/feedback'
@@ -756,13 +680,13 @@ configuration:
Hi there!<br><br>Can you please send us feedback with the [Feedback Hub](https://support.microsoft.com/en-us/windows/send-feedback-to-microsoft-with-the-feedback-hub-app-f59187f8-8739-22d6-ba93-f66612949332) with this issue? Make sure to click the "Start recording" button, then reproduce the issue before submitting the feedback. Once it's submitted, paste the link here so we can more easily find your crash information on the back end?<br><br>Thanks!<br><br>![image](https://user-images.githubusercontent.com/18356694/140811502-a068f78b-89d2-4587-925a-73e19652b830.png)<br><br>![image](https://user-images.githubusercontent.com/18356694/140811557-cdc22a0f-fa6a-4f6a-953e-73b51f5548a3.png)<br><br>![image](https://user-images.githubusercontent.com/18221333/62478649-6de55400-b760-11e9-806e-5aab7e085a9f.png)
- addLabel:
label: Needs-Author-Feedback
- description: Comments clean the email reply
if:
description:
- if:
- payloadType: Issue_Comment
then:
- cleanEmailReply
- description: Sync labels when a PR event occurs
if:
description:
- if:
- payloadType: Pull_Request
then:
- labelSync:
@@ -777,8 +701,8 @@ configuration:
pattern: Severity-
- labelSync:
pattern: Impact-
- description: Comments with "/dup", "/dupe", or "/duplicate" targeting another repo will close the issue as a duplicate and remove "Needs-" labels
if:
description:
- if:
- payloadType: Issue_Comment
- commentContains:
pattern: '\/dup(licate|e)?(\s+of)?\s+https'
@@ -806,8 +730,8 @@ configuration:
label: Needs-Repro
- removeLabel:
label: Needs-Second
- description: Comments with "/?" will replace the "Needs-Attention" label with "Needs-Author-Feedback"
if:
description:
- if:
- payloadType: Issue_Comment
- commentContains:
pattern: /?
@@ -822,5 +746,6 @@ configuration:
label: Needs-Attention
- addLabel:
label: Needs-Author-Feedback
description:
onFailure:
onSuccess:

View File

@@ -285,8 +285,6 @@ specific language governing permissions and limitations under the License.
**Source**: [https://github.com/commonmark/cmark](https://github.com/commonmark/cmark)
### License
```
Copyright (c) 2014, John MacFarlane
All rights reserved.
@@ -457,36 +455,6 @@ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
```
## fzf
### License
```
The MIT License (MIT)
Copyright (c) 2013-2024 Junegunn Choi
Copyright (c) 2021-2025 Simon Hauser
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
```
# Microsoft Open Source

View File

@@ -6,20 +6,6 @@
],
"SigningInfo": {
"Operations": [
{
"KeyCode": "CP-233904-SN",
"OperationSetCode": "StrongNameSign",
"ToolName": "sign",
"ToolVersion": "1.0",
"Parameters": []
},
{
"KeyCode": "CP-233904-SN",
"OperationSetCode": "StrongNameVerify",
"ToolName": "sign",
"ToolVersion": "1.0",
"Parameters": []
},
{
"KeyCode": "CP-230012",
"OperationSetCode": "SigntoolSign",

View File

@@ -1,6 +1,6 @@
{
"instanceUrl": "https://microsoft.visualstudio.com",
"projectName": "OS",
"areaPath": "OS\\Windows Client and Services\\WinPD\\DFX-Developer Fundamentals and Experiences\\DEFT\\SHINE\\Terminal",
"areaPath": "OS\\Windows Client and Services\\WinPD\\DEEP-Developer Experience, Ecosystem and Partnerships\\SHINE\\Terminal",
"notificationAliases": ["condev@microsoft.com", "duhowett@microsoft.com"]
}

View File

@@ -47,7 +47,7 @@ steps:
git config --local core.autocrlf true
displayName: Prepare git submission environment
- task: MicrosoftTDBuild.tdbuild-task.tdbuild-task.TouchdownBuildTask@5
- task: MicrosoftTDBuild.tdbuild-task.tdbuild-task.TouchdownBuildTask@3
displayName: 'Touchdown Build - 7105, PRODEXT'
inputs:
teamId: 7105

View File

@@ -25,7 +25,7 @@ variables:
extends:
template: templates-v2/pipeline-onebranch-full-release-build.yml
parameters:
official: true
official: false
branding: Canary
buildTerminal: true
pgoBuildMode: None # BODGY - OneBranch is on VS 17.10, which is known to be the worst
@@ -44,6 +44,7 @@ extends:
symbolExpiryTime: 15
symbolPublishingSubscription: $(SymbolPublishingServiceConnection)
symbolPublishingProject: $(SymbolPublishingProject)
buildPlatforms: [x64]
${{ if eq(true, parameters.publishToAzure) }}:
extraPublishJobs:
- template: build/pipelines/templates-v2/job-deploy-to-azure-storage.yml@self

View File

@@ -115,6 +115,10 @@ jobs:
clean: true
submodules: true
persistCredentials: True
- template: steps-install-powershell-modules.yml
parameters:
modules: [Az.Accounts, Az.Storage, Az.Network, Az.Resources, Az.Compute]
# This generates either nothing for BuildTargetParameter, or /t:X;Y;Z, to control targets later.
- pwsh: |-

View File

@@ -75,13 +75,17 @@ jobs:
}
displayName: "Wrangle Unpackaged builds into place, rename"
- task: AzurePowerShell@5
- template: steps-install-powershell-modules.yml
parameters:
modules: [Az.Accounts, Az.Storage, Az.Network, Az.Resources, Az.Compute]
- task: AzureFileCopy@6
displayName: Publish to Storage Account
inputs:
sourcePath: _out/*
Destination: AzureBlob
azureSubscription: ${{ parameters.subscription }}
azurePowerShellVersion: LatestVersion
pwsh: true
ScriptType: InlineScript
Inline: |-
$Env:AZCOPY_AUTO_LOGIN_TYPE="PSCRED"
& AzCopy copy "_out\*" "https://${{ parameters.storageAccount }}.blob.core.windows.net/${{ parameters.storageContainer }}/" --content-type application/octet-stream
storage: ${{ parameters.storageAccount }}
ContainerName: ${{ parameters.storageContainer }}
AdditionalArgumentsForBlobCopy: "--content-type application/octet-stream"

View File

@@ -147,10 +147,6 @@ jobs:
ValidateSignature: true
Verbosity: 'Verbose'
- pwsh: |-
tar -c -v --format=zip -f "$(JobOutputDirectory)/GroupPolicyTemplates_$(XES_APPXMANIFESTVERSION).zip" -C "$(Build.SourcesDirectory)/policies" *
displayName: Package GPO Templates
- ${{ parameters.afterBuildSteps }}
- ${{ if eq(parameters.publishArtifacts, true) }}:

View File

@@ -52,6 +52,10 @@ jobs:
itemPattern: '**/*.pdb'
targetPath: '$(Build.SourcesDirectory)/bin'
- template: steps-install-powershell-modules.yml
parameters:
modules: [Az.Accounts, Az.Storage, Az.Network, Az.Resources, Az.Compute]
# Transit the Azure token from the Service Connection into a secret variable for the rest of the pipeline to use.
- task: AzurePowerShell@5
displayName: Generate an Azure Token

View File

@@ -78,9 +78,7 @@ extends:
template: v2/Microsoft.NonOfficial.yml@templates
parameters:
featureFlags:
WindowsHostVersion:
Version: 2022
Network: R1
WindowsHostVersion: 1ESWindows2022
platform:
name: 'windows_undocked'
product: 'Windows Terminal'

View File

@@ -1,12 +1,5 @@
steps:
- ${{ if eq(variables['System.CollectionId'], 'cb55739e-4afe-46a3-970f-1b49d8ee7564') }}:
- pwsh: |-
Write-Host "Assuming NuGet is already installed..."
& nuget.exe help
displayName: Assume NuGet is fine
- ${{ else }}:
- task: NuGetToolInstaller@1
displayName: Use NuGet 6.6.1
inputs:
versionSpec: 6.6.1
- task: NuGetToolInstaller@1
displayName: Use NuGet 6.6.1
inputs:
versionSpec: 6.6.1

View File

@@ -0,0 +1,15 @@
parameters:
- name: modules
type: object
default: []
steps:
- pwsh: |-
Register-PSResourceRepository -Name TerminalDependencies -Uri https://pkgs.dev.azure.com/shine-oss/terminal/_packaging/TerminalDependencies/nuget/v2 -Trusted -ErrorAction:Ignore
Install-PSResource -Repository TerminalDependencies -Name ${{ join(',',parameters.modules) }} -Debug -Verbose -Confirm:$false -AcceptLicense -TrustRepository -Reinstall
displayName: Install Modules for PowerShell 7+
- powershell: |-
Register-PSResourceRepository -Name TerminalDependencies -Uri https://pkgs.dev.azure.com/shine-oss/terminal/_packaging/TerminalDependencies/nuget/v2 -Trusted -ErrorAction:Ignore
Install-PSResource -Repository TerminalDependencies -Name ${{ join(',',parameters.modules) }} -Debug -Verbose -Confirm:$false -AcceptLicense -TrustRepository -Reinstall
displayName: Install Modules for PowerShell 5.1

View File

@@ -1,28 +1,8 @@
$VSInstances = ([xml](& 'C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe' -latest -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -include packages -format xml))
$VSPackages = $VSInstances.instances.instance.packages.package
$LatestVCPackage = ($VSPackages | ? { $_.id -eq "Microsoft.VisualCpp.Tools.Core" })
$LatestVCPackage = ($VSInstances.instances.instance.packages.package | ? { $_.id -eq "Microsoft.VisualCpp.Tools.Core" })
$LatestVCToolsVersion = $LatestVCPackage.version;
$VSRoot = (& 'C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe' -latest -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property 'resolvedInstallationPath')
$VCToolsRoot = Join-Path $VSRoot "VC\Tools\MSVC"
# We have observed a few instances where the VC tools package version actually
# differs from the version on the files themselves. We might as well check
# whether the version we just found _actually exists_ before we use it.
# We'll use whichever highest version exists.
$PackageVCToolPath = Join-Path $VCToolsRoot $LatestVCToolsVersion
If ($Null -Eq (Get-Item $PackageVCToolPath -ErrorAction:Ignore)) {
$VCToolsVersions = Get-ChildItem $VCToolsRoot | ForEach-Object {
[Version]$_.Name
} | Sort -Descending
$LatestActualVCToolsVersion = $VCToolsVersions | Select -First 1
If ([Version]$LatestVCToolsVersion -Ne $LatestActualVCToolsVersion) {
Write-Output "VC Tools Mismatch: Directory = $LatestActualVCToolsVersion, Package = $LatestVCToolsVersion"
$LatestVCToolsVersion = $LatestActualVCToolsVersion.ToString(3)
}
}
Write-Output "Latest VCToolsVersion: $LatestVCToolsVersion"
Write-Output "Updating VCToolsVersion environment variable for job"
Write-Output "##vso[task.setvariable variable=VCToolsVersion]$LatestVCToolsVersion"

View File

@@ -1,6 +0,0 @@
set(VCPKG_TARGET_ARCHITECTURE arm64)
set(VCPKG_CRT_LINKAGE static)
set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_CXX_FLAGS /fsanitize=address)
set(VCPKG_C_FLAGS /fsanitize=address)

View File

@@ -1,6 +0,0 @@
set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE static)
set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_CXX_FLAGS /fsanitize=address)
set(VCPKG_C_FLAGS /fsanitize=address)

View File

@@ -1,6 +0,0 @@
set(VCPKG_TARGET_ARCHITECTURE x86)
set(VCPKG_CRT_LINKAGE static)
set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_CXX_FLAGS /fsanitize=address)
set(VCPKG_C_FLAGS /fsanitize=address)

View File

@@ -3114,13 +3114,12 @@
},
"pathTranslationStyle": {
"default": "none",
"description": "Controls how file paths are transformed when they are dragged and dropped on the terminal. Possible values are \"none\", \"wsl\", \"cygwin\", \"msys2\" and \"mingw\".",
"description": "Controls how file paths are transformed when they are dragged and dropped on the terminal. Possible values are \"none\", \"wsl\", \"cygwin\" and \"msys2\".",
"enum": [
"none",
"wsl",
"cygwin",
"msys2",
"mingw"
"msys2"
],
"type": "string"
}

View File

@@ -9,7 +9,6 @@
<supportedOn>
<definitions>
<definition name="SUPPORTED_WindowsTerminal_1_21" displayName="$(string.SUPPORTED_WindowsTerminal_1_21)" />
<definition name="SUPPORTED_DefaultTerminalApplication" displayName="$(string.SUPPORTED_DefaultTerminalApplication)" />
</definitions>
</supportedOn>
<categories>
@@ -25,61 +24,5 @@
<multiText id="DisabledProfileSources" valueName="DisabledProfileSources" required="true" />
</elements>
</policy>
<policy name="DefaultTerminalApplication" class="User" displayName="$(string.DefaultTerminalApplication)" explainText="$(string.DefaultTerminalApplicationText)" presentation="$(presentation.TermAppSelection)" key="Console\%%Startup">
<parentCategory ref="WindowsTerminal" />
<supportedOn ref="SUPPORTED_DefaultTerminalApplication" />
<elements>
<enum id="TermAppSelect" required="true" valueName="DelegationTerminal">
<item displayName="$(string.TermAppAutomatic)">
<value>
<string>{00000000-0000-0000-0000-000000000000}</string>
</value>
<valueList>
<item key="Console\%%Startup" valueName="DelegationConsole">
<value>
<string>{00000000-0000-0000-0000-000000000000}</string>
</value>
</item>
</valueList>
</item>
<item displayName="$(string.TermAppConsoleHost)">
<value>
<string>{B23D10C0-E52E-411E-9D5B-C09FDF709C7D}</string>
</value>
<valueList>
<item key="Console\%%Startup" valueName="DelegationConsole">
<value>
<string>{B23D10C0-E52E-411E-9D5B-C09FDF709C7D}</string>
</value>
</item>
</valueList>
</item>
<item displayName="$(string.TermAppWindowsTerminal)">
<value>
<string>{E12CFF52-A866-4C77-9A90-F570A7AA2C6B}</string>
</value>
<valueList>
<item key="Console\%%Startup" valueName="DelegationConsole">
<value>
<string>{2EACA947-7F5F-4CFA-BA87-8F7FBEEFBE69}</string>
</value>
</item>
</valueList>
</item>
<item displayName="$(string.TermAppWindowsTerminalPreview)">
<value>
<string>{86633F1F-6454-40EC-89CE-DA4EBA977EE2}</string>
</value>
<valueList>
<item key="Console\%%Startup" valueName="DelegationConsole">
<value>
<string>{06EC847C-C0A5-46B8-92CB-7C92F6E35CD5}</string>
</value>
</item>
</valueList>
</item>
</enum>
</elements>
</policy>
</policies>
</policyDefinitions>

View File

@@ -7,7 +7,6 @@
<stringTable>
<string id="WindowsTerminal">Windows Terminal</string>
<string id="SUPPORTED_WindowsTerminal_1_21">At least Windows Terminal 1.21</string>
<string id="SUPPORTED_DefaultTerminalApplication">At least Windows 11 22H2 or Windows 10 22H2 (Build 19045.3031, KB5026435) with Windows Terminal 1.17</string>
<string id="DisabledProfileSources">Disabled Profile Sources</string>
<string id="DisabledProfileSourcesText">Profiles will not be generated from any sources listed here. Source names can be arbitrary strings. Potential candidates can be found as the "source" property on profile definitions in Windows Terminal's settings.json file.
@@ -19,22 +18,11 @@ Common sources are:
For instance, setting this policy to Windows.Terminal.Wsl will disable the builtin WSL integration of Windows Terminal.
Note: Existing profiles will disappear from Windows Terminal after adding their source to this policy.</string>
<string id="DefaultTerminalApplication">Default terminal application</string>
<string id="DefaultTerminalApplicationText">Select the default terminal application used in Windows.
If you select Windows Terminal Preview and it is not installed the system will fallback to the legacy Windows Console Host. (Please note that the settings interfaces showing "Let windows decide" in this case as configuration.)</string>
<string id="TermAppAutomatic">Automatic selection (Windows Terminal, if available)</string>
<string id="TermAppConsoleHost">Windows Console Host (legacy)</string>
<string id="TermAppWindowsTerminal">Windows Terminal</string>
<string id="TermAppWindowsTerminalPreview">Windows Terminal Preview (if available)</string>
</stringTable>
<presentationTable>
<presentation id="DisabledProfileSources">
<multiTextBox refId="DisabledProfileSources">List of disabled sources (one per line)</multiTextBox>
</presentation>
<presentation id="TermAppSelection">
<dropdownList refId="TermAppSelect" noSort="true" defaultItem="0">Select from the following options:</dropdownList>
</presentation>
</presentationTable>
</resources>
</policyDefinitionResources>

View File

@@ -1,3 +1,3 @@
BUILD_PASS1_CONSUMES= \
onecore\windows\core\console\vcpkg|PASS1 \
onecore\windows\vcpkg|PASS1 \

View File

@@ -186,20 +186,18 @@ bool ImageSlice::_copyCells(const ImageSlice& srcSlice, const til::CoordType src
}
// The used destination before and after the written area must be erased.
// If this results in the entire range being erased, we return true to let
// the caller know that the slice should be deleted.
if (dstUsedBegin < dstWriteBegin && _eraseCells(dstUsedBegin, dstWriteBegin))
if (dstUsedBegin < dstWriteBegin)
{
return true;
_eraseCells(dstUsedBegin, dstWriteBegin);
}
if (dstUsedEnd > dstWriteEnd && _eraseCells(dstWriteEnd, dstUsedEnd))
if (dstUsedEnd > dstWriteEnd)
{
return true;
_eraseCells(dstWriteEnd, dstUsedEnd);
}
// At this point, if the beginning column is not less than the end, that
// means this was an empty slice into which nothing was copied, so we can
// again return true to let the caller know it should be deleted.
// If the beginning column is now not less than the end, that means the
// content has been entirely erased, so we return true to let the caller
// know that the slice should be deleted.
return _columnBegin >= _columnEnd;
}
@@ -212,19 +210,10 @@ void ImageSlice::EraseBlock(TextBuffer& buffer, const til::rect rect)
}
}
void ImageSlice::EraseCells(TextBuffer& buffer, const til::point at, const til::CoordType distance)
void ImageSlice::EraseCells(TextBuffer& buffer, const til::point at, const size_t distance)
{
auto x = at.x;
auto y = at.y;
auto distanceRemaining = distance;
while (distanceRemaining > 0)
{
auto& row = buffer.GetMutableRowByOffset(y);
EraseCells(row, x, x + distanceRemaining);
distanceRemaining -= (static_cast<til::CoordType>(row.size()) - x);
x = 0;
y++;
}
auto& row = buffer.GetMutableRowByOffset(at.y);
EraseCells(row, at.x, gsl::narrow_cast<til::CoordType>(at.x + distance));
}
void ImageSlice::EraseCells(ROW& row, const til::CoordType columnBegin, const til::CoordType columnEnd)

View File

@@ -41,7 +41,7 @@ public:
static void CopyRow(const ROW& srcRow, ROW& dstRow);
static void CopyCells(const ROW& srcRow, const til::CoordType srcColumn, ROW& dstRow, const til::CoordType dstColumnBegin, const til::CoordType dstColumnEnd);
static void EraseBlock(TextBuffer& buffer, const til::rect rect);
static void EraseCells(TextBuffer& buffer, const til::point at, const til::CoordType distance);
static void EraseCells(TextBuffer& buffer, const til::point at, const size_t distance);
static void EraseCells(ROW& row, const til::CoordType columnBegin, const til::CoordType columnEnd);
private:

View File

@@ -232,11 +232,6 @@ void TextAttribute::SetRightVerticalDisplayed(const bool isDisplayed) noexcept
WI_UpdateFlag(_attrs, CharacterAttributes::RightGridline, isDisplayed);
}
bool TextAttribute::IsBold(const bool intenseIsBold) const noexcept
{
return IsIntense() && (intenseIsBold || !_foreground.CanBeBrightened());
}
bool TextAttribute::IsIntense() const noexcept
{
return WI_IsFlagSet(_attrs, CharacterAttributes::Intense);

View File

@@ -115,7 +115,6 @@ public:
return memcmp(this, &other, sizeof(TextAttribute)) != 0;
}
bool IsBold(const bool intenseIsBold) const noexcept;
bool IsLegacy() const noexcept;
bool IsIntense() const noexcept;
bool IsFaint() const noexcept;

View File

@@ -400,6 +400,17 @@ Microsoft::Console::ICU::unique_utext Microsoft::Console::ICU::UTextFromTextBuff
return ut;
}
Microsoft::Console::ICU::unique_uregex Microsoft::Console::ICU::CreateRegex(const std::wstring_view& pattern, uint32_t flags, UErrorCode* status) noexcept
{
#pragma warning(suppress : 26490) // Don't use reinterpret_cast (type.1).
const auto re = uregex_open(reinterpret_cast<const char16_t*>(pattern.data()), gsl::narrow_cast<int32_t>(pattern.size()), flags, nullptr, status);
// ICU describes the time unit as being dependent on CPU performance and "typically [in] the order of milliseconds",
// but this claim seems highly outdated already. On my CPU from 2021, a limit of 4096 equals roughly 600ms.
uregex_setTimeLimit(re, 4096, status);
uregex_setStackLimit(re, 4 * 1024 * 1024, status);
return unique_uregex{ re };
}
// Returns a half-open [beg,end) range given a text start and end position.
// This function is designed to be used with uregex_start64/uregex_end64.
til::point_span Microsoft::Console::ICU::BufferRangeFromMatch(UText* ut, URegularExpression* re)

View File

@@ -9,8 +9,10 @@ class TextBuffer;
namespace Microsoft::Console::ICU
{
using unique_uregex = wistd::unique_ptr<URegularExpression, wil::function_deleter<decltype(&uregex_close), &uregex_close>>;
using unique_utext = wil::unique_struct<UText, decltype(&utext_close), &utext_close>;
unique_utext UTextFromTextBuffer(const TextBuffer& textBuffer, til::CoordType rowBeg, til::CoordType rowEnd) noexcept;
unique_uregex CreateRegex(const std::wstring_view& pattern, uint32_t flags, UErrorCode* status) noexcept;
til::point_span BufferRangeFromMatch(UText* ut, URegularExpression* re);
}

View File

@@ -1,3 +1,3 @@
BUILD_PASS1_CONSUMES= \
onecore\windows\core\console\vcpkg|PASS1 \
onecore\windows\vcpkg|PASS1 \

View File

@@ -10,7 +10,6 @@
#include "../../types/inc/CodepointWidthDetector.hpp"
#include "../renderer/base/renderer.hpp"
#include "../types/inc/utils.hpp"
#include <til/regex.h>
#include "search.h"
// BODGY: Misdiagnosis in MSVC 17.11: Referencing global constants in the member
@@ -2062,6 +2061,14 @@ void TextBuffer::_ExpandTextRow(til::inclusive_rect& textRow) const
}
}
size_t TextBuffer::SpanLength(const til::point coordStart, const til::point coordEnd) const
{
const auto bufferSize = GetSize();
// The coords are inclusive, so to get the (inclusive) length we add 1.
const auto length = bufferSize.CompareInBounds(coordEnd, coordStart) + 1;
return gsl::narrow<size_t>(length);
}
// Routine Description:
// - Retrieves the plain text data between the specified coordinates.
// Arguments:
@@ -2279,7 +2286,7 @@ std::string TextBuffer::GenHTML(const CopyRequest& req,
fmt::format_to(std::back_inserter(htmlBuilder), FMT_COMPILE("color:{};"), fgHex);
fmt::format_to(std::back_inserter(htmlBuilder), FMT_COMPILE("background-color:{};"), bgHex);
if (attr.IsBold(isIntenseBold))
if (isIntenseBold && attr.IsIntense())
{
htmlBuilder += "font-weight:bold;";
}
@@ -2529,7 +2536,7 @@ std::string TextBuffer::GenRTF(const CopyRequest& req,
fmt::format_to(std::back_inserter(contentBuilder), FMT_COMPILE("\\cf{}"), fgIdx);
fmt::format_to(std::back_inserter(contentBuilder), FMT_COMPILE("\\chshdng0\\chcbpat{}"), bgIdx);
if (attr.IsBold(isIntenseBold))
if (isIntenseBold && attr.IsIntense())
{
contentBuilder += "\\b";
}
@@ -3354,7 +3361,7 @@ std::optional<std::vector<til::point_span>> TextBuffer::SearchText(const std::ws
}
UErrorCode status = U_ZERO_ERROR;
const auto re = til::ICU::CreateRegex(needle, icuFlags, &status);
const auto re = ICU::CreateRegex(needle, icuFlags, &status);
if (status > U_ZERO_ERROR)
{
return std::nullopt;

View File

@@ -199,6 +199,8 @@ public:
std::wstring GetCustomIdFromId(uint16_t id) const;
void CopyHyperlinkMaps(const TextBuffer& OtherBuffer);
size_t SpanLength(const til::point coordStart, const til::point coordEnd) const;
std::wstring GetPlainText(til::point start, til::point end) const;
struct CopyRequest

View File

@@ -1,3 +1,3 @@
BUILD_PASS1_CONSUMES= \
onecore\windows\core\console\vcpkg|PASS1 \
onecore\windows\vcpkg|PASS1 \

Binary file not shown.

Before

Width:  |  Height:  |  Size: 943 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 647 B

View File

@@ -21,11 +21,6 @@
<DeploymentContent>true</DeploymentContent>
<Link>ProfileIcons\%(RecursiveDir)%(FileName)%(Extension)</Link>
</Content>
<!-- Profile Generator Icons -->
<Content Include="$(OpenConsoleDir)src\cascadia\CascadiaPackage\ProfileGeneratorIcons\**\*">
<DeploymentContent>true</DeploymentContent>
<Link>ProfileGeneratorIcons\%(RecursiveDir)%(FileName)%(Extension)</Link>
</Content>
<!-- Default Settings -->
<Content Include="$(OpenConsoleDir)src\cascadia\TerminalSettingsModel\defaults.json">
<DeploymentContent>true</DeploymentContent>

View File

@@ -32,35 +32,37 @@ namespace TerminalAppLocalTests
{
auto result = RunOnUIThread([]() {
const auto paletteItem{ winrt::make<winrt::TerminalApp::implementation::CommandLinePaletteItem>(L"AAAAAABBBBBBCCC") };
const auto filteredCommand = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem);
{
Log::Comment(L"Testing command name segmentation with no filter");
auto segments = filteredCommand->HighlightedName().Segments();
const auto filteredCommand = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem);
auto segments = filteredCommand->_computeHighlightedName().Segments();
VERIFY_ARE_EQUAL(segments.Size(), 1u);
VERIFY_ARE_EQUAL(segments.GetAt(0).TextSegment(), L"AAAAAABBBBBBCCC");
VERIFY_IS_FALSE(segments.GetAt(0).IsHighlighted());
}
{
Log::Comment(L"Testing command name segmentation with empty filter");
filteredCommand->UpdateFilter(std::make_shared<fzf::matcher::Pattern>(fzf::matcher::ParsePattern(L"")));
auto segments = filteredCommand->HighlightedName().Segments();
const auto filteredCommand = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem);
filteredCommand->_Filter = L"";
auto segments = filteredCommand->_computeHighlightedName().Segments();
VERIFY_ARE_EQUAL(segments.Size(), 1u);
VERIFY_ARE_EQUAL(segments.GetAt(0).TextSegment(), L"AAAAAABBBBBBCCC");
VERIFY_IS_FALSE(segments.GetAt(0).IsHighlighted());
}
{
Log::Comment(L"Testing command name segmentation with filter equal to the string");
filteredCommand->UpdateFilter(std::make_shared<fzf::matcher::Pattern>(fzf::matcher::ParsePattern(L"AAAAAABBBBBBCCC")));
auto segments = filteredCommand->HighlightedName().Segments();
const auto filteredCommand = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem);
filteredCommand->_Filter = L"AAAAAABBBBBBCCC";
auto segments = filteredCommand->_computeHighlightedName().Segments();
VERIFY_ARE_EQUAL(segments.Size(), 1u);
VERIFY_ARE_EQUAL(segments.GetAt(0).TextSegment(), L"AAAAAABBBBBBCCC");
VERIFY_IS_TRUE(segments.GetAt(0).IsHighlighted());
}
{
Log::Comment(L"Testing command name segmentation with filter with first character matching");
filteredCommand->UpdateFilter(std::make_shared<fzf::matcher::Pattern>(fzf::matcher::ParsePattern(L"A")));
auto segments = filteredCommand->HighlightedName().Segments();
const auto filteredCommand = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem);
filteredCommand->_Filter = L"A";
auto segments = filteredCommand->_computeHighlightedName().Segments();
VERIFY_ARE_EQUAL(segments.Size(), 2u);
VERIFY_ARE_EQUAL(segments.GetAt(0).TextSegment(), L"A");
VERIFY_IS_TRUE(segments.GetAt(0).IsHighlighted());
@@ -69,8 +71,9 @@ namespace TerminalAppLocalTests
}
{
Log::Comment(L"Testing command name segmentation with filter with other case");
filteredCommand->UpdateFilter(std::make_shared<fzf::matcher::Pattern>(fzf::matcher::ParsePattern(L"a")));
auto segments = filteredCommand->HighlightedName().Segments();
const auto filteredCommand = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem);
filteredCommand->_Filter = L"a";
auto segments = filteredCommand->_computeHighlightedName().Segments();
VERIFY_ARE_EQUAL(segments.Size(), 2u);
VERIFY_ARE_EQUAL(segments.GetAt(0).TextSegment(), L"A");
VERIFY_IS_TRUE(segments.GetAt(0).IsHighlighted());
@@ -79,20 +82,24 @@ namespace TerminalAppLocalTests
}
{
Log::Comment(L"Testing command name segmentation with filter matching several characters");
filteredCommand->UpdateFilter(std::make_shared<fzf::matcher::Pattern>(fzf::matcher::ParsePattern(L"ab")));
auto segments = filteredCommand->HighlightedName().Segments();
VERIFY_ARE_EQUAL(segments.Size(), 3u);
VERIFY_ARE_EQUAL(segments.GetAt(0).TextSegment(), L"AAAAA");
VERIFY_IS_FALSE(segments.GetAt(0).IsHighlighted());
VERIFY_ARE_EQUAL(segments.GetAt(1).TextSegment(), L"AB");
VERIFY_IS_TRUE(segments.GetAt(1).IsHighlighted());
VERIFY_ARE_EQUAL(segments.GetAt(2).TextSegment(), L"BBBBBCCC");
VERIFY_IS_FALSE(segments.GetAt(2).IsHighlighted());
const auto filteredCommand = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem);
filteredCommand->_Filter = L"ab";
auto segments = filteredCommand->_computeHighlightedName().Segments();
VERIFY_ARE_EQUAL(segments.Size(), 4u);
VERIFY_ARE_EQUAL(segments.GetAt(0).TextSegment(), L"A");
VERIFY_IS_TRUE(segments.GetAt(0).IsHighlighted());
VERIFY_ARE_EQUAL(segments.GetAt(1).TextSegment(), L"AAAAA");
VERIFY_IS_FALSE(segments.GetAt(1).IsHighlighted());
VERIFY_ARE_EQUAL(segments.GetAt(2).TextSegment(), L"B");
VERIFY_IS_TRUE(segments.GetAt(2).IsHighlighted());
VERIFY_ARE_EQUAL(segments.GetAt(3).TextSegment(), L"BBBBBCCC");
VERIFY_IS_FALSE(segments.GetAt(3).IsHighlighted());
}
{
Log::Comment(L"Testing command name segmentation with non matching filter");
filteredCommand->UpdateFilter(std::make_shared<fzf::matcher::Pattern>(fzf::matcher::ParsePattern(L"abcd")));
auto segments = filteredCommand->HighlightedName().Segments();
const auto filteredCommand = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem);
filteredCommand->_Filter = L"abcd";
auto segments = filteredCommand->_computeHighlightedName().Segments();
VERIFY_ARE_EQUAL(segments.Size(), 1u);
VERIFY_ARE_EQUAL(segments.GetAt(0).TextSegment(), L"AAAAAABBBBBBCCC");
VERIFY_IS_FALSE(segments.GetAt(0).IsHighlighted());
@@ -106,37 +113,53 @@ namespace TerminalAppLocalTests
{
auto result = RunOnUIThread([]() {
const auto paletteItem{ winrt::make<winrt::TerminalApp::implementation::CommandLinePaletteItem>(L"AAAAAABBBBBBCCC") };
const auto filteredCommand = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem);
const auto weigh = [&](const wchar_t* str) {
std::shared_ptr<fzf::matcher::Pattern> pattern;
if (str)
{
pattern = std::make_shared<fzf::matcher::Pattern>(fzf::matcher::ParsePattern(str));
}
filteredCommand->UpdateFilter(std::move(pattern));
return filteredCommand->Weight();
};
const auto null = weigh(nullptr);
const auto empty = weigh(L"");
const auto full = weigh(L"AAAAAABBBBBBCCC");
const auto firstChar = weigh(L"A");
const auto otherCase = weigh(L"a");
const auto severalChars = weigh(L"ab");
VERIFY_ARE_EQUAL(null, 0);
VERIFY_ARE_EQUAL(empty, 0);
VERIFY_IS_GREATER_THAN(full, 100);
VERIFY_IS_GREATER_THAN(firstChar, 0);
VERIFY_IS_LESS_THAN(firstChar, full);
VERIFY_IS_GREATER_THAN(otherCase, 0);
VERIFY_IS_LESS_THAN(otherCase, full);
VERIFY_IS_GREATER_THAN(severalChars, otherCase);
VERIFY_IS_LESS_THAN(severalChars, full);
{
Log::Comment(L"Testing weight of command with no filter");
const auto filteredCommand = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem);
filteredCommand->_HighlightedName = filteredCommand->_computeHighlightedName();
auto weight = filteredCommand->_computeWeight();
VERIFY_ARE_EQUAL(weight, 0);
}
{
Log::Comment(L"Testing weight of command with empty filter");
const auto filteredCommand = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem);
filteredCommand->_Filter = L"";
filteredCommand->_HighlightedName = filteredCommand->_computeHighlightedName();
auto weight = filteredCommand->_computeWeight();
VERIFY_ARE_EQUAL(weight, 0);
}
{
Log::Comment(L"Testing weight of command with filter equal to the string");
const auto filteredCommand = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem);
filteredCommand->_Filter = L"AAAAAABBBBBBCCC";
filteredCommand->_HighlightedName = filteredCommand->_computeHighlightedName();
auto weight = filteredCommand->_computeWeight();
VERIFY_ARE_EQUAL(weight, 30); // 1 point for the first char and 2 points for the 14 consequent ones + 1 point for the beginning of the word
}
{
Log::Comment(L"Testing weight of command with filter with first character matching");
const auto filteredCommand = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem);
filteredCommand->_Filter = L"A";
filteredCommand->_HighlightedName = filteredCommand->_computeHighlightedName();
auto weight = filteredCommand->_computeWeight();
VERIFY_ARE_EQUAL(weight, 2); // 1 point for the first char match + 1 point for the beginning of the word
}
{
Log::Comment(L"Testing weight of command with filter with other case");
const auto filteredCommand = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem);
filteredCommand->_Filter = L"a";
filteredCommand->_HighlightedName = filteredCommand->_computeHighlightedName();
auto weight = filteredCommand->_computeWeight();
VERIFY_ARE_EQUAL(weight, 2); // 1 point for the first char match + 1 point for the beginning of the word
}
{
Log::Comment(L"Testing weight of command with filter matching several characters");
const auto filteredCommand = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem);
filteredCommand->_Filter = L"ab";
filteredCommand->_HighlightedName = filteredCommand->_computeHighlightedName();
auto weight = filteredCommand->_computeWeight();
VERIFY_ARE_EQUAL(weight, 3); // 1 point for the first char match + 1 point for the beginning of the word + 1 point for the match of "b"
}
});
VERIFY_SUCCEEDED(result);
@@ -158,10 +181,14 @@ namespace TerminalAppLocalTests
{
Log::Comment(L"Testing comparison of commands with empty filter");
const auto filteredCommand = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem);
filteredCommand->UpdateFilter(std::make_shared<fzf::matcher::Pattern>(fzf::matcher::ParsePattern(L"")));
filteredCommand->_Filter = L"";
filteredCommand->_HighlightedName = filteredCommand->_computeHighlightedName();
filteredCommand->_Weight = filteredCommand->_computeWeight();
const auto filteredCommand2 = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem2);
filteredCommand2->UpdateFilter(std::make_shared<fzf::matcher::Pattern>(fzf::matcher::ParsePattern(L"")));
filteredCommand2->_Filter = L"";
filteredCommand2->_HighlightedName = filteredCommand2->_computeHighlightedName();
filteredCommand2->_Weight = filteredCommand2->_computeWeight();
VERIFY_ARE_EQUAL(filteredCommand->Weight(), filteredCommand2->Weight());
VERIFY_IS_TRUE(winrt::TerminalApp::implementation::FilteredCommand::Compare(*filteredCommand, *filteredCommand2));
@@ -169,12 +196,16 @@ namespace TerminalAppLocalTests
{
Log::Comment(L"Testing comparison of commands with different weights");
const auto filteredCommand = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem);
filteredCommand->UpdateFilter(std::make_shared<fzf::matcher::Pattern>(fzf::matcher::ParsePattern(L"B")));
filteredCommand->_Filter = L"B";
filteredCommand->_HighlightedName = filteredCommand->_computeHighlightedName();
filteredCommand->_Weight = filteredCommand->_computeWeight();
const auto filteredCommand2 = winrt::make_self<winrt::TerminalApp::implementation::FilteredCommand>(paletteItem2);
filteredCommand2->UpdateFilter(std::make_shared<fzf::matcher::Pattern>(fzf::matcher::ParsePattern(L"B")));
filteredCommand2->_Filter = L"B";
filteredCommand2->_HighlightedName = filteredCommand2->_computeHighlightedName();
filteredCommand2->_Weight = filteredCommand2->_computeWeight();
VERIFY_IS_LESS_THAN(filteredCommand->Weight(), filteredCommand2->Weight()); // Second command gets more points due to the beginning of the word
VERIFY_IS_TRUE(filteredCommand->Weight() < filteredCommand2->Weight()); // Second command gets more points due to the beginning of the word
VERIFY_IS_FALSE(winrt::TerminalApp::implementation::FilteredCommand::Compare(*filteredCommand, *filteredCommand2));
}
});

View File

@@ -8,7 +8,6 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="using:TerminalApp"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:mtu="using:Microsoft.Terminal.UI"
xmlns:mux="using:Microsoft.UI.Xaml.Controls"
x:Uid="AboutDialog"
DefaultButton="Close"
@@ -18,9 +17,6 @@
<StackPanel Orientation="Vertical">
<TextBlock IsTextSelectionEnabled="True">
<TextBlock.ContextFlyout>
<mtu:TextMenuFlyout />
</TextBlock.ContextFlyout>
<Run AutomationProperties.HeadingLevel="1"
Text="{x:Bind ApplicationDisplayName}" /> <LineBreak />
<Run x:Uid="AboutDialog_VersionLabel" />
@@ -28,22 +24,22 @@
</TextBlock>
<StackPanel Orientation="Vertical">
<StackPanel Padding="0,16,0,16"
<StackPanel Padding="0,4,0,4"
VerticalAlignment="Center"
Orientation="Horizontal"
Spacing="8"
Visibility="{x:Bind CheckingForUpdates, Mode=OneWay}">
<mux:ProgressRing Width="16"
Height="16"
IsActive="True"
IsIndeterminate="True" />
<TextBlock x:Uid="AboutDialog_CheckingForUpdatesLabel" />
<TextBlock x:Uid="AboutDialog_CheckingForUpdatesLabel"
Padding="4,0,0,0" />
</StackPanel>
<StackPanel Padding="0,16,0,16"
<StackPanel Padding="0,4,0,4"
VerticalAlignment="Center"
Orientation="Vertical"
Visibility="{x:Bind UpdatesAvailable, Mode=OneWay}">
<TextBlock>
<TextBlock IsTextSelectionEnabled="False">
<Run x:Uid="AboutDialog_UpdateAvailableLabel" />
</TextBlock>
<!-- <Button x:Uid="AboutDialog_InstallUpdateButton"
@@ -51,18 +47,16 @@
</StackPanel>
</StackPanel>
<StackPanel Margin="-12,0,0,0"
Orientation="Vertical">
<HyperlinkButton x:Uid="AboutDialog_SourceCodeLink"
NavigateUri="https://go.microsoft.com/fwlink/?linkid=2203152" />
<HyperlinkButton x:Uid="AboutDialog_DocumentationLink"
NavigateUri="https://go.microsoft.com/fwlink/?linkid=2125416" />
<HyperlinkButton x:Uid="AboutDialog_ReleaseNotesLink"
NavigateUri="https://go.microsoft.com/fwlink/?linkid=2125417" />
<HyperlinkButton x:Uid="AboutDialog_PrivacyPolicyLink"
NavigateUri="https://go.microsoft.com/fwlink/?linkid=2125418" />
<HyperlinkButton x:Uid="AboutDialog_ThirdPartyNoticesLink"
Click="_ThirdPartyNoticesOnClick" />
</StackPanel>
<HyperlinkButton x:Uid="AboutDialog_SourceCodeLink"
NavigateUri="https://go.microsoft.com/fwlink/?linkid=2203152" />
<HyperlinkButton x:Uid="AboutDialog_DocumentationLink"
NavigateUri="https://go.microsoft.com/fwlink/?linkid=2125416" />
<HyperlinkButton x:Uid="AboutDialog_ReleaseNotesLink"
NavigateUri="https://go.microsoft.com/fwlink/?linkid=2125417" />
<HyperlinkButton x:Uid="AboutDialog_PrivacyPolicyLink"
NavigateUri="https://go.microsoft.com/fwlink/?linkid=2125418" />
<HyperlinkButton x:Uid="AboutDialog_ThirdPartyNoticesLink"
Click="_ThirdPartyNoticesOnClick" />
</StackPanel>
</ContentDialog>

View File

@@ -1174,15 +1174,12 @@ namespace winrt::TerminalApp::implementation
}
else if (_currentMode == CommandPaletteMode::TabSearchMode || _currentMode == CommandPaletteMode::ActionMode || _currentMode == CommandPaletteMode::CommandlineMode)
{
auto pattern = std::make_shared<fzf::matcher::Pattern>(fzf::matcher::ParsePattern(searchText));
for (const auto& action : commandsToFilter)
{
// Update filter for all commands
// This will modify the highlighting but will also lead to re-computation of weight (and consequently sorting).
// Pay attention that it already updates the highlighting in the UI
auto impl = winrt::get_self<implementation::FilteredCommand>(action);
impl->UpdateFilter(pattern);
action.UpdateFilter(searchText);
// if there is active search we skip commands with 0 weight
if (searchText.empty() || action.Weight() > 0)

View File

@@ -284,11 +284,7 @@
IsSpellCheckEnabled="False"
PlaceholderText="{x:Bind SearchBoxPlaceholderText, Mode=OneWay}"
Text=""
TextChanged="_filterTextChanged">
<TextBox.ContextFlyout>
<mtu:TextMenuFlyout />
</TextBox.ContextFlyout>
</TextBox>
TextChanged="_filterTextChanged" />
<TextBlock x:Name="_prefixCharacter"
Grid.Row="0"

View File

@@ -5,7 +5,6 @@
#include "CommandPalette.h"
#include "HighlightedText.h"
#include <LibraryResources.h>
#include "fzf/fzf.h"
#include "FilteredCommand.g.cpp"
@@ -36,75 +35,197 @@ namespace winrt::TerminalApp::implementation
void FilteredCommand::_constructFilteredCommand(const winrt::TerminalApp::PaletteItem& item)
{
_Item = item;
_Filter = L"";
_Weight = 0;
_update();
_HighlightedName = _computeHighlightedName();
// Recompute the highlighted name if the item name changes
_itemChangedRevoker = _Item.PropertyChanged(winrt::auto_revoke, [weakThis{ get_weak() }](auto& /*sender*/, auto& e) {
auto filteredCommand{ weakThis.get() };
if (filteredCommand && e.PropertyName() == L"Name")
{
filteredCommand->_update();
filteredCommand->HighlightedName(filteredCommand->_computeHighlightedName());
filteredCommand->Weight(filteredCommand->_computeWeight());
}
});
}
void FilteredCommand::UpdateFilter(std::shared_ptr<fzf::matcher::Pattern> pattern)
void FilteredCommand::UpdateFilter(const winrt::hstring& filter)
{
// If the filter was not changed we want to prevent the re-computation of matching
// that might result in triggering a notification event
if (pattern != _pattern)
if (filter != _Filter)
{
_pattern = pattern;
_update();
Filter(filter);
HighlightedName(_computeHighlightedName());
Weight(_computeWeight());
}
}
void FilteredCommand::_update()
// Method Description:
// - Looks up the filter characters within the item name.
// Iterating through the filter and the item name it tries to associate the next filter character
// with the first appearance of this character in the item name suffix.
//
// E.g., for filter="c l t s" and name="close all tabs after this", the match will be "CLose TabS after this".
//
// The item name is then split into segments (groupings of matched and non matched characters).
//
// E.g., the segments were the example above will be "CL", "ose ", "T", "ab", "S", "after this".
//
// The segments matching the filter characters are marked as highlighted.
//
// E.g., ("CL", true) ("ose ", false), ("T", true), ("ab", false), ("S", true), ("after this", false)
//
// TODO: we probably need to merge this logic with _getWeight computation?
//
// Return Value:
// - The HighlightedText object initialized with the segments computed according to the algorithm above.
winrt::TerminalApp::HighlightedText FilteredCommand::_computeHighlightedName()
{
std::vector<winrt::TerminalApp::HighlightedTextSegment> segments;
const auto commandName = _Item.Name();
int32_t weight = 0;
const auto segments = winrt::single_threaded_observable_vector<winrt::TerminalApp::HighlightedTextSegment>();
auto commandName = _Item.Name();
auto isProcessingMatchedSegment = false;
uint32_t nextOffsetToReport = 0;
uint32_t currentOffset = 0;
if (!_pattern || _pattern->terms.empty())
for (const auto searchChar : _Filter)
{
segments.emplace_back(winrt::TerminalApp::HighlightedTextSegment(commandName, false));
}
else if (auto match = fzf::matcher::Match(commandName, *_pattern.get()); !match)
{
segments.emplace_back(winrt::TerminalApp::HighlightedTextSegment(commandName, false));
}
else
{
auto& matchResult = *match;
weight = matchResult.Score;
size_t lastPos = 0;
for (const auto& run : matchResult.Runs)
const WCHAR searchCharAsString[] = { searchChar, L'\0' };
while (true)
{
const auto& [start, end] = run;
if (start > lastPos)
if (currentOffset == commandName.size())
{
hstring nonMatch{ til::safe_slice_abs(commandName, lastPos, start) };
segments.emplace_back(winrt::TerminalApp::HighlightedTextSegment(nonMatch, false));
// There are still unmatched filter characters but we finished scanning the name.
// In this case we return the entire item name as unmatched
auto entireNameSegment{ winrt::make<HighlightedTextSegment>(commandName, false) };
segments.Clear();
segments.Append(entireNameSegment);
return winrt::make<HighlightedText>(segments);
}
hstring matchSeg{ til::safe_slice_abs(commandName, start, end + 1) };
segments.emplace_back(winrt::TerminalApp::HighlightedTextSegment(matchSeg, true));
// GH#9941: search should be locale-aware as well
// We use the same comparison method as upon sorting to guarantee consistent behavior
const WCHAR currentCharAsString[] = { commandName[currentOffset], L'\0' };
auto isCurrentCharMatched = lstrcmpi(searchCharAsString, currentCharAsString) == 0;
if (isProcessingMatchedSegment != isCurrentCharMatched)
{
// We reached the end of the region (matched character came after a series of unmatched or vice versa).
// Conclude the segment and add it to the list.
// Skip segment if it is empty (might happen when the first character of the name is matched)
auto sizeToReport = currentOffset - nextOffsetToReport;
if (sizeToReport > 0)
{
winrt::hstring segment{ commandName.data() + nextOffsetToReport, sizeToReport };
auto highlightedSegment{ winrt::make<HighlightedTextSegment>(segment, isProcessingMatchedSegment) };
segments.Append(highlightedSegment);
nextOffsetToReport = currentOffset;
}
isProcessingMatchedSegment = isCurrentCharMatched;
}
lastPos = end + 1;
}
currentOffset++;
if (lastPos < commandName.size())
{
hstring tail{ til::safe_slice_abs(commandName, lastPos, SIZE_T_MAX) };
segments.emplace_back(winrt::TerminalApp::HighlightedTextSegment(tail, false));
if (isCurrentCharMatched)
{
// We have matched this filter character, let's move to matching the next filter char
break;
}
}
}
HighlightedName(winrt::make<HighlightedText>(winrt::single_threaded_observable_vector(std::move(segments))));
Weight(weight);
// Either the filter or the item name were fully processed.
// If we were in the middle of the matched segment - add it.
if (isProcessingMatchedSegment)
{
auto sizeToReport = currentOffset - nextOffsetToReport;
if (sizeToReport > 0)
{
winrt::hstring segment{ commandName.data() + nextOffsetToReport, sizeToReport };
auto highlightedSegment{ winrt::make<HighlightedTextSegment>(segment, true) };
segments.Append(highlightedSegment);
nextOffsetToReport = currentOffset;
}
}
// Now create a segment for all remaining characters.
// We will have remaining characters as long as the filter is shorter than the item name.
auto sizeToReport = commandName.size() - nextOffsetToReport;
if (sizeToReport > 0)
{
winrt::hstring segment{ commandName.data() + nextOffsetToReport, sizeToReport };
auto highlightedSegment{ winrt::make<HighlightedTextSegment>(segment, false) };
segments.Append(highlightedSegment);
}
return winrt::make<HighlightedText>(segments);
}
// Function Description:
// - Calculates a "weighting" by which should be used to order a item
// name relative to other names, given a specific search string.
// Currently, this is based off of two factors:
// * The weight is incremented once for each matched character of the
// search text.
// * If a matching character from the search text was found at the start
// of a word in the name, then we increment the weight again.
// * For example, for a search string "sp", we want "Split Pane" to
// appear in the list before "Close Pane"
// * Consecutive matches will be weighted higher than matches with
// characters in between the search characters.
// - This will return 0 if the item should not be shown. If all the
// characters of search text appear in order in `name`, then this function
// will return a positive number. There can be any number of characters
// separating consecutive characters in searchText.
// * For example:
// "name": "New Tab"
// "name": "Close Tab"
// "name": "Close Pane"
// "name": "[-] Split Horizontal"
// "name": "[ | ] Split Vertical"
// "name": "Next Tab"
// "name": "Prev Tab"
// "name": "Open Settings"
// "name": "Open Media Controls"
// * "open" should return both "**Open** Settings" and "**Open** Media Controls".
// * "Tab" would return "New **Tab**", "Close **Tab**", "Next **Tab**" and "Prev
// **Tab**".
// * "P" would return "Close **P**ane", "[-] S**p**lit Horizontal", "[ | ]
// S**p**lit Vertical", "**P**rev Tab", "O**p**en Settings" and "O**p**en Media
// Controls".
// * "sv" would return "[ | ] Split Vertical" (by matching the **S** in
// "Split", then the **V** in "Vertical").
// Arguments:
// - searchText: the string of text to search for in `name`
// - name: the name to check
// Return Value:
// - the relative weight of this match
int FilteredCommand::_computeWeight()
{
auto result = 0;
auto isNextSegmentWordBeginning = true;
for (const auto& segment : _HighlightedName.Segments())
{
const auto& segmentText = segment.TextSegment();
const auto segmentSize = segmentText.size();
if (segment.IsHighlighted())
{
// Give extra point for each consecutive match
result += (segmentSize <= 1) ? segmentSize : 1 + 2 * (segmentSize - 1);
// Give extra point if this segment is at the beginning of a word
if (isNextSegmentWordBeginning)
{
result++;
}
}
isNextSegmentWordBeginning = segmentSize > 0 && segmentText[segmentSize - 1] == L' ';
}
return result;
}
// Function Description:
@@ -122,9 +243,9 @@ namespace winrt::TerminalApp::implementation
if (firstWeight == secondWeight)
{
const auto firstName = first.Item().Name();
const auto secondName = second.Item().Name();
return til::compare_linguistic_insensitive(firstName, secondName) < 0;
std::wstring_view firstName{ first.Item().Name() };
std::wstring_view secondName{ second.Item().Name() };
return lstrcmpi(firstName.data(), secondName.data()) < 0;
}
return firstWeight > secondWeight;

View File

@@ -5,7 +5,6 @@
#include "HighlightedTextControl.h"
#include "FilteredCommand.g.h"
#include "fzf/fzf.h"
// fwdecl unittest classes
namespace TerminalAppLocalTests
@@ -20,12 +19,13 @@ namespace winrt::TerminalApp::implementation
FilteredCommand() = default;
FilteredCommand(const winrt::TerminalApp::PaletteItem& item);
virtual void UpdateFilter(std::shared_ptr<fzf::matcher::Pattern> pattern);
virtual void UpdateFilter(const winrt::hstring& filter);
static int Compare(const winrt::TerminalApp::FilteredCommand& first, const winrt::TerminalApp::FilteredCommand& second);
til::property_changed_event PropertyChanged;
WINRT_OBSERVABLE_PROPERTY(winrt::TerminalApp::PaletteItem, Item, PropertyChanged.raise, nullptr);
WINRT_OBSERVABLE_PROPERTY(winrt::hstring, Filter, PropertyChanged.raise);
WINRT_OBSERVABLE_PROPERTY(winrt::TerminalApp::HighlightedText, HighlightedName, PropertyChanged.raise);
WINRT_OBSERVABLE_PROPERTY(int, Weight, PropertyChanged.raise);
@@ -33,8 +33,8 @@ namespace winrt::TerminalApp::implementation
void _constructFilteredCommand(const winrt::TerminalApp::PaletteItem& item);
private:
std::shared_ptr<fzf::matcher::Pattern> _pattern;
void _update();
winrt::TerminalApp::HighlightedText _computeHighlightedName();
int _computeWeight();
Windows::UI::Xaml::Data::INotifyPropertyChanged::PropertyChanged_revoker _itemChangedRevoker;
friend class TerminalAppLocalTests::FilteredCommandTests;

View File

@@ -12,7 +12,10 @@ namespace TerminalApp
FilteredCommand(PaletteItem item);
PaletteItem Item { get; };
String Filter;
HighlightedText HighlightedName { get; };
Int32 Weight;
void UpdateFilter(String filter);
}
}

View File

@@ -8,8 +8,7 @@ namespace TerminalApp
None,
Content,
MovePane,
PersistLayout,
PersistAll
Persist,
};
runtimeclass BellEventArgs

View File

@@ -78,7 +78,6 @@ namespace winrt::TerminalApp::implementation
void MarkdownPaneContent::_loadText()
{
auto block = WUX::Controls::TextBlock();
block.ContextFlyout(winrt::Microsoft::Terminal::UI::TextMenuFlyout{});
block.IsTextSelectionEnabled(true);
block.FontFamily(WUX::Media::FontFamily{ L"Cascadia Code" });
block.Text(FileContents());

View File

@@ -8,7 +8,6 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="using:TerminalApp"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:mtu="using:Microsoft.Terminal.UI"
xmlns:mux="using:Microsoft.UI.Xaml.Controls"
mc:Ignorable="d">
@@ -52,11 +51,7 @@
Grid.Column="0"
Margin="4"
PlaceholderText="Enter a path to a markdown file..."
Text="Z:\dev\simple-test.md">
<TextBox.ContextFlyout>
<mtu:TextMenuFlyout />
</TextBox.ContextFlyout>
</TextBox>
Text="Z:\dev\simple-test.md" />
<StackPanel Grid.Column="1"
Orientation="Horizontal">
<Button Margin="4"
@@ -110,11 +105,7 @@
FontFamily="Cascadia Code"
IsSpellCheckEnabled="False"
Text="{x:Bind FileContents, Mode=TwoWay}"
Visibility="{x:Bind Editing}">
<TextBox.ContextFlyout>
<mtu:TextMenuFlyout />
</TextBox.ContextFlyout>
</TextBox>
Visibility="{x:Bind Editing}" />
<ScrollViewer x:Name="_scrollViewer"
Grid.Column="1"

View File

@@ -17,7 +17,7 @@ namespace winrt::TerminalApp::implementation
{
CommandlineArgs::CommandlineArgs(winrt::array_view<const winrt::hstring> args, winrt::hstring currentDirectory, uint32_t showWindowCommand, winrt::hstring envString) :
_args{ args.begin(), args.end() },
CurrentDirectory{ std::move(currentDirectory) },
_cwd{ std::move(currentDirectory) },
ShowWindowCommand{ showWindowCommand },
CurrentEnvironment{ std::move(envString) }
{

View File

@@ -36,6 +36,7 @@ namespace winrt::TerminalApp::implementation
::TerminalApp::AppCommandlineArgs _parsed;
int32_t _parseResult = 0;
winrt::com_array<winrt::hstring> _args;
winrt::hstring _cwd;
};
struct RequestReceiveContentArgs : RequestReceiveContentArgsT<RequestReceiveContentArgs>

View File

@@ -213,45 +213,6 @@
<data name="SplitPaneText" xml:space="preserve">
<value>Bereich teilen</value>
</data>
<data name="SplitPaneToolTipText" xml:space="preserve">
<value>Mit der rechten Maustaste klicken für Richtungen zum Teilen  rechts/unten/oben/links</value>
</data>
<data name="SplitPaneDownText" xml:space="preserve">
<value>Bereich nach unten teilen</value>
</data>
<data name="SplitPaneRightText" xml:space="preserve">
<value>Bereich nach rechts teilen</value>
</data>
<data name="SplitPaneUpText" xml:space="preserve">
<value>Bereich nach oben teilen</value>
</data>
<data name="SplitPaneLeftText" xml:space="preserve">
<value>Bereich nach links teilen</value>
</data>
<data name="SplitPaneDuplicateText" xml:space="preserve">
<value>Duplikat</value>
</data>
<data name="SwapPaneText" xml:space="preserve">
<value>Bereich austauschen</value>
</data>
<data name="SwapPaneDownText" xml:space="preserve">
<value>Bereich nach unten wechseln</value>
</data>
<data name="SwapPaneRightText" xml:space="preserve">
<value>Bereich nach rechts wechseln</value>
</data>
<data name="SwapPaneUpText" xml:space="preserve">
<value>Bereich nach oben wechseln</value>
</data>
<data name="SwapPaneLeftText" xml:space="preserve">
<value>Bereich nach links wechseln</value>
</data>
<data name="TogglePaneZoomText" xml:space="preserve">
<value>Zoomfenster umschalten</value>
</data>
<data name="CloseOtherPanesText" xml:space="preserve">
<value>Andere Bereiche schließen</value>
</data>
<data name="SearchWebText" xml:space="preserve">
<value>Websuche</value>
</data>
@@ -978,7 +939,4 @@
<data name="TabMoveRight" xml:space="preserve">
<value>Nach rechts</value>
</data>
<data name="InvalidRegex" xml:space="preserve">
<value>Ein ungültiger regulärer Ausdruck wurde entdeckt.</value>
</data>
</root>

View File

@@ -214,45 +214,6 @@
<data name="SplitPaneText" xml:space="preserve">
<value>Split pane</value>
</data>
<data name="SplitPaneToolTipText" xml:space="preserve">
<value>Right click for split directions - right/down/up/left</value>
</data>
<data name="SplitPaneDownText" xml:space="preserve">
<value>Split pane down</value>
</data>
<data name="SplitPaneRightText" xml:space="preserve">
<value>Split pane right</value>
</data>
<data name="SplitPaneUpText" xml:space="preserve">
<value>Split pane up</value>
</data>
<data name="SplitPaneLeftText" xml:space="preserve">
<value>Split pane left</value>
</data>
<data name="SplitPaneDuplicateText" xml:space="preserve">
<value>Duplicate</value>
</data>
<data name="SwapPaneText" xml:space="preserve">
<value>Swap pane</value>
</data>
<data name="SwapPaneDownText" xml:space="preserve">
<value>Swap pane down</value>
</data>
<data name="SwapPaneRightText" xml:space="preserve">
<value>Swap pane right</value>
</data>
<data name="SwapPaneUpText" xml:space="preserve">
<value>Swap pane up</value>
</data>
<data name="SwapPaneLeftText" xml:space="preserve">
<value>Swap pane left</value>
</data>
<data name="TogglePaneZoomText" xml:space="preserve">
<value>Toggle pane zoom</value>
</data>
<data name="CloseOtherPanesText" xml:space="preserve">
<value>Close other panes</value>
</data>
<data name="SearchWebText" xml:space="preserve">
<value>Web search</value>
</data>
@@ -983,7 +944,4 @@
<data name="TabMoveRight" xml:space="preserve">
<value>Move right</value>
</data>
<data name="InvalidRegex" xml:space="preserve">
<value>An invalid regular expression was found.</value>
</data>
</root>

View File

@@ -210,45 +210,6 @@
<data name="SplitPaneText" xml:space="preserve">
<value>Dividir panel</value>
</data>
<data name="SplitPaneToolTipText" xml:space="preserve">
<value>Haga clic con el botón derecho para dividir las direcciones: derecha/abajo/arriba/izquierda</value>
</data>
<data name="SplitPaneDownText" xml:space="preserve">
<value>Panel dividido hacia abajo</value>
</data>
<data name="SplitPaneRightText" xml:space="preserve">
<value>Panel dividido a la derecha</value>
</data>
<data name="SplitPaneUpText" xml:space="preserve">
<value>Panel dividido hacia arriba</value>
</data>
<data name="SplitPaneLeftText" xml:space="preserve">
<value>Panel dividido a la izquierda</value>
</data>
<data name="SplitPaneDuplicateText" xml:space="preserve">
<value>Duplicar</value>
</data>
<data name="SwapPaneText" xml:space="preserve">
<value>Intercambiar panel</value>
</data>
<data name="SwapPaneDownText" xml:space="preserve">
<value>Intercambiar panel hacia abajo</value>
</data>
<data name="SwapPaneRightText" xml:space="preserve">
<value>Intercambiar panel derecho</value>
</data>
<data name="SwapPaneUpText" xml:space="preserve">
<value>Intercambiar panel hacia arriba</value>
</data>
<data name="SwapPaneLeftText" xml:space="preserve">
<value>Intercambiar panel izquierdo</value>
</data>
<data name="TogglePaneZoomText" xml:space="preserve">
<value>Zoom de panel de alternancia</value>
</data>
<data name="CloseOtherPanesText" xml:space="preserve">
<value>Cerrar otros paneles</value>
</data>
<data name="SearchWebText" xml:space="preserve">
<value>Búsqueda en la web</value>
</data>
@@ -975,7 +936,4 @@
<data name="TabMoveRight" xml:space="preserve">
<value>Mover a la derecha</value>
</data>
<data name="InvalidRegex" xml:space="preserve">
<value>Se ha encontrado una expresión regular no válida.</value>
</data>
</root>

View File

@@ -210,45 +210,6 @@
<data name="SplitPaneText" xml:space="preserve">
<value>Fractionner le volet</value>
</data>
<data name="SplitPaneToolTipText" xml:space="preserve">
<value>Cliquez avec le bouton droit pour afficher les directions de séparation droite/bas/haut/gauche</value>
</data>
<data name="SplitPaneDownText" xml:space="preserve">
<value>Fractionner le volet vers le bas</value>
</data>
<data name="SplitPaneRightText" xml:space="preserve">
<value>Fractionner le volet à droite</value>
</data>
<data name="SplitPaneUpText" xml:space="preserve">
<value>Fractionner le volet vers le haut</value>
</data>
<data name="SplitPaneLeftText" xml:space="preserve">
<value>Fractionner le volet à gauche</value>
</data>
<data name="SplitPaneDuplicateText" xml:space="preserve">
<value>Dupliquer</value>
</data>
<data name="SwapPaneText" xml:space="preserve">
<value>Permuter le volet</value>
</data>
<data name="SwapPaneDownText" xml:space="preserve">
<value>Permuter le volet vers le bas</value>
</data>
<data name="SwapPaneRightText" xml:space="preserve">
<value>Permuter le volet à droite</value>
</data>
<data name="SwapPaneUpText" xml:space="preserve">
<value>Permuter le volet vers le haut</value>
</data>
<data name="SwapPaneLeftText" xml:space="preserve">
<value>Permuter le volet à gauche</value>
</data>
<data name="TogglePaneZoomText" xml:space="preserve">
<value>Basculer le zoom du volet</value>
</data>
<data name="CloseOtherPanesText" xml:space="preserve">
<value>Fermer les autres volets</value>
</data>
<data name="SearchWebText" xml:space="preserve">
<value>Recherche web</value>
</data>
@@ -975,7 +936,4 @@
<data name="TabMoveRight" xml:space="preserve">
<value>Déplacer vers la droite</value>
</data>
<data name="InvalidRegex" xml:space="preserve">
<value>Une expression régulière non valide a été trouvée.</value>
</data>
</root>

View File

@@ -210,45 +210,6 @@
<data name="SplitPaneText" xml:space="preserve">
<value>Suddividi riquadro</value>
</data>
<data name="SplitPaneToolTipText" xml:space="preserve">
<value>Fai clic con il pulsante destro del mouse per le direzioni di divisione: destra/giù/su/sinistra</value>
</data>
<data name="SplitPaneDownText" xml:space="preserve">
<value>Dividi riquadro in giù</value>
</data>
<data name="SplitPaneRightText" xml:space="preserve">
<value>Dividi riquadro a destra</value>
</data>
<data name="SplitPaneUpText" xml:space="preserve">
<value>Dividi riquadro in su</value>
</data>
<data name="SplitPaneLeftText" xml:space="preserve">
<value>Dividi riquadro a sinistra</value>
</data>
<data name="SplitPaneDuplicateText" xml:space="preserve">
<value>Duplica</value>
</data>
<data name="SwapPaneText" xml:space="preserve">
<value>Scambia riquadro</value>
</data>
<data name="SwapPaneDownText" xml:space="preserve">
<value>Scambia riquadro in giù</value>
</data>
<data name="SwapPaneRightText" xml:space="preserve">
<value>Scambia riquadro a destra</value>
</data>
<data name="SwapPaneUpText" xml:space="preserve">
<value>Scambia riquadro in su</value>
</data>
<data name="SwapPaneLeftText" xml:space="preserve">
<value>Scambia riquadro a sinistra</value>
</data>
<data name="TogglePaneZoomText" xml:space="preserve">
<value>Attiva/disattiva zoom riquadro</value>
</data>
<data name="CloseOtherPanesText" xml:space="preserve">
<value>Chiudi altri riquadri</value>
</data>
<data name="SearchWebText" xml:space="preserve">
<value>Ricerca nel Web</value>
</data>
@@ -975,7 +936,4 @@
<data name="TabMoveRight" xml:space="preserve">
<value>Sposta a destra</value>
</data>
<data name="InvalidRegex" xml:space="preserve">
<value>È stata trovata un'espressione regolare non valida.</value>
</data>
</root>

View File

@@ -211,45 +211,6 @@
<data name="SplitPaneText" xml:space="preserve">
<value>ウィンドウを分割する</value>
</data>
<data name="SplitPaneToolTipText" xml:space="preserve">
<value>分割する方向を右クリック - 右/下/上/左</value>
</data>
<data name="SplitPaneDownText" xml:space="preserve">
<value>下にペインを分割</value>
</data>
<data name="SplitPaneRightText" xml:space="preserve">
<value>右にペインを分割</value>
</data>
<data name="SplitPaneUpText" xml:space="preserve">
<value>上にペインを分割</value>
</data>
<data name="SplitPaneLeftText" xml:space="preserve">
<value>左にペインを分割</value>
</data>
<data name="SplitPaneDuplicateText" xml:space="preserve">
<value>複製</value>
</data>
<data name="SwapPaneText" xml:space="preserve">
<value>ウィンドウを入れ替える</value>
</data>
<data name="SwapPaneDownText" xml:space="preserve">
<value>下とペインを入れ替え</value>
</data>
<data name="SwapPaneRightText" xml:space="preserve">
<value>右とペインを入れ替え</value>
</data>
<data name="SwapPaneUpText" xml:space="preserve">
<value>上とペインを入れ替え</value>
</data>
<data name="SwapPaneLeftText" xml:space="preserve">
<value>左とペインを入れ替え</value>
</data>
<data name="TogglePaneZoomText" xml:space="preserve">
<value>ウィンドウのズームの切り替え</value>
</data>
<data name="CloseOtherPanesText" xml:space="preserve">
<value>他のウィンドウを閉じる</value>
</data>
<data name="SearchWebText" xml:space="preserve">
<value>Web 検索</value>
</data>
@@ -976,7 +937,4 @@
<data name="TabMoveRight" xml:space="preserve">
<value>右へ移動</value>
</data>
<data name="InvalidRegex" xml:space="preserve">
<value>無効な正規表現が見つかりました。</value>
</data>
</root>

View File

@@ -210,45 +210,6 @@
<data name="SplitPaneText" xml:space="preserve">
<value>분할 창</value>
</data>
<data name="SplitPaneToolTipText" xml:space="preserve">
<value>오른쪽 클릭으로 방향 분할 - 오른쪽/아래쪽/위쪽/왼쪽</value>
</data>
<data name="SplitPaneDownText" xml:space="preserve">
<value>창 아래로 분할</value>
</data>
<data name="SplitPaneRightText" xml:space="preserve">
<value>창 오른쪽으로 분할</value>
</data>
<data name="SplitPaneUpText" xml:space="preserve">
<value>창 위로 분할</value>
</data>
<data name="SplitPaneLeftText" xml:space="preserve">
<value>창 왼쪽으로 분할</value>
</data>
<data name="SplitPaneDuplicateText" xml:space="preserve">
<value>중복</value>
</data>
<data name="SwapPaneText" xml:space="preserve">
<value>창 스왑</value>
</data>
<data name="SwapPaneDownText" xml:space="preserve">
<value>창 아래로 전환</value>
</data>
<data name="SwapPaneRightText" xml:space="preserve">
<value>창 오른쪽으로 전환</value>
</data>
<data name="SwapPaneUpText" xml:space="preserve">
<value>창 위로 전환</value>
</data>
<data name="SwapPaneLeftText" xml:space="preserve">
<value>창 왼쪽으로 전환</value>
</data>
<data name="TogglePaneZoomText" xml:space="preserve">
<value>창 확대/축소 토글</value>
</data>
<data name="CloseOtherPanesText" xml:space="preserve">
<value>다른 창 닫기</value>
</data>
<data name="SearchWebText" xml:space="preserve">
<value>웹 검색</value>
</data>
@@ -975,7 +936,4 @@
<data name="TabMoveRight" xml:space="preserve">
<value>오른쪽으로 이동</value>
</data>
<data name="InvalidRegex" xml:space="preserve">
<value>잘못된 정규식을 찾았습니다.</value>
</data>
</root>

View File

@@ -210,45 +210,6 @@
<data name="SplitPaneText" xml:space="preserve">
<value>Dividir painel</value>
</data>
<data name="SplitPaneToolTipText" xml:space="preserve">
<value>Clique com o botão direito para obter direções de divisão - direita/para baixo/para cima/esquerda</value>
</data>
<data name="SplitPaneDownText" xml:space="preserve">
<value>Dividir painel para baixo</value>
</data>
<data name="SplitPaneRightText" xml:space="preserve">
<value>Dividir painel à direita</value>
</data>
<data name="SplitPaneUpText" xml:space="preserve">
<value>Dividir painel para cima</value>
</data>
<data name="SplitPaneLeftText" xml:space="preserve">
<value>Dividir painel à esquerda</value>
</data>
<data name="SplitPaneDuplicateText" xml:space="preserve">
<value>Duplicar</value>
</data>
<data name="SwapPaneText" xml:space="preserve">
<value>Painel de troca</value>
</data>
<data name="SwapPaneDownText" xml:space="preserve">
<value>Alternar painel para baixo</value>
</data>
<data name="SwapPaneRightText" xml:space="preserve">
<value>Alternar painel à direita</value>
</data>
<data name="SwapPaneUpText" xml:space="preserve">
<value>Alternar painel para cima</value>
</data>
<data name="SwapPaneLeftText" xml:space="preserve">
<value>Alternar painel para a esquerda</value>
</data>
<data name="TogglePaneZoomText" xml:space="preserve">
<value>Alternar o zoom do painel</value>
</data>
<data name="CloseOtherPanesText" xml:space="preserve">
<value>Fechar outros painéis</value>
</data>
<data name="SearchWebText" xml:space="preserve">
<value>Pesquisa na Web</value>
</data>
@@ -975,7 +936,4 @@
<data name="TabMoveRight" xml:space="preserve">
<value>Mover para a direita</value>
</data>
<data name="InvalidRegex" xml:space="preserve">
<value>Foi encontrada uma expressão regular inválida.</value>
</data>
</root>

View File

@@ -214,45 +214,6 @@
<data name="SplitPaneText" xml:space="preserve">
<value>Šрŀіт φªňë !!!</value>
</data>
<data name="SplitPaneToolTipText" xml:space="preserve">
<value>Ґΐĝĥτ ςļìск ƒôŗ ѕрℓΐť δįяęčŧįόпŝ - гΐġћŧ/đôшň/µρ/ľëƒт !!! !!! !!! !!! !!! </value>
</data>
<data name="SplitPaneDownText" xml:space="preserve">
<value>Śφľīţ φǻńě ðбẃή !!! !</value>
</data>
<data name="SplitPaneRightText" xml:space="preserve">
<value>Śрĺїť рâйê řіġнţ !!! !</value>
</data>
<data name="SplitPaneUpText" xml:space="preserve">
<value>Ŝрļįŧ рâⁿë ūφ !!! </value>
</data>
<data name="SplitPaneLeftText" xml:space="preserve">
<value>Ѕрľîţ φâиè ļзƒţ !!! !</value>
</data>
<data name="SplitPaneDuplicateText" xml:space="preserve">
<value>Đύрľįčäтè !!!</value>
</data>
<data name="SwapPaneText" xml:space="preserve">
<value>Šŵάφ рąņё !!!</value>
</data>
<data name="SwapPaneDownText" xml:space="preserve">
<value>Ѕщǻφ ρåπê ďōщπ !!! !</value>
</data>
<data name="SwapPaneRightText" xml:space="preserve">
<value>Şώǻρ ρâпέ ŕïġђţ !!! !</value>
</data>
<data name="SwapPaneUpText" xml:space="preserve">
<value>Śωãр φàňє цр !!! </value>
</data>
<data name="SwapPaneLeftText" xml:space="preserve">
<value>Šŵªφ ρäήę łеƒť !!! !</value>
</data>
<data name="TogglePaneZoomText" xml:space="preserve">
<value>Тøģġľε φªηê żοбм !!! !</value>
</data>
<data name="CloseOtherPanesText" xml:space="preserve">
<value>Ċłǿѕē ōŧĥзŗ рάпèś !!! !!</value>
</data>
<data name="SearchWebText" xml:space="preserve">
<value>Ẅёв şĕаŕčĥ !!!</value>
</data>
@@ -983,7 +944,4 @@
<data name="TabMoveRight" xml:space="preserve">
<value>Мóνε яίģнŧ !!!</value>
</data>
<data name="InvalidRegex" xml:space="preserve">
<value>Дʼn ΐňνãľîδ ŗěğµℓдř ë×ρяēѕšιбή ẃăѕ ƒοůʼnđ. !!! !!! !!! !!!</value>
</data>
</root>

View File

@@ -214,45 +214,6 @@
<data name="SplitPaneText" xml:space="preserve">
<value>Šрŀіт φªňë !!!</value>
</data>
<data name="SplitPaneToolTipText" xml:space="preserve">
<value>Ґΐĝĥτ ςļìск ƒôŗ ѕрℓΐť δįяęčŧįόпŝ - гΐġћŧ/đôшň/µρ/ľëƒт !!! !!! !!! !!! !!! </value>
</data>
<data name="SplitPaneDownText" xml:space="preserve">
<value>Śφľīţ φǻńě ðбẃή !!! !</value>
</data>
<data name="SplitPaneRightText" xml:space="preserve">
<value>Śрĺїť рâйê řіġнţ !!! !</value>
</data>
<data name="SplitPaneUpText" xml:space="preserve">
<value>Ŝрļįŧ рâⁿë ūφ !!! </value>
</data>
<data name="SplitPaneLeftText" xml:space="preserve">
<value>Ѕрľîţ φâиè ļзƒţ !!! !</value>
</data>
<data name="SplitPaneDuplicateText" xml:space="preserve">
<value>Đύрľįčäтè !!!</value>
</data>
<data name="SwapPaneText" xml:space="preserve">
<value>Šŵάφ рąņё !!!</value>
</data>
<data name="SwapPaneDownText" xml:space="preserve">
<value>Ѕщǻφ ρåπê ďōщπ !!! !</value>
</data>
<data name="SwapPaneRightText" xml:space="preserve">
<value>Şώǻρ ρâпέ ŕïġђţ !!! !</value>
</data>
<data name="SwapPaneUpText" xml:space="preserve">
<value>Śωãр φàňє цр !!! </value>
</data>
<data name="SwapPaneLeftText" xml:space="preserve">
<value>Šŵªφ ρäήę łеƒť !!! !</value>
</data>
<data name="TogglePaneZoomText" xml:space="preserve">
<value>Тøģġľε φªηê żοбм !!! !</value>
</data>
<data name="CloseOtherPanesText" xml:space="preserve">
<value>Ċłǿѕē ōŧĥзŗ рάпèś !!! !!</value>
</data>
<data name="SearchWebText" xml:space="preserve">
<value>Ẅёв şĕаŕčĥ !!!</value>
</data>
@@ -983,7 +944,4 @@
<data name="TabMoveRight" xml:space="preserve">
<value>Мóνε яίģнŧ !!!</value>
</data>
<data name="InvalidRegex" xml:space="preserve">
<value>Дʼn ΐňνãľîδ ŗěğµℓдř ë×ρяēѕšιбή ẃăѕ ƒοůʼnđ. !!! !!! !!! !!!</value>
</data>
</root>

View File

@@ -214,45 +214,6 @@
<data name="SplitPaneText" xml:space="preserve">
<value>Šрŀіт φªňë !!!</value>
</data>
<data name="SplitPaneToolTipText" xml:space="preserve">
<value>Ґΐĝĥτ ςļìск ƒôŗ ѕрℓΐť δįяęčŧįόпŝ - гΐġћŧ/đôшň/µρ/ľëƒт !!! !!! !!! !!! !!! </value>
</data>
<data name="SplitPaneDownText" xml:space="preserve">
<value>Śφľīţ φǻńě ðбẃή !!! !</value>
</data>
<data name="SplitPaneRightText" xml:space="preserve">
<value>Śрĺїť рâйê řіġнţ !!! !</value>
</data>
<data name="SplitPaneUpText" xml:space="preserve">
<value>Ŝрļįŧ рâⁿë ūφ !!! </value>
</data>
<data name="SplitPaneLeftText" xml:space="preserve">
<value>Ѕрľîţ φâиè ļзƒţ !!! !</value>
</data>
<data name="SplitPaneDuplicateText" xml:space="preserve">
<value>Đύрľįčäтè !!!</value>
</data>
<data name="SwapPaneText" xml:space="preserve">
<value>Šŵάφ рąņё !!!</value>
</data>
<data name="SwapPaneDownText" xml:space="preserve">
<value>Ѕщǻφ ρåπê ďōщπ !!! !</value>
</data>
<data name="SwapPaneRightText" xml:space="preserve">
<value>Şώǻρ ρâпέ ŕïġђţ !!! !</value>
</data>
<data name="SwapPaneUpText" xml:space="preserve">
<value>Śωãр φàňє цр !!! </value>
</data>
<data name="SwapPaneLeftText" xml:space="preserve">
<value>Šŵªφ ρäήę łеƒť !!! !</value>
</data>
<data name="TogglePaneZoomText" xml:space="preserve">
<value>Тøģġľε φªηê żοбм !!! !</value>
</data>
<data name="CloseOtherPanesText" xml:space="preserve">
<value>Ċłǿѕē ōŧĥзŗ рάпèś !!! !!</value>
</data>
<data name="SearchWebText" xml:space="preserve">
<value>Ẅёв şĕаŕčĥ !!!</value>
</data>
@@ -983,7 +944,4 @@
<data name="TabMoveRight" xml:space="preserve">
<value>Мóνε яίģнŧ !!!</value>
</data>
<data name="InvalidRegex" xml:space="preserve">
<value>Дʼn ΐňνãľîδ ŗěğµℓдř ë×ρяēѕšιбή ẃăѕ ƒοůʼnđ. !!! !!! !!! !!!</value>
</data>
</root>

View File

@@ -210,45 +210,6 @@
<data name="SplitPaneText" xml:space="preserve">
<value>Разделить область</value>
</data>
<data name="SplitPaneToolTipText" xml:space="preserve">
<value>Щелкните правой кнопкой мыши для направлений разделения — вправо, вниз, вверх, влево</value>
</data>
<data name="SplitPaneDownText" xml:space="preserve">
<value>Разделить панель вниз</value>
</data>
<data name="SplitPaneRightText" xml:space="preserve">
<value>Разделить панель вправо</value>
</data>
<data name="SplitPaneUpText" xml:space="preserve">
<value>Разделить панель вверх</value>
</data>
<data name="SplitPaneLeftText" xml:space="preserve">
<value>Разделить панель влево</value>
</data>
<data name="SplitPaneDuplicateText" xml:space="preserve">
<value>Дублировать</value>
</data>
<data name="SwapPaneText" xml:space="preserve">
<value>Переключить панель</value>
</data>
<data name="SwapPaneDownText" xml:space="preserve">
<value>Переключить панель вниз</value>
</data>
<data name="SwapPaneRightText" xml:space="preserve">
<value>Переключить панель вправо</value>
</data>
<data name="SwapPaneUpText" xml:space="preserve">
<value>Переключить панель вверх</value>
</data>
<data name="SwapPaneLeftText" xml:space="preserve">
<value>Переключить панель влево</value>
</data>
<data name="TogglePaneZoomText" xml:space="preserve">
<value>Переключить масштаб области</value>
</data>
<data name="CloseOtherPanesText" xml:space="preserve">
<value>Закрыть другие панели</value>
</data>
<data name="SearchWebText" xml:space="preserve">
<value>Поиск в Интернете</value>
</data>
@@ -975,7 +936,4 @@
<data name="TabMoveRight" xml:space="preserve">
<value>Вправо</value>
</data>
<data name="InvalidRegex" xml:space="preserve">
<value>Обнаружено недопустимое регулярное выражение.</value>
</data>
</root>

View File

@@ -210,45 +210,6 @@
<data name="SplitPaneText" xml:space="preserve">
<value>拆分窗格</value>
</data>
<data name="SplitPaneToolTipText" xml:space="preserve">
<value>右键单击以查看拆分方向 - 右/下/上/左</value>
</data>
<data name="SplitPaneDownText" xml:space="preserve">
<value>向下拆分窗格</value>
</data>
<data name="SplitPaneRightText" xml:space="preserve">
<value>向右拆分窗格</value>
</data>
<data name="SplitPaneUpText" xml:space="preserve">
<value>向上拆分窗格</value>
</data>
<data name="SplitPaneLeftText" xml:space="preserve">
<value>向左拆分窗格</value>
</data>
<data name="SplitPaneDuplicateText" xml:space="preserve">
<value>复制</value>
</data>
<data name="SwapPaneText" xml:space="preserve">
<value>交换窗格</value>
</data>
<data name="SwapPaneDownText" xml:space="preserve">
<value>向下交换窗格</value>
</data>
<data name="SwapPaneRightText" xml:space="preserve">
<value>向右交换窗格</value>
</data>
<data name="SwapPaneUpText" xml:space="preserve">
<value>向上交换窗格</value>
</data>
<data name="SwapPaneLeftText" xml:space="preserve">
<value>向左交换窗格</value>
</data>
<data name="TogglePaneZoomText" xml:space="preserve">
<value>切换窗格缩放</value>
</data>
<data name="CloseOtherPanesText" xml:space="preserve">
<value>关闭其他窗格</value>
</data>
<data name="SearchWebText" xml:space="preserve">
<value>网络搜索</value>
</data>
@@ -975,7 +936,4 @@
<data name="TabMoveRight" xml:space="preserve">
<value>右移</value>
</data>
<data name="InvalidRegex" xml:space="preserve">
<value>发现无效的正则表达式。</value>
</data>
</root>

View File

@@ -210,45 +210,6 @@
<data name="SplitPaneText" xml:space="preserve">
<value>分割窗格</value>
</data>
<data name="SplitPaneToolTipText" xml:space="preserve">
<value>以滑鼠右鍵按一下以選擇分割方向 - 右/下/上/左</value>
</data>
<data name="SplitPaneDownText" xml:space="preserve">
<value>向下分割窗格</value>
</data>
<data name="SplitPaneRightText" xml:space="preserve">
<value>向右分割窗格</value>
</data>
<data name="SplitPaneUpText" xml:space="preserve">
<value>向上分割窗格</value>
</data>
<data name="SplitPaneLeftText" xml:space="preserve">
<value>向左分割窗格</value>
</data>
<data name="SplitPaneDuplicateText" xml:space="preserve">
<value>複製</value>
</data>
<data name="SwapPaneText" xml:space="preserve">
<value>交換窗格</value>
</data>
<data name="SwapPaneDownText" xml:space="preserve">
<value>向下交換窗格</value>
</data>
<data name="SwapPaneRightText" xml:space="preserve">
<value>向右交換窗格</value>
</data>
<data name="SwapPaneUpText" xml:space="preserve">
<value>向上交換窗格</value>
</data>
<data name="SwapPaneLeftText" xml:space="preserve">
<value>向左交換窗格</value>
</data>
<data name="TogglePaneZoomText" xml:space="preserve">
<value>切換窗格縮放</value>
</data>
<data name="CloseOtherPanesText" xml:space="preserve">
<value>關閉其他窗格</value>
</data>
<data name="SearchWebText" xml:space="preserve">
<value>網頁搜尋</value>
</data>
@@ -975,7 +936,4 @@
<data name="TabMoveRight" xml:space="preserve">
<value>右移</value>
</data>
<data name="InvalidRegex" xml:space="preserve">
<value>發現無效的規則運算式。</value>
</data>
</root>

View File

@@ -20,7 +20,6 @@ namespace winrt::TerminalApp::implementation
_root.Background(bg.try_as<Media::Brush>());
_box = winrt::Windows::UI::Xaml::Controls::TextBox{};
_box.ContextFlyout(winrt::Microsoft::Terminal::UI::TextMenuFlyout{});
_box.Margin({ 10, 10, 10, 10 });
_box.AcceptsReturn(true);
_box.TextWrapping(TextWrapping::Wrap);

View File

@@ -3,7 +3,6 @@
#include "pch.h"
#include "ShortcutActionDispatch.h"
#include "WtExeUtils.h"
#include "ShortcutActionDispatch.g.cpp"
@@ -54,22 +53,11 @@ namespace winrt::TerminalApp::implementation
if (handled)
{
#if defined(WT_BRANDING_RELEASE)
constexpr uint8_t branding = 3;
#elif defined(WT_BRANDING_PREVIEW)
constexpr uint8_t branding = 2;
#elif defined(WT_BRANDING_CANARY)
constexpr uint8_t branding = 1;
#else
constexpr uint8_t branding = 0;
#endif
TraceLoggingWrite(
g_hTerminalAppProvider,
"ActionDispatched",
TraceLoggingDescription("Event emitted when an action was successfully performed"),
TraceLoggingValue(static_cast<int>(actionAndArgs.Action()), "Action"),
TraceLoggingValue(branding, "Branding"),
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES),
TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage));
}

View File

@@ -32,7 +32,6 @@ namespace winrt::TerminalApp::implementation
void SnippetsPaneContent::_updateFilteredCommands()
{
const auto& queryString = _filterBox().Text();
auto pattern = std::make_shared<fzf::matcher::Pattern>(fzf::matcher::ParsePattern(queryString));
// DON'T replace the itemSource here. If you do, it'll un-expand all the
// nested items the user has expanded. Instead, just update the filter.
@@ -40,7 +39,7 @@ namespace winrt::TerminalApp::implementation
for (const auto& t : _allTasks)
{
auto impl = winrt::get_self<implementation::FilteredTask>(t);
impl->UpdateFilter(pattern);
impl->UpdateFilter(queryString);
}
}

View File

@@ -77,14 +77,13 @@ namespace winrt::TerminalApp::implementation
}
}
void UpdateFilter(std::shared_ptr<fzf::matcher::Pattern> pattern)
void UpdateFilter(const winrt::hstring& filter)
{
_pattern = std::move(pattern);
_filteredCommand->UpdateFilter(_pattern);
_filteredCommand->UpdateFilter(filter);
for (const auto& c : _children)
{
auto impl = winrt::get_self<implementation::FilteredTask>(c);
impl->UpdateFilter(_pattern);
impl->UpdateFilter(filter);
}
PropertyChanged.raise(*this, Windows::UI::Xaml::Data::PropertyChangedEventArgs{ L"Visibility" });
@@ -109,7 +108,6 @@ namespace winrt::TerminalApp::implementation
bool HasChildren() { return _children.Size() > 0; }
winrt::Microsoft::Terminal::Settings::Model::Command Command() { return _command; }
winrt::TerminalApp::FilteredCommand FilteredCommand() { return *_filteredCommand; }
std::shared_ptr<fzf::matcher::Pattern> _pattern;
int32_t Row() { return HasChildren() ? 2 : 1; } // See the BODGY comment in the .XAML for explanation
@@ -119,7 +117,7 @@ namespace winrt::TerminalApp::implementation
winrt::Windows::UI::Xaml::Visibility Visibility()
{
// Is there no filter, or do we match it?
if ((!_pattern || _pattern->terms.empty() || _filteredCommand->Weight() > 0))
if (_filteredCommand->Filter().empty() || _filteredCommand->Weight() > 0)
{
return winrt::Windows::UI::Xaml::Visibility::Visible;
}

View File

@@ -182,6 +182,7 @@
Grid.Column="1"
Margin="12,0,12,6"
FontFamily="Cascadia Mono, Consolas"
IsTextSelectionEnabled="False"
Style="{ThemeResource BodyTextBlockStyle}"
Text="{x:Bind Input}"
Visibility="{Binding ElementName=rootItem, Path=IsSelected}" />
@@ -262,11 +263,7 @@
Margin="8,0,8,8"
AllowFocusOnInteraction="True"
TextChanged="_filterTextChanged"
Visibility="{x:Bind HasSnippets, Mode=OneWay}">
<TextBox.ContextFlyout>
<mtu:TextMenuFlyout />
</TextBox.ContextFlyout>
</TextBox>
Visibility="{x:Bind HasSnippets, Mode=OneWay}" />
<mux:TreeView x:Name="_treeView"
Grid.Row="2"

View File

@@ -936,15 +936,12 @@ namespace winrt::TerminalApp::implementation
auto commandsToFilter = _commandsToFilter();
{
auto pattern = std::make_shared<fzf::matcher::Pattern>(fzf::matcher::ParsePattern(searchText));
for (const auto& action : commandsToFilter)
{
// Update filter for all commands
// This will modify the highlighting but will also lead to re-computation of weight (and consequently sorting).
// Pay attention that it already updates the highlighting in the UI
auto impl = winrt::get_self<implementation::FilteredCommand>(action);
impl->UpdateFilter(pattern);
action.UpdateFilter(searchText);
// if there is active search we skip commands with 0 weight
if (searchText.empty() || action.Weight() > 0)

View File

@@ -141,11 +141,7 @@
PlaceholderText="{x:Bind SearchBoxPlaceholderText, Mode=OneWay}"
Text=""
TextChanged="_filterTextChanged"
Visibility="Collapsed">
<TextBox.ContextFlyout>
<mtu:TextMenuFlyout />
</TextBox.ContextFlyout>
</TextBox>
Visibility="Collapsed" />
<StackPanel Grid.Row="1"
Margin="8,0,8,8"
@@ -228,23 +224,14 @@
FontSize="14"
FontWeight="Bold"
IsTextSelectionEnabled="True"
TextWrapping="WrapWholeWords">
<TextBlock.ContextFlyout>
<mtu:TextMenuFlyout />
</TextBlock.ContextFlyout>
</TextBlock>
TextWrapping="WrapWholeWords" />
<ScrollViewer MaxHeight="64"
VerticalScrollBarVisibility="Visible"
VerticalScrollMode="Enabled"
Visibility="Visible">
<TextBlock x:Name="_descriptionComment"
Margin="0,0,20,0"
IsTextSelectionEnabled="True"
TextWrapping="WrapWholeWords">
<TextBlock.ContextFlyout>
<mtu:TextMenuFlyout />
</TextBlock.ContextFlyout>
</TextBlock>
TextWrapping="WrapWholeWords" />
</ScrollViewer>
</StackPanel>

View File

@@ -9,7 +9,6 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="using:TerminalApp"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:mtu="using:Microsoft.Terminal.UI"
xmlns:mux="using:Microsoft.UI.Xaml.Controls"
MinHeight="16"
mc:Ignorable="d">
@@ -68,10 +67,6 @@
IsSpellCheckEnabled="False"
LostFocus="RenameBoxLostFocusHandler"
MaxLength="1024"
Visibility="Collapsed">
<TextBox.ContextFlyout>
<mtu:TextMenuFlyout />
</TextBox.ContextFlyout>
</TextBox>
Visibility="Collapsed" />
</StackPanel>
</UserControl>

View File

@@ -70,7 +70,8 @@
FontSize="12">
<ToolTipService.ToolTip>
<ToolTip Placement="Mouse">
<TextBlock TextWrapping="Wrap">
<TextBlock IsTextSelectionEnabled="False"
TextWrapping="Wrap">
<Run x:Uid="NewTabRun" /> <LineBreak />
<Run x:Uid="NewPaneRun"
FontStyle="Italic" /> <LineBreak />

View File

@@ -138,7 +138,6 @@
</ClInclude>
<ClInclude Include="FilteredCommand.h" />
<ClInclude Include="Pane.h" />
<ClInclude Include="fzf/fzf.h" />
<ClInclude Include="ColorHelper.h" />
<ClInclude Include="pch.h" />
<ClInclude Include="ShortcutActionDispatch.h">
@@ -213,7 +212,6 @@
<ClCompile Include="TabBase.cpp">
<DependentUpon>TabBase.idl</DependentUpon>
</ClCompile>
<ClCompile Include="fzf/fzf.cpp" />
<ClCompile Include="TabPaletteItem.cpp" />
<ClCompile Include="TaskbarState.cpp">
<DependentUpon>TaskbarState.idl</DependentUpon>

View File

@@ -41,9 +41,6 @@
<ClCompile Include="HighlightedText.cpp">
<Filter>highlightedText</Filter>
</ClCompile>
<ClCompile Include="fzf/fzf.cpp">
<Filter>fzf</Filter>
</ClCompile>
<ClCompile Include="Toast.cpp" />
<ClCompile Include="LanguageProfileNotifier.cpp" />
<ClCompile Include="Monarch.cpp" />
@@ -80,12 +77,6 @@
<ClInclude Include="HighlightedText.h">
<Filter>highlightedText</Filter>
</ClInclude>
<ClInclude Include="fzf/fzf.h">
<Filter>fzf</Filter>
</ClInclude>
<ClInclude Include="fzf/LICENSE">
<Filter>fzf</Filter>
</ClInclude>
<ClInclude Include="Toast.h" />
<ClInclude Include="LanguageProfileNotifier.h" />
<ClInclude Include="WindowsPackageManagerFactory.h" />
@@ -185,9 +176,6 @@
<Filter Include="highlightedText">
<UniqueIdentifier>{e490f626-547d-4b5b-b22d-c6d33c9e3210}</UniqueIdentifier>
</Filter>
<Filter Include="fzf">
<UniqueIdentifier>{e4588ff4-c80a-40f7-be57-3e81f570a93d}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">

View File

@@ -563,11 +563,8 @@ namespace winrt::TerminalApp::implementation
_WindowProperties.VirtualEnvVars(originalVirtualEnv);
}
});
if (!cwd.empty())
{
_WindowProperties.VirtualWorkingDirectory(cwd);
_WindowProperties.VirtualEnvVars(env);
}
_WindowProperties.VirtualWorkingDirectory(cwd);
_WindowProperties.VirtualEnvVars(env);
for (size_t i = 0; i < actions.size(); ++i)
{
@@ -1953,7 +1950,7 @@ namespace winrt::TerminalApp::implementation
}
}
void TerminalPage::PersistState(bool serializeBuffer)
void TerminalPage::PersistState()
{
// 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.
@@ -1968,7 +1965,7 @@ namespace winrt::TerminalApp::implementation
for (auto tab : _tabs)
{
auto t = winrt::get_self<implementation::TabBase>(tab);
auto tabActions = t->BuildStartupActions(serializeBuffer ? BuildStartupKind::PersistAll : BuildStartupKind::PersistLayout);
auto tabActions = t->BuildStartupActions(BuildStartupKind::Persist);
actions.insert(actions.end(), std::make_move_iterator(tabActions.begin()), std::make_move_iterator(tabActions.end()));
}
@@ -2303,7 +2300,7 @@ namespace winrt::TerminalApp::implementation
// for it. The Title change will be propagated upwards through the tab's
// PropertyChanged event handler.
void TerminalPage::_activePaneChanged(winrt::TerminalApp::TerminalTab sender,
Windows::Foundation::IInspectable /*args*/)
Windows::Foundation::IInspectable args)
{
if (const auto tab{ _GetTerminalTabImpl(sender) })
{
@@ -4988,48 +4985,9 @@ namespace winrt::TerminalApp::implementation
};
};
auto makeItem = [&makeCallback](const winrt::hstring& label,
const winrt::hstring& icon,
const auto& action,
auto& targetMenu) {
AppBarButton button{};
if (!icon.empty())
{
auto iconElement = UI::IconPathConverter::IconWUX(icon);
Automation::AutomationProperties::SetAccessibilityView(iconElement, Automation::Peers::AccessibilityView::Raw);
button.Icon(iconElement);
}
button.Label(label);
button.Click(makeCallback(action));
targetMenu.SecondaryCommands().Append(button);
};
auto makeMenuItem = [](const winrt::hstring& label,
const winrt::hstring& icon,
const auto& subMenu,
auto& targetMenu) {
AppBarButton button{};
if (!icon.empty())
{
auto iconElement = UI::IconPathConverter::IconWUX(icon);
Automation::AutomationProperties::SetAccessibilityView(iconElement, Automation::Peers::AccessibilityView::Raw);
button.Icon(iconElement);
}
button.Label(label);
button.Flyout(subMenu);
targetMenu.SecondaryCommands().Append(button);
};
auto makeContextItem = [&makeCallback](const winrt::hstring& label,
auto makeItem = [&menu, &makeCallback](const winrt::hstring& label,
const winrt::hstring& icon,
const winrt::hstring& tooltip,
const auto& action,
const auto& subMenu,
auto& targetMenu) {
const auto& action) {
AppBarButton button{};
if (!icon.empty())
@@ -5041,122 +4999,34 @@ namespace winrt::TerminalApp::implementation
button.Label(label);
button.Click(makeCallback(action));
WUX::Controls::ToolTipService::SetToolTip(button, box_value(tooltip));
button.ContextFlyout(subMenu);
targetMenu.SecondaryCommands().Append(button);
menu.SecondaryCommands().Append(button);
};
const auto focusedProfile = _GetFocusedTabImpl()->GetFocusedProfile();
auto separatorItem = AppBarSeparator{};
auto activeProfiles = _settings.ActiveProfiles();
auto activeProfileCount = gsl::narrow_cast<int>(activeProfiles.Size());
MUX::Controls::CommandBarFlyout splitPaneMenu{};
// Wire up each item to the action that should be performed. By actually
// connecting these to actions, we ensure the implementation is
// consistent. This also leaves room for customizing this menu with
// actions in the future.
makeItem(RS_(L"DuplicateTabText"), L"\xF5ED", ActionAndArgs{ ShortcutAction::DuplicateTab, nullptr }, menu);
const auto focusedProfileName = focusedProfile.Name();
const auto focusedProfileIcon = focusedProfile.Icon();
const auto splitPaneDuplicateText = RS_(L"SplitPaneDuplicateText") + L" " + focusedProfileName; // SplitPaneDuplicateText
const auto splitPaneRightText = RS_(L"SplitPaneRightText");
const auto splitPaneDownText = RS_(L"SplitPaneDownText");
const auto splitPaneUpText = RS_(L"SplitPaneUpText");
const auto splitPaneLeftText = RS_(L"SplitPaneLeftText");
const auto splitPaneToolTipText = RS_(L"SplitPaneToolTipText");
MUX::Controls::CommandBarFlyout splitPaneContextMenu{};
makeItem(splitPaneRightText, focusedProfileIcon, ActionAndArgs{ ShortcutAction::SplitPane, SplitPaneArgs{ SplitType::Duplicate, SplitDirection::Right, .5, nullptr } }, splitPaneContextMenu);
makeItem(splitPaneDownText, focusedProfileIcon, ActionAndArgs{ ShortcutAction::SplitPane, SplitPaneArgs{ SplitType::Duplicate, SplitDirection::Down, .5, nullptr } }, splitPaneContextMenu);
makeItem(splitPaneUpText, focusedProfileIcon, ActionAndArgs{ ShortcutAction::SplitPane, SplitPaneArgs{ SplitType::Duplicate, SplitDirection::Up, .5, nullptr } }, splitPaneContextMenu);
makeItem(splitPaneLeftText, focusedProfileIcon, ActionAndArgs{ ShortcutAction::SplitPane, SplitPaneArgs{ SplitType::Duplicate, SplitDirection::Left, .5, nullptr } }, splitPaneContextMenu);
makeContextItem(splitPaneDuplicateText, focusedProfileIcon, splitPaneToolTipText, ActionAndArgs{ ShortcutAction::SplitPane, SplitPaneArgs{ SplitType::Duplicate, SplitDirection::Automatic, .5, nullptr } }, splitPaneContextMenu, splitPaneMenu);
// add menu separator
const auto separatorAutoItem = AppBarSeparator{};
splitPaneMenu.SecondaryCommands().Append(separatorAutoItem);
for (auto profileIndex = 0; profileIndex < activeProfileCount; profileIndex++)
{
const auto profile = activeProfiles.GetAt(profileIndex);
const auto profileName = profile.Name();
const auto profileIcon = profile.Icon();
NewTerminalArgs args{};
args.Profile(profileName);
MUX::Controls::CommandBarFlyout splitPaneContextMenu{};
makeItem(splitPaneRightText, profileIcon, ActionAndArgs{ ShortcutAction::SplitPane, SplitPaneArgs{ SplitType::Manual, SplitDirection::Right, .5, args } }, splitPaneContextMenu);
makeItem(splitPaneDownText, profileIcon, ActionAndArgs{ ShortcutAction::SplitPane, SplitPaneArgs{ SplitType::Manual, SplitDirection::Down, .5, args } }, splitPaneContextMenu);
makeItem(splitPaneUpText, profileIcon, ActionAndArgs{ ShortcutAction::SplitPane, SplitPaneArgs{ SplitType::Manual, SplitDirection::Up, .5, args } }, splitPaneContextMenu);
makeItem(splitPaneLeftText, profileIcon, ActionAndArgs{ ShortcutAction::SplitPane, SplitPaneArgs{ SplitType::Manual, SplitDirection::Left, .5, args } }, splitPaneContextMenu);
makeContextItem(profileName, profileIcon, splitPaneToolTipText, ActionAndArgs{ ShortcutAction::SplitPane, SplitPaneArgs{ SplitType::Manual, SplitDirection::Automatic, .5, args } }, splitPaneContextMenu, splitPaneMenu);
}
makeMenuItem(RS_(L"SplitPaneText"), L"\xF246", splitPaneMenu, menu);
makeItem(RS_(L"SplitPaneText"), L"\xF246", ActionAndArgs{ ShortcutAction::SplitPane, SplitPaneArgs{ SplitType::Duplicate } });
makeItem(RS_(L"DuplicateTabText"), L"\xF5ED", ActionAndArgs{ ShortcutAction::DuplicateTab, nullptr });
// Only wire up "Close Pane" if there's multiple panes.
if (_GetFocusedTabImpl()->GetLeafPaneCount() > 1)
{
MUX::Controls::CommandBarFlyout swapPaneMenu{};
const auto rootPane = _GetFocusedTabImpl()->GetRootPane();
const auto mruPanes = _GetFocusedTabImpl()->GetMruPanes();
auto activePane = _GetFocusedTabImpl()->GetActivePane();
rootPane->WalkTree([&](auto p) {
if (const auto& c{ p->GetTerminalControl() })
{
if (c == control)
{
activePane = p;
}
}
});
if (auto neighbor = rootPane->NavigateDirection(activePane, FocusDirection::Down, mruPanes))
{
makeItem(RS_(L"SwapPaneDownText"), neighbor->GetProfile().Icon(), ActionAndArgs{ ShortcutAction::SwapPane, SwapPaneArgs{ FocusDirection::Down } }, swapPaneMenu);
}
if (auto neighbor = rootPane->NavigateDirection(activePane, FocusDirection::Right, mruPanes))
{
makeItem(RS_(L"SwapPaneRightText"), neighbor->GetProfile().Icon(), ActionAndArgs{ ShortcutAction::SwapPane, SwapPaneArgs{ FocusDirection::Right } }, swapPaneMenu);
}
if (auto neighbor = rootPane->NavigateDirection(activePane, FocusDirection::Up, mruPanes))
{
makeItem(RS_(L"SwapPaneUpText"), neighbor->GetProfile().Icon(), ActionAndArgs{ ShortcutAction::SwapPane, SwapPaneArgs{ FocusDirection::Up } }, swapPaneMenu);
}
if (auto neighbor = rootPane->NavigateDirection(activePane, FocusDirection::Left, mruPanes))
{
makeItem(RS_(L"SwapPaneLeftText"), neighbor->GetProfile().Icon(), ActionAndArgs{ ShortcutAction::SwapPane, SwapPaneArgs{ FocusDirection::Left } }, swapPaneMenu);
}
makeMenuItem(RS_(L"SwapPaneText"), L"\xF1CB", swapPaneMenu, menu);
makeItem(RS_(L"TogglePaneZoomText"), L"\xE8A3", ActionAndArgs{ ShortcutAction::TogglePaneZoom, nullptr }, menu);
makeItem(RS_(L"CloseOtherPanesText"), L"\xE89F", ActionAndArgs{ ShortcutAction::CloseOtherPanes, nullptr }, menu);
makeItem(RS_(L"PaneClose"), L"\xE89F", ActionAndArgs{ ShortcutAction::ClosePane, nullptr }, menu);
makeItem(RS_(L"PaneClose"), L"\xE89F", ActionAndArgs{ ShortcutAction::ClosePane, nullptr });
}
if (control.ConnectionState() >= ConnectionState::Closed)
{
makeItem(RS_(L"RestartConnectionText"), L"\xE72C", ActionAndArgs{ ShortcutAction::RestartConnection, nullptr }, menu);
makeItem(RS_(L"RestartConnectionText"), L"\xE72C", ActionAndArgs{ ShortcutAction::RestartConnection, nullptr });
}
if (withSelection)
{
makeItem(RS_(L"SearchWebText"), L"\xF6FA", ActionAndArgs{ ShortcutAction::SearchForText, nullptr }, menu);
makeItem(RS_(L"SearchWebText"), L"\xF6FA", ActionAndArgs{ ShortcutAction::SearchForText, nullptr });
}
makeItem(RS_(L"TabClose"), L"\xE711", ActionAndArgs{ ShortcutAction::CloseTab, CloseTabArgs{ _GetFocusedTabIndex().value() } }, menu);
makeItem(RS_(L"TabClose"), L"\xE711", ActionAndArgs{ ShortcutAction::CloseTab, CloseTabArgs{ _GetFocusedTabIndex().value() } });
}
void TerminalPage::_PopulateQuickFixMenu(const TermControl& control,
@@ -5382,8 +5252,8 @@ namespace winrt::TerminalApp::implementation
_sendDraggedTabToWindow(winrt::to_hstring(args.TargetWindow()), args.TabIndex(), std::nullopt);
}
void TerminalPage::_onTabDroppedOutside(winrt::IInspectable /*sender*/,
winrt::MUX::Controls::TabViewTabDroppedOutsideEventArgs /*e*/)
void TerminalPage::_onTabDroppedOutside(winrt::IInspectable sender,
winrt::MUX::Controls::TabViewTabDroppedOutsideEventArgs e)
{
// Get the current pointer point from the CoreWindow
const auto& pointerPoint{ CoreWindow::GetForCurrentThread().PointerPosition() };

View File

@@ -113,7 +113,7 @@ namespace winrt::TerminalApp::implementation
safe_void_coroutine RequestQuit();
safe_void_coroutine CloseWindow();
void PersistState(bool serializeBuffer);
void PersistState();
void ToggleFocusMode();
void ToggleFullscreen();

View File

@@ -137,9 +137,6 @@
DefaultButton="Primary">
<TextBlock IsTextSelectionEnabled="True"
TextWrapping="WrapWholeWords">
<TextBlock.ContextFlyout>
<mtu:TextMenuFlyout />
</TextBlock.ContextFlyout>
<Run x:Name="NoticeMessage" />
</TextBlock>
</ContentDialog>
@@ -151,9 +148,6 @@
DefaultButton="Primary">
<TextBlock IsTextSelectionEnabled="True"
TextWrapping="WrapWholeWords">
<TextBlock.ContextFlyout>
<mtu:TextMenuFlyout />
</TextBlock.ContextFlyout>
<Run x:Name="CouldNotOpenUriReason" /> <LineBreak />
<Run x:Name="UnopenedUri"
FontFamily="Cascadia Mono" />
@@ -197,11 +191,7 @@
<TextBox x:Name="WindowRenamerTextBox"
KeyDown="_WindowRenamerKeyDown"
KeyUp="_WindowRenamerKeyUp"
Text="{x:Bind WindowProperties.WindowName, Mode=OneWay}">
<TextBox.ContextFlyout>
<mtu:TextMenuFlyout />
</TextBox.ContextFlyout>
</TextBox>
Text="{x:Bind WindowProperties.WindowName, Mode=OneWay}" />
</mux:TeachingTip.Content>
</mux:TeachingTip>

View File

@@ -141,7 +141,7 @@ namespace winrt::TerminalApp::implementation
// "attach existing" rather than a "create"
args.ContentId(_control.ContentId());
break;
case BuildStartupKind::PersistAll:
case BuildStartupKind::Persist:
{
const auto connection = _control.Connection();
const auto id = connection ? connection.SessionId() : winrt::guid{};
@@ -156,7 +156,6 @@ namespace winrt::TerminalApp::implementation
}
break;
}
case BuildStartupKind::PersistLayout:
default:
break;
}

View File

@@ -91,7 +91,6 @@ namespace winrt::TerminalApp::implementation
winrt::TerminalApp::TaskbarState GetCombinedTaskbarState() const;
std::shared_ptr<Pane> GetRootPane() const { return _rootPane; }
std::vector<uint32_t> GetMruPanes() const { return _mruPanes; }
winrt::TerminalApp::TerminalTabStatus TabStatus()
{

View File

@@ -55,7 +55,6 @@ static const std::array settingsLoadWarningsLabels{
USES_RESOURCE(L"UnknownTheme"),
USES_RESOURCE(L"DuplicateRemainingProfilesEntry"),
USES_RESOURCE(L"InvalidUseOfContent"),
USES_RESOURCE(L"InvalidRegex"),
};
static_assert(settingsLoadWarningsLabels.size() == static_cast<size_t>(SettingsLoadWarnings::WARNINGS_SIZE));
@@ -266,11 +265,11 @@ namespace winrt::TerminalApp::implementation
AppLogic::Current()->NotifyRootInitialized();
}
void TerminalWindow::PersistState(bool serializeBuffer)
void TerminalWindow::PersistState()
{
if (_root)
{
_root->PersistState(serializeBuffer);
_root->PersistState();
}
}
@@ -434,7 +433,6 @@ namespace winrt::TerminalApp::implementation
auto buttonText = RS_(L"Ok");
Controls::TextBlock warningsTextBlock;
warningsTextBlock.ContextFlyout(winrt::Microsoft::Terminal::UI::TextMenuFlyout{});
// Make sure you can copy-paste
warningsTextBlock.IsTextSelectionEnabled(true);
// Make sure the lines of text wrap
@@ -484,7 +482,6 @@ namespace winrt::TerminalApp::implementation
auto buttonText = RS_(L"Ok");
Controls::TextBlock warningsTextBlock;
warningsTextBlock.ContextFlyout(winrt::Microsoft::Terminal::UI::TextMenuFlyout{});
// Make sure you can copy-paste
warningsTextBlock.IsTextSelectionEnabled(true);
// Make sure the lines of text wrap

View File

@@ -71,7 +71,7 @@ namespace winrt::TerminalApp::implementation
void Create();
void PersistState(bool serializeBuffer);
void PersistState();
void UpdateSettings(winrt::TerminalApp::SettingsLoadEventArgs args);

View File

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

View File

@@ -1,22 +0,0 @@
The MIT License (MIT)
Copyright (c) 2013-2024 Junegunn Choi
Copyright (c) 2021-2025 Simon Hauser
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@@ -1,432 +0,0 @@
#include "pch.h"
#include "fzf.h"
#undef CharLower
#undef CharUpper
using namespace fzf::matcher;
constexpr int16_t ScoreMatch = 16;
constexpr int16_t ScoreGapStart = -3;
constexpr int16_t ScoreGapExtension = -1;
constexpr int16_t BoundaryBonus = ScoreMatch / 2;
constexpr int16_t NonWordBonus = ScoreMatch / 2;
constexpr int16_t CamelCaseBonus = BoundaryBonus + ScoreGapExtension;
constexpr int16_t BonusConsecutive = -(ScoreGapStart + ScoreGapExtension);
constexpr int16_t BonusFirstCharMultiplier = 2;
constexpr size_t npos = std::numeric_limits<size_t>::max();
enum class CharClass : uint8_t
{
NonWord = 0,
CharLower = 1,
CharUpper = 2,
Digit = 3,
};
static std::vector<UChar32> utf16ToUtf32(std::wstring_view text)
{
const UChar* data = reinterpret_cast<const UChar*>(text.data());
int32_t dataLen = static_cast<int32_t>(text.size());
int32_t cpCount = u_countChar32(data, dataLen);
std::vector<UChar32> out(cpCount);
UErrorCode status = U_ZERO_ERROR;
u_strToUTF32(out.data(), static_cast<int32_t>(out.size()), nullptr, data, dataLen, &status);
THROW_HR_IF(E_UNEXPECTED, status > U_ZERO_ERROR);
return out;
}
static void foldStringUtf32(std::vector<UChar32>& str)
{
for (auto& cp : str)
{
cp = u_foldCase(cp, U_FOLD_CASE_DEFAULT);
}
}
static size_t trySkip(const std::vector<UChar32>& input, const UChar32 searchChar, size_t startIndex)
{
for (size_t i = startIndex; i < input.size(); ++i)
{
if (input[i] == searchChar)
{
return i;
}
}
return npos;
}
// Unlike the equivalent in fzf, this one does more than Unicode.
static size_t asciiFuzzyIndex(const std::vector<UChar32>& input, const std::vector<UChar32>& pattern)
{
size_t idx = 0;
size_t firstIdx = 0;
for (size_t pi = 0; pi < pattern.size(); ++pi)
{
idx = trySkip(input, pattern[pi], idx);
if (idx == npos)
{
return npos;
}
if (pi == 0 && idx > 0)
{
firstIdx = idx - 1;
}
idx++;
}
return firstIdx;
}
static int16_t calculateBonus(CharClass prevClass, CharClass currentClass)
{
if (prevClass == CharClass::NonWord && currentClass != CharClass::NonWord)
{
return BoundaryBonus;
}
if ((prevClass == CharClass::CharLower && currentClass == CharClass::CharUpper) ||
(prevClass != CharClass::Digit && currentClass == CharClass::Digit))
{
return CamelCaseBonus;
}
if (currentClass == CharClass::NonWord)
{
return NonWordBonus;
}
return 0;
}
static constexpr auto s_charClassLut = []() {
std::array<CharClass, U_CHAR_CATEGORY_COUNT> lut{};
lut.fill(CharClass::NonWord);
lut[U_UPPERCASE_LETTER] = CharClass::CharUpper;
lut[U_LOWERCASE_LETTER] = CharClass::CharLower;
lut[U_MODIFIER_LETTER] = CharClass::CharLower;
lut[U_OTHER_LETTER] = CharClass::CharLower;
lut[U_DECIMAL_DIGIT_NUMBER] = CharClass::Digit;
return lut;
}();
static CharClass classOf(UChar32 ch)
{
return s_charClassLut[u_charType(ch)];
}
static int32_t fzfFuzzyMatchV2(const std::vector<UChar32>& text, const std::vector<UChar32>& pattern, std::vector<size_t>* pos)
{
if (pattern.size() == 0)
{
return 0;
}
auto foldedText = text;
foldStringUtf32(foldedText);
size_t firstIndexOf = asciiFuzzyIndex(foldedText, pattern);
if (firstIndexOf == npos)
{
return 0;
}
auto initialScores = std::vector<int16_t>(text.size());
auto consecutiveScores = std::vector<int16_t>(text.size());
auto firstOccurrenceOfEachChar = std::vector<size_t>(pattern.size());
auto bonusesSpan = std::vector<int16_t>(text.size());
int16_t maxScore = 0;
size_t maxScorePos = 0;
size_t patternIndex = 0;
size_t lastIndex = 0;
UChar32 firstPatternChar = pattern[0];
UChar32 currentPatternChar = pattern[0];
int16_t previousInitialScore = 0;
CharClass previousClass = CharClass::NonWord;
bool inGap = false;
std::span<const UChar32> lowerText(foldedText);
auto lowerTextSlice = lowerText.subspan(firstIndexOf);
auto initialScoresSlice = std::span(initialScores).subspan(firstIndexOf);
auto consecutiveScoresSlice = std::span(consecutiveScores).subspan(firstIndexOf);
auto bonusesSlice = std::span(bonusesSpan).subspan(firstIndexOf, text.size() - firstIndexOf);
for (size_t i = 0; i < lowerTextSlice.size(); i++)
{
const auto currentChar = lowerTextSlice[i];
const auto currentClass = classOf(text[i + firstIndexOf]);
const auto bonus = calculateBonus(previousClass, currentClass);
bonusesSlice[i] = bonus;
previousClass = currentClass;
//currentPatternChar was already folded in ParsePattern
if (currentChar == currentPatternChar)
{
if (patternIndex < pattern.size())
{
firstOccurrenceOfEachChar[patternIndex] = firstIndexOf + i;
patternIndex++;
if (patternIndex < pattern.size())
{
currentPatternChar = pattern[patternIndex];
}
}
lastIndex = firstIndexOf + i;
}
if (currentChar == firstPatternChar)
{
int16_t score = ScoreMatch + bonus * BonusFirstCharMultiplier;
initialScoresSlice[i] = score;
consecutiveScoresSlice[i] = 1;
if (pattern.size() == 1 && (score > maxScore))
{
maxScore = score;
maxScorePos = firstIndexOf + i;
if (bonus == BoundaryBonus)
{
break;
}
}
inGap = false;
}
else
{
initialScoresSlice[i] = std::max<int16_t>(previousInitialScore + (inGap ? ScoreGapExtension : ScoreGapStart), 0);
consecutiveScoresSlice[i] = 0;
inGap = true;
}
previousInitialScore = initialScoresSlice[i];
}
if (patternIndex != pattern.size())
{
return 0;
}
if (pattern.size() == 1)
{
if (pos)
{
pos->push_back(maxScorePos);
}
return maxScore;
}
const auto firstOccurrenceOfFirstChar = firstOccurrenceOfEachChar[0];
const auto width = lastIndex - firstOccurrenceOfFirstChar + 1;
const auto rows = pattern.size();
auto consecutiveCharMatrixSize = width * pattern.size();
std::vector<int16_t> scoreMatrix(width * rows);
std::copy_n(initialScores.begin() + firstOccurrenceOfFirstChar, width, scoreMatrix.begin());
std::span scoreSpan(scoreMatrix);
std::vector<int16_t> consecutiveCharMatrix(width * rows);
std::copy_n(consecutiveScores.begin() + firstOccurrenceOfFirstChar, width, consecutiveCharMatrix.begin());
std::span consecutiveCharMatrixSpan(consecutiveCharMatrix);
auto patternSliceStr = std::span(pattern).subspan(1);
for (size_t off = 0; off < pattern.size() - 1; off++)
{
auto patternCharOffset = firstOccurrenceOfEachChar[off + 1];
auto sliceLen = lastIndex - patternCharOffset + 1;
currentPatternChar = patternSliceStr[off];
patternIndex = off + 1;
auto row = patternIndex * width;
inGap = false;
std::span<const UChar32> textSlice = lowerText.subspan(patternCharOffset, sliceLen);
std::span bonusSlice(bonusesSpan.begin() + patternCharOffset, textSlice.size());
std::span<int16_t> consecutiveCharMatrixSlice = consecutiveCharMatrixSpan.subspan(row + patternCharOffset - firstOccurrenceOfFirstChar, textSlice.size());
std::span<int16_t> consecutiveCharMatrixDiagonalSlice = consecutiveCharMatrixSpan.subspan(row + patternCharOffset - firstOccurrenceOfFirstChar - 1 - width, textSlice.size());
std::span<int16_t> scoreMatrixSlice = scoreSpan.subspan(row + patternCharOffset - firstOccurrenceOfFirstChar, textSlice.size());
std::span<int16_t> scoreMatrixDiagonalSlice = scoreSpan.subspan(row + patternCharOffset - firstOccurrenceOfFirstChar - 1 - width, textSlice.size());
std::span<int16_t> scoreMatrixLeftSlice = scoreSpan.subspan(row + patternCharOffset - firstOccurrenceOfFirstChar - 1, textSlice.size());
if (!scoreMatrixLeftSlice.empty())
{
scoreMatrixLeftSlice[0] = 0;
}
for (size_t j = 0; j < textSlice.size(); j++)
{
const auto currentChar = textSlice[j];
const auto column = patternCharOffset + j;
const int16_t score = inGap ? scoreMatrixLeftSlice[j] + ScoreGapExtension : scoreMatrixLeftSlice[j] + ScoreGapStart;
int16_t diagonalScore = 0;
int16_t consecutive = 0;
if (currentChar == currentPatternChar)
{
diagonalScore = scoreMatrixDiagonalSlice[j] + ScoreMatch;
int16_t bonus = bonusSlice[j];
consecutive = consecutiveCharMatrixDiagonalSlice[j] + 1;
if (bonus == BoundaryBonus)
{
consecutive = 1;
}
else if (consecutive > 1)
{
bonus = std::max({ bonus, BonusConsecutive, (bonusesSpan[column - consecutive + 1]) });
}
if (diagonalScore + bonus < score)
{
diagonalScore += bonusSlice[j];
consecutive = 0;
}
else
{
diagonalScore += bonus;
}
}
consecutiveCharMatrixSlice[j] = consecutive;
inGap = (diagonalScore < score);
int16_t cellScore = std::max(int16_t{ 0 }, std::max(diagonalScore, score));
if (off + 2 == pattern.size() && cellScore > maxScore)
{
maxScore = cellScore;
maxScorePos = column;
}
scoreMatrixSlice[j] = cellScore;
}
}
size_t currentColIndex = maxScorePos;
if (pos)
{
patternIndex = pattern.size() - 1;
bool preferCurrentMatch = true;
while (true)
{
const auto rowStartIndex = patternIndex * width;
const auto colOffset = currentColIndex - firstOccurrenceOfFirstChar;
const auto cellScore = scoreMatrix[rowStartIndex + colOffset];
int32_t diagonalCellScore = 0;
int32_t leftCellScore = 0;
if (patternIndex > 0 && currentColIndex >= firstOccurrenceOfEachChar[patternIndex])
{
diagonalCellScore = scoreMatrix[rowStartIndex - width + colOffset - 1];
}
if (currentColIndex > firstOccurrenceOfEachChar[patternIndex])
{
leftCellScore = scoreMatrix[rowStartIndex + colOffset - 1];
}
if (cellScore > diagonalCellScore &&
(cellScore > leftCellScore || (cellScore == leftCellScore && preferCurrentMatch)))
{
pos->push_back(currentColIndex);
if (patternIndex == 0)
{
break;
}
patternIndex--;
}
currentColIndex--;
if (rowStartIndex + colOffset >= consecutiveCharMatrixSize)
{
break;
}
preferCurrentMatch = (consecutiveCharMatrix[rowStartIndex + colOffset] > 1) ||
((rowStartIndex + width + colOffset + 1 <
consecutiveCharMatrixSize) &&
(consecutiveCharMatrix[rowStartIndex + width + colOffset + 1] > 0));
}
}
return maxScore;
}
Pattern fzf::matcher::ParsePattern(const std::wstring_view patternStr)
{
Pattern patObj;
size_t pos = 0;
while (true)
{
const auto beg = patternStr.find_first_not_of(L' ', pos);
if (beg == std::wstring_view::npos)
{
break; // No more non-space characters
}
const auto end = std::min(patternStr.size(), patternStr.find_first_of(L' ', beg));
const auto word = patternStr.substr(beg, end - beg);
auto codePoints = utf16ToUtf32(word);
foldStringUtf32(codePoints);
patObj.terms.push_back(std::move(codePoints));
pos = end;
}
return patObj;
}
std::optional<MatchResult> fzf::matcher::Match(std::wstring_view text, const Pattern& pattern)
{
if (pattern.terms.empty())
{
return MatchResult{};
}
const auto textCodePoints = utf16ToUtf32(text);
int32_t totalScore = 0;
std::vector<size_t> allUtf32Pos;
for (const auto& term : pattern.terms)
{
std::vector<size_t> termPos;
auto score = fzfFuzzyMatchV2(textCodePoints, term, &termPos);
if (score <= 0)
{
return std::nullopt;
}
totalScore += score;
allUtf32Pos.insert(allUtf32Pos.end(), termPos.begin(), termPos.end());
}
std::ranges::sort(allUtf32Pos);
allUtf32Pos.erase(std::ranges::unique(allUtf32Pos).begin(), allUtf32Pos.end());
std::vector<TextRun> runs;
std::size_t nextCodePointPos = 0;
size_t utf16Offset = 0;
bool inRun = false;
size_t runStart = 0;
for (size_t cpIndex = 0; cpIndex < textCodePoints.size(); cpIndex++)
{
const auto cp = textCodePoints[cpIndex];
const size_t cpWidth = U16_LENGTH(cp);
const bool isMatch = (nextCodePointPos < allUtf32Pos.size() && allUtf32Pos[nextCodePointPos] == cpIndex);
if (isMatch)
{
if (!inRun)
{
runStart = utf16Offset;
inRun = true;
}
nextCodePointPos++;
}
else if (inRun)
{
runs.push_back({ runStart, utf16Offset - 1 });
inRun = false;
}
utf16Offset += cpWidth;
}
if (inRun)
{
runs.push_back({ runStart, utf16Offset - 1 });
}
return MatchResult{ totalScore, std::move(runs) };
}

View File

@@ -1,27 +0,0 @@
#pragma once
#include <vector>
#include <icu.h>
namespace fzf::matcher
{
struct TextRun
{
size_t Start;
size_t End;
};
struct MatchResult
{
int32_t Score = 0;
std::vector<TextRun> Runs;
};
struct Pattern
{
std::vector<std::vector<UChar32>> terms;
};
Pattern ParsePattern(std::wstring_view patternStr);
std::optional<MatchResult> Match(std::wstring_view text, const Pattern& pattern);
}

View File

@@ -428,20 +428,6 @@ namespace winrt::Microsoft::Terminal::TerminalConnection::implementation
TerminalOutput.raise(L"\r\n");
TerminalOutput.raise(badPathText);
}
// If the requested action requires elevation, display appropriate message
else if (hr == HRESULT_FROM_WIN32(ERROR_ELEVATION_REQUIRED))
{
const auto elevationText = RS_(L"ElevationRequired");
TerminalOutput.raise(L"\r\n");
TerminalOutput.raise(elevationText);
}
// If the requested executable was not found, display appropriate message
else if (hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND))
{
const auto fileNotFoundText = RS_(L"FileNotFound");
TerminalOutput.raise(L"\r\n");
TerminalOutput.raise(fileNotFoundText);
}
_transitionToState(ConnectionState::Failed);

View File

@@ -209,7 +209,7 @@
</data>
<data name="CtrlDToClose" xml:space="preserve">
<value>Sie können dieses Terminal jetzt mit STRG+D schließen oder zum Neustart die EINGABETASTE drücken.</value>
<comment>"Ctrl+D" and "Enter" represent keys the user will press (control+D and Enter).</comment>
<comment>"Ctrl+D" and "Enter" represent keys the user will press (control+D and Enter).</comment>
</data>
<data name="ProcessFailedToLaunch" xml:space="preserve">
<value>[Fehler {0} beim Start von `{1}']</value>
@@ -220,10 +220,4 @@
<value>Auf das Startverzeichnis „{0}“ konnte nicht zugegriffen werden</value>
<comment>The first argument {0} is a path to a directory on the filesystem, as provided by the user.</comment>
</data>
<data name="ElevationRequired" xml:space="preserve">
<value>Für den angeforderten Vorgang sind erhöhte Rechte erforderlich.</value>
</data>
<data name="FileNotFound" xml:space="preserve">
<value>Die angegebene Datei wurde nicht gefunden.</value>
</data>
</root>

View File

@@ -209,7 +209,7 @@
</data>
<data name="CtrlDToClose" xml:space="preserve">
<value>You can now close this terminal with Ctrl+D, or press Enter to restart.</value>
<comment>"Ctrl+D" and "Enter" represent keys the user will press (control+D and Enter).</comment>
<comment>"Ctrl+D" and "Enter" represent keys the user will press (control+D and Enter).</comment>
</data>
<data name="ProcessFailedToLaunch" xml:space="preserve">
<value>[error {0} when launching `{1}']</value>
@@ -220,10 +220,4 @@
<value>Could not access starting directory "{0}"</value>
<comment>The first argument {0} is a path to a directory on the filesystem, as provided by the user.</comment>
</data>
<data name="ElevationRequired" xml:space="preserve">
<value>The requested operation requires elevation.</value>
</data>
<data name="FileNotFound" xml:space="preserve">
<value>The system cannot find the file specified.</value>
</data>
</root>
</root>

View File

@@ -209,7 +209,7 @@
</data>
<data name="CtrlDToClose" xml:space="preserve">
<value>Ahora puede cerrar este terminal con Ctrl+D o presionar Entrar para reiniciar.</value>
<comment>"Ctrl+D" and "Enter" represent keys the user will press (control+D and Enter).</comment>
<comment>"Ctrl+D" and "Enter" represent keys the user will press (control+D and Enter).</comment>
</data>
<data name="ProcessFailedToLaunch" xml:space="preserve">
<value>[error {0} al iniciar `{1}']</value>
@@ -220,10 +220,4 @@
<value>No se pudo obtener acceso al directorio inicial «{0}»</value>
<comment>The first argument {0} is a path to a directory on the filesystem, as provided by the user.</comment>
</data>
<data name="ElevationRequired" xml:space="preserve">
<value>La operación solicitada requiere elevación.</value>
</data>
<data name="FileNotFound" xml:space="preserve">
<value>El sistema no puede encontrar el archivo especificado.</value>
</data>
</root>

View File

@@ -209,7 +209,7 @@
</data>
<data name="CtrlDToClose" xml:space="preserve">
<value>Vous pouvez maintenant fermer ce terminal avec Ctrl+D, ou appuyez sur Entrée pour redémarrer.</value>
<comment>"Ctrl+D" and "Enter" represent keys the user will press (control+D and Enter).</comment>
<comment>"Ctrl+D" and "Enter" represent keys the user will press (control+D and Enter).</comment>
</data>
<data name="ProcessFailedToLaunch" xml:space="preserve">
<value>[erreur {0} lors du lancement de `{1}']</value>
@@ -220,10 +220,4 @@
<value>Le démarrage du répertoire nest pas accessible «{0}»</value>
<comment>The first argument {0} is a path to a directory on the filesystem, as provided by the user.</comment>
</data>
<data name="ElevationRequired" xml:space="preserve">
<value>Lopération demandée nécessite une élévation.</value>
</data>
<data name="FileNotFound" xml:space="preserve">
<value>Le fichier spécifié est introuvable.</value>
</data>
</root>

View File

@@ -209,7 +209,7 @@
</data>
<data name="CtrlDToClose" xml:space="preserve">
<value>È ora possibile chiudere il terminale con CTRL+D oppure premere INVIO per riavviarlo.</value>
<comment>"Ctrl+D" and "Enter" represent keys the user will press (control+D and Enter).</comment>
<comment>"Ctrl+D" and "Enter" represent keys the user will press (control+D and Enter).</comment>
</data>
<data name="ProcessFailedToLaunch" xml:space="preserve">
<value>[errore {0} durante l'avvio di `{1}']</value>
@@ -220,10 +220,4 @@
<value>Non è possibile accedere alla directory di avvio "{0}"</value>
<comment>The first argument {0} is a path to a directory on the filesystem, as provided by the user.</comment>
</data>
<data name="ElevationRequired" xml:space="preserve">
<value>Per l'operazione richiesta è necessaria l'elevazione dei privilegi.</value>
</data>
<data name="FileNotFound" xml:space="preserve">
<value>Impossibile trovare il file specificato.</value>
</data>
</root>

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