Compare commits

...

29 Commits

Author SHA1 Message Date
Leonard Hecker
24475acba8 Add input scope startup setting (#17953)
This adds a "defaultInputScope" setting, hooks it up to our TSF,
and exposes it as a setting in the UI under the startup page.
In order to stay close with the other language setting, I moved that
one from the appearance to the startup page as well.
20 out of the 26 files in this PR are boilerplate unfortunately.

Closes #17816

## Validation Steps Performed
* Install and use the Chinese IME
* Launch WT
* Chinese input 
* Change setting to `alphanumericHalfWidth`
* Restart WT
* English input 

(cherry picked from commit fc606d2bae)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgTTKAI
Service-Version: 1.22
2024-09-26 14:58:14 -05:00
James Holderness
2a8dee286e Add support for resetting the color scheme with RIS (#17879)
## Summary of the Pull Request

This improves our `RIS` (hard reset) implementation, so it now also
resets any changes that are made to the color table and color aliases,
which is one of the things it's supposed to be doing.

## References and Relevant Issues

This is also a small step towards implementing the `OSC` sequences that
reset individual color table entries (issue #3719).

## Detailed Description of the Pull Request / Additional comments

The way this works is by having a second copy of the color table and
alias indices to hold the default values in the `RenderSettings` class.
This default set is initially populated at startup with the user's
chosen color scheme, but can also potentially be updated if the user
changes their settings while a session is already in progress.

When we receive an `RIS` request, we just copy the default values back
over the active settings, and refresh the renderer.

## Validation Steps Performed

I've manually tested both OpenConsole and Windows Terminal by changing
my color scheme programmatically, and then confirming that the original
colors are restored when an `RIS` sequence is received.

I've also added some basic unit tests that check both the color aliases
and color table are restored by `RIS`.

## PR Checklist
- [x] Tests added/passed

(cherry picked from commit 5e8e10fdc0)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgTTOyY
Service-Version: 1.22
2024-09-26 14:58:13 -05:00
Windows Console Service Bot
181448908e Localization Updates - main - 09/26/2024 19:14:21 (#17958)
Closes #17752
Closes #17764
Closes #17830

(cherry picked from commit 59dc5eff42)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgTX8OU
Service-Version: 1.22
2024-09-26 14:23:01 -05:00
Leonard Hecker
e5f0af22d7 Stop updating AutoSuggestBox on selection (#17961)
`AutoSuggestBox` has a `SuggestionChosen` event and any reasonable
person would assume that this means one of the items was chosen.
But with WinUI it's raised whenever a suggestion is merely highlighted.
`QuerySubmitted` is the right event instead. Clearly that naming is
a lot better than `SuggestionChosen`, since the property to get the
chosen item is called `ChosenSuggestion`.
WinUI, like the unrelenting wilderness of a world indifferent to human
suffering, stands as a testament to the futility of human aspiration.

Closes #17916

## Validation Steps Performed
* Type "Casc"
* Move up/down with the arrow keys
* Neither the filtered list nor the text updates 
* Press Enter on an item
* Text updates 

(cherry picked from commit bcac9993cb)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgTW9-o
Service-Version: 1.22
2024-09-26 14:23:00 -05:00
Carlos Zamora
c49d79a1ec Improve color contrast of reset button in SUI (#17912)
Adds a theme resource for the color of the reset button in the settings UI.

Closes #17902

(cherry picked from commit 0bd19e9cfc)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgTTb0w
Service-Version: 1.22
2024-09-26 14:22:59 -05:00
Leonard Hecker
ff7f1a7c83 Fix clear buffer command (#17884)
Without a VT "renderer" there's no implicit output anymore when
calling `ClearPseudoConsole`. The fix is trivial, but it works
slightly different from before: Previously, we would preserve
the line the cursor is on, while this PR doesn't do that.
I felt like there's not much merit in preserving the line,
because it may be a multi-line prompt which won't work with that.

Closes #17867

## Validation Steps Performed
Bind 3 different actions to the 3 variants of "Clear buffer"
and test them. They work. 

(cherry picked from commit 4259ce535f)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgS3NbU
Service-Version: 1.22
2024-09-24 14:12:18 -05:00
Leonard Hecker
9b8c0602a2 Stop scrolling on output when search is open (#17885)
* Don't reset the position entirely when changing the needle
* Don't change the scroll position when output arrives
* Don't interfere with the search when output arrives constantly

Closes #17301

## Validation Steps Performed
* In pwsh, run `10000..20000 | % { sleep 0.25; $_ }`
  * You can search for e.g. `1004` and it'll find 10 results. 
  * You can scroll up and down past it and it won't snap back
    when new output arrives. 
* `while ($true) { Write-Host -NoNewline "`e[Ha"; sleep 0.0001; }`
  * You can cycle between the hits effortlessly.  (This tests that
    the constantly reset `OutputIdle` event won't interfere.)
* On input change, the focused result is near the previous one. 

(cherry picked from commit d9131c6889)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgS3elo PVTI_lADOAF3p4s4AmhmQzgTEciM
Service-Version: 1.22
2024-09-24 14:08:04 -05:00
Leonard Hecker
ea60f14627 Fix a cooked read deadlock (#17905)
Because `_layoutLine` would never return `column == columnLimit` for
control character visualizers, we'd get a deadlock in `_redisplay`,
as it tries to fill the line until it's full, but never achieve it.

Closes #17893

## Validation Steps Performed
* Press Ctrl-A to insert "^A"
* Press Home to get to the start of the prompt
* Press and hold "A" until the line wraps
* The line wraps and there's no deadlock 

(cherry picked from commit 0ce654eaf6)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgTEJwI
Service-Version: 1.22
2024-09-24 14:08:03 -05:00
James Holderness
145babeae0 Fix a sixel crash when the buffer is reflowed (#17951)
## Summary of the Pull Request

The sixel parser has an internal buffer that holds the indexed-color
representation of the image, prior to it being translated to RGB. This
buffer only retains the section of the image that is within the visible
viewport, so we're continually erasing segments from the top of it when
the image is large enough to trigger a scroll.

But there is a problem that arises if the window or font is resized so
that the buffer needs to reflow, because that can result in the image
being pushed entirely offscreen. At that point the segment we're trying
to erase is actually larger than the buffer itself, which can end up
causing the terminal to crash

To fix this, we just need to check for an oversized erase attempt and
simply clear the buffer instead.

## Validation Steps Performed

I could easily reproduce this crash in Windows Terminal by resizing the
font while viewing an animated gif with img2sixel. With this PR applied
the crash no longer occurs.

## PR Checklist
- [x] Closes #17947

(cherry picked from commit fc586e2662)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgTTKv4
Service-Version: 1.22
2024-09-24 14:08:01 -05:00
Leonard Hecker
a2d7742567 Check EnableHexNumpad before enabling it (#17954)
This just adds a quick registry check for `EnableHexNumpad`.

Depends on #17774
Closes #17762 (again)

## Validation Steps Performed
* Alt + NumpadAdd + 221E doesn't do anything 
* Set the `EnableHexNumpad` registry key
* Restart
* Alt + NumpadAdd + 221E inserts ∞ 

(cherry picked from commit b520da26d4)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgTQseA
Service-Version: 1.22
2024-09-24 14:08:00 -05:00
Carlos Zamora
44315b4909 Fix text scaling issues in settings UI (#17910)
## Summary of the Pull Request
Fixes some issues with truncated text in the settings UI when 200% text
scaling is applied.

For #17897, a minimum height was applied instead of a plain "height".
This ensures that the desired height is applied in general, but under
200% text scaling, we are allowed to grow past that, thus preventing the
truncation of the text.

For #17898, flyouts have a scroll viewer inside them by default. We
actually don't want the scroll viewer because that means the text will
appear "truncated" when in reality, the user is expected to notice the
small scrollbar and scroll horizontally (why that's the default, I will
never know). This PR introduces a new style that can be applied to these
flyouts to cause text wrapping instead of horizontal scrolling. Looked
through the app for any instances where this happens.

For #12006, simply changing the column width from a static value to
"auto" fixes the issue. Frankly, we care more about the text appearing
as a whole (and as whole words). The name of the actions wrap properly
anyways.

Closes #17897
Closes #17898
Closes #12006

(cherry picked from commit a7e47b711a)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgTEfj8
Service-Version: 1.22
2024-09-17 16:05:27 -05:00
Dustin L. Howett
5e8efdf008 build: fix the TSA configuration (#17929)
We are, quite literally, shipping the org chart.

(cherry picked from commit 2c97c0555d)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgTGRAo
Service-Version: 1.22
2024-09-17 16:05:26 -05:00
Leonard Hecker
d95a77b369 Fix a crash on pane close (#17886)
The underlying issue is that the "Pane" is used both as a model and as
a UI element and so a pane loses its content as soon as it is closed,
but the tree only gets reordered after the animation has finished.
This PR is truly just a hotfix, because it doesn't solve this issue,
it only adds checks to the function that crashes.

Closes #17869
Closes #17871

## Validation Steps Performed
* `Split pane` a few times
* Run the "Close all other panes" action
* Doesn't crash 

(cherry picked from commit bc6f3e2275)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgS3Ndk PVTI_lADOAF3p4s4AmhmQzgTEJYM
Service-Version: 1.22
2024-09-16 16:00:36 -05:00
Carlos Zamora
cc132d5e50 Add Feature_QuickFix to preview builds (#17888)
(cherry picked from commit 6196a3d0f7)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgS4Ha8
Service-Version: 1.22
2024-09-16 16:00:35 -05:00
Dustin L. Howett
22731e8673 Remove PackageES in favor of our own versioning package (#17872)
PackageES is deprecated by known scourge-on-earth OneBranch, and is now
the cause of some non-compliance.

I got permission from them to open-source it, so that's coming next.

For now, we can just depend on a package based on our code based on
theirs.

Tested and working for C++ (DLL, EXE), C#, NuGet and MSIX.

(cherry picked from commit 4aa1624cd2)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgTD8is
Service-Version: 1.22
2024-09-16 16:00:34 -05:00
Mike Griese
c129e794f8 Add Feature_SaveSnippet to preview builds (#17881)
whoops. This should have been in preview after I sorted out #17366

----

I did this one on GH so let's hope CI works

(cherry picked from commit c699a468c9)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgS66Co
Service-Version: 1.22
2024-09-16 16:00:32 -05:00
Nihat Uygar Köseer
bd33c7f20b Add tab color indicator for tab switch menu (CTRL+Tab) (#17820)
Added tab color indicator for the tab switch menu. Tab color indicators
have the same color as the background color of the tabs. If a tab has
the default background color, the indicator is not shown in the tab
switch menu.

Closes #17465

(cherry picked from commit 544452dad4)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgS0CZA
Service-Version: 1.22
2024-09-06 18:37:04 -05:00
Leonard Hecker
893f32c642 Fix crash in AppHost::_QuitRequested (#17848)
(cherry picked from commit 00f46e400a)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgSwXpY
Service-Version: 1.22
2024-09-06 18:37:03 -05:00
Leonard Hecker
58a50caf6a Restore contents when a screen info is closed (#17853)
(cherry picked from commit 4eb06fee07)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgSaylY
Service-Version: 1.22
2024-09-06 18:37:03 -05:00
Leonard Hecker
33b0e9dd10 Fix ScrollRect to DECCRA translation (#17849)
By translating the clip rectangle into a source-relative coordinate
space we can calculate the intersection that must be copied
much much more easily. I should've done that from the start.

Closes #17801

## Validation Steps Performed
* Test code provided in #17801

(cherry picked from commit d2c3cfd164)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgSa7nQ
Service-Version: 1.22
2024-09-06 18:37:02 -05:00
James Holderness
385a9a6111 Pass through DCS responses when VT input mode is disabled (#17845)
## Summary of the Pull Request

When an app makes a VT request that returns a `DCS` response, and it
hasn't also enabled VT input mode, the new passthrough implementation
loses that response. All the app receives is an `Alt`+`\` key press
triggered by the `ST` terminator. This PR fixes that issue.

## References and Relevant Issues

This is one of the unresolved issues tracked in #17643.

## Detailed Description of the Pull Request / Additional comments

The way `DCS` sequences are handled in the input state machine engine is
by returning a nullptr from `ActionDcsDispatch`, which tells the state
machine to ignore that content. But the sequence is still buffered, and
when the `ST` terminator is eventually received, that buffer is flushed,
which passes the whole thing through to the app.

Originally this only worked when VT input mode was enabled, otherwise
the `ST` sequence is converted into a key press, and the buffered `DCS`
content is lost. The way it works now is we set a flag when the `DCS`
introducer is received, and if that flag is set when the `ST` arrives,
we know to trigger a flush rather a key press.

## Validation Steps Performed

I've tested a `DA3` request from the cmd shell (i.e. `echo ^[[=c`), and
confirmed that now works as expected. I've also hacked Windows Terminal
to disable win32-input mode, so I could check how it works with conpty
clients generating standard VT input, and confirmed that an `Alt`+`\`
keypress is still translated correctly.

(cherry picked from commit 6e5827add5)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgSwKBc
Service-Version: 1.22
2024-09-06 18:37:01 -05:00
Leonard Hecker
03fc325ad1 Dedup command history by default (#17852)
Under ConPTY we don't load any user settings. `SetUpConsole` notes:
> If we are [ConPTY], we don't want to load any user settings,
> because that could result in some strange rendering results [...]

This enables deduplication by default, which I figured wouldn't cause
any regressions since it's a user-controllable setting anyway, while
it's clearly something the average user wants enabled, for the same
reason that PSReadLine has HistoryNoDuplicates enabled by default.

Closes #17797

## Validation Steps Performed
* Launch conhost, enter 2 commands, press F7, select the older one,
  press Enter, press F7. 2 entries 
* Launch WT, enter 2 commands, press F7, select the older one,
  press Enter, press F7. 2 entries 

(cherry picked from commit 5fdfd51209)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgSN1FQ
Service-Version: 1.22
2024-09-04 15:04:32 -05:00
Leonard Hecker
be99f93094 Avoid dropping Esc characters from VT responses (#17833)
`GetChar` checks if the vkey is VK_ESCAPE. `CharToKeyEvents` however
tries really hard to figure out the vkeys of all characters.
To avoid these issues all we need to do is to simply use the existing
`WriteString` function we already use for all other VT responses.
If it's good for conhost responses, it's good for ConPTY responses.

Additionally, this removes another `IsVtInputEnabled` which was
redundant with `WriteString` which worked exactly the same internally.

Closes #17813
Closes #17851
Probably also related to #17823

* Wrote a small app to send and receive a DA1 request. It works 
* WSL already worked to begin with (and still works now) 
* No double-encoding of mouse input events 

(cherry picked from commit 7b50f12a78)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgSa4RU PVTI_lADOAF3p4s4AmhmQzgStRA0
Service-Version: 1.22
2024-09-04 14:56:05 -05:00
Mike Griese
696fd1196b Fix two ConPTY HWND focus issues (#17828)
Worked with @ekoschik on this one.

## Bug the first: the MSAL window `ixptools` spawns

> The auth prompt in pwsh.exe is disabling the terminal window while its
opened and re-enabling it when the window closes. BUT it is enabling
Terminal after dismissing itself, instead of before, which means
terminal is disabled when activated.
>
> Terminal wants focus on the ISLAND window (a grandchild; island is
parented to bridge, which is parented to terminal’s TLW). When it is
activated, it gets a `WM_SETFOCUS` (in response to DefWindowProc
`WM_ACTIVATE`). From `WM_SETFOCUS` it calls `SetFocus` on the bridge
window, and similarly the bridge calls `SetFocus` on the island.
>
> If the TLW is disabled, these `SetFocus` calls fail (see [this
check](#internal-link-redacted) in `SetFocus`). In the case above, this
leaves Terminal’s TLW as focus, and it doesn’t handle keyboard input.
Note that the window IS foreground/active, but because focus is not on
the island it doesn’t see the keyboard input. Another thing to note is
that clicking on the space to the right of the tabs does NOT revive
keyboard input, but clicking on the tabs or main area does.

> **I recommend having the TLW handle WM_ENABLE and call SetFocus on the
island window.**

And guess what, that works!

## Bug the second: When sublime text is the git `EDITOR`, it doesn't
toss focus back to the Terminal

> In this case, Sublime is calling SFW on the pseudo console window. I
don’t have its code, but it is presumably doing something like
SetForegroundWindow(GetConsoleWindow()). This queues an event to the
pseudo window, and when that event is processed the pseudo window
becomes the active and focus window on the queue (which is shared with
Terminal).
>
> The sublime window dismisses itself and does the above SFW call.
Dismissing immediately activates the Terminal TLW, which does the
triple-focus dance (TLW sets focus on itself, then bridge, then island).
This completes but is overwritten immediately when the pseudo window
activates itself. Note that the pseudo window is active at this point
(not the terminal window).

> **I recommend having the Pseudo console window handle WM_ACTIVATE by
calling SetFocus on the island window (and not passing the message to
DefWindowProc).**

And guess what, that works!

----

Closes #15956 (I did test this)
This might be related to #13388, we'll have folks try canary and check

(cherry picked from commit 17a55da0f9)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgSwIkE
Service-Version: 1.22
2024-09-04 14:55:17 -05:00
Leonard Hecker
649d8b2979 Give spacing marks space (#17826)
Spacing marks are called so, because they have a positive advance
width, unlike their non-spacing neighbors (as the name indicates).
After this we stop assigning such gc=Mc codepoints a zero width.

Closes #17810

(cherry picked from commit 0cb3426281)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgSg1L4
Service-Version: 1.22
2024-09-04 14:55:17 -05:00
PankajBhojwani
3d01439c9f Add action IDs to the color selection commands (#17821)
## Summary of the Pull Request
Add action IDs to the default commands for color selection

## Validation Steps Performed
Color selection commands now show up in the command palette

## PR Checklist
- [x] Closes #17819
- [ ] Tests added/passed
- [ ] Documentation updated
- If checked, please file a pull request on [our docs
repo](https://github.com/MicrosoftDocs/terminal) and link it here: #xxx
- [ ] Schema updated (if necessary)

(cherry picked from commit 1482fd4ecd)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgSawsY PVTI_lADOAF3p4s4AmhmQzgSwIVc
Service-Version: 1.22
2024-09-04 14:55:15 -05:00
Carlos Zamora
85afa41c32 Remove unnecessary FMT (#17795)
There's an unnecessary `fmt::format` here caught in the code review: https://github.com/microsoft/terminal/pull/17678#discussion_r1729426705

This simply removes it.

(cherry picked from commit 93d592bb41)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgSwIS4
Service-Version: 1.22
2024-09-04 14:55:14 -05:00
James Holderness
b3f0afbc8f Make sure a blank title string resets the title (#17802)
## Summary of the Pull Request

When a VT title sequence sets the title to a blank string, that is meant
to trigger a reset to the default starting value. This used to work in
the past because the blank value was dealt with by conhost, so Windows
Terminal never received a blank title, but that's no longer the case
with the new VT passthrough. This PR fixes the issue by getting Windows
Terminal to handle the blank title strings itself.

## References and Relevant Issues

VT passthrough was introduced in PR #17510.

## Validation Steps Performed

I've manually verified that the `OSC 0`, `OSC 2`, and `DECSWT` sequences
now correctly reset the title when passed a blank title string.

## PR Checklist
- [x] Closes #17800

(cherry picked from commit 1f71568c2a)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgSNvr0 PVTI_lADOAF3p4s4AmhmQzgSOFrc
Service-Version: 1.22
2024-09-04 14:55:13 -05:00
Dustin L. Howett
90cfb33c13 PGO: train 1.22 separately 2024-08-23 15:10:47 -05:00
112 changed files with 1705 additions and 974 deletions

View File

@@ -864,6 +864,7 @@ INLINEPREFIX
inproc
Inputkeyinfo
Inputreadhandledata
INPUTSCOPE
INSERTMODE
INTERACTIVITYBASE
INTERCEPTCOPYPASTE
@@ -1289,6 +1290,7 @@ parms
PATCOPY
pathcch
PATTERNID
pbstr
pcb
pcch
PCCHAR
@@ -1374,9 +1376,11 @@ POSTCHARBREAKS
POSX
POSXSCROLL
POSYSCROLL
ppbstr
PPEB
ppf
ppidl
pprg
PPROC
ppropvar
ppsi
@@ -1692,6 +1696,7 @@ srcsrv
SRCSRVTRG
srctool
srect
SRGS
srvinit
srvpipe
ssa
@@ -1838,7 +1843,6 @@ triaging
TRIMZEROHEADINGS
trx
tsa
tsattrs
tsgr
tsm
TStr
@@ -1966,10 +1970,8 @@ vswhere
vtapp
VTE
VTID
vtio
vtmode
vtpipeterm
vtpt
VTRGB
VTRGBTo
vtseq

View File

@@ -1,6 +1,6 @@
{
"instanceUrl": "https://microsoft.visualstudio.com",
"projectName": "OS",
"areaPath": "OS\\Windows Client and Services\\ADEPT\\E4D-Engineered for Developers\\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

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

View File

@@ -59,10 +59,7 @@ jobs:
submodules: true
persistCredentials: True
- task: PkgESSetupBuild@12
displayName: Package ES - Setup Build
inputs:
disableOutputRedirect: true
- template: steps-setup-versioning.yml
- template: steps-download-bin-dir-artifact.yml
parameters:

View File

@@ -69,10 +69,9 @@ jobs:
fetchTags: false # Tags still result in depth > 1 fetch; we don't need them here
submodules: true
persistCredentials: True
- task: PkgESSetupBuild@12
displayName: Package ES - Setup Build
inputs:
disableOutputRedirect: true
- template: steps-setup-versioning.yml
- template: steps-download-bin-dir-artifact.yml
parameters:
buildPlatforms: ${{ parameters.buildPlatforms }}

View File

@@ -57,10 +57,7 @@ jobs:
submodules: true
persistCredentials: True
- task: PkgESSetupBuild@12
displayName: Package ES - Setup Build
inputs:
disableOutputRedirect: true
- template: steps-setup-versioning.yml
- template: steps-download-bin-dir-artifact.yml
parameters:

View File

@@ -44,10 +44,7 @@ jobs:
submodules: true
persistCredentials: True
- task: PkgESSetupBuild@12
displayName: Package ES - Setup Build
inputs:
disableOutputRedirect: true
- template: steps-setup-versioning.yml
- task: DownloadPipelineArtifact@2
displayName: Download all PDBs from all prior build phases

View File

@@ -43,10 +43,7 @@ jobs:
submodules: true
persistCredentials: True
- task: PkgESSetupBuild@12
displayName: Package ES - Setup Build
inputs:
disableOutputRedirect: true
- template: steps-setup-versioning.yml
- task: DownloadPipelineArtifact@2
displayName: Download all PDBs from all prior build phases

View File

@@ -38,10 +38,7 @@ jobs:
submodules: true
persistCredentials: True
- task: PkgESSetupBuild@12
displayName: Package ES - Setup Build
inputs:
disableOutputRedirect: true
- template: steps-setup-versioning.yml
- task: DownloadPipelineArtifact@2
displayName: Download MSIX Bundle Artifact

View File

@@ -92,10 +92,7 @@ stages:
generateSbom: ${{ parameters.generateSbom }}
codeSign: ${{ parameters.codeSign }}
beforeBuildSteps: # Right before we build, lay down the universal package and localizations
- task: PkgESSetupBuild@12
displayName: Package ES - Setup Build
inputs:
disableOutputRedirect: true
- template: ./build/pipelines/templates-v2/steps-setup-versioning.yml@self
- task: UniversalPackages@0
displayName: Download terminal-internal Universal Package
@@ -119,10 +116,7 @@ stages:
generateSbom: ${{ parameters.generateSbom }}
codeSign: ${{ parameters.codeSign }}
beforeBuildSteps:
- task: PkgESSetupBuild@12
displayName: Package ES - Setup Build
inputs:
disableOutputRedirect: true
- template: ./build/pipelines/templates-v2/steps-setup-versioning.yml@self
# WPF doesn't need the localizations or the universal package, but if it does... put them here.
- stage: Package

View File

@@ -130,10 +130,7 @@ extends:
codeSign: ${{ parameters.codeSign }}
signingIdentity: ${{ parameters.signingIdentity }}
beforeBuildSteps: # Right before we build, lay down the universal package and localizations
- task: PkgESSetupBuild@12
displayName: Package ES - Setup Build
inputs:
disableOutputRedirect: true
- template: ./build/pipelines/templates-v2/steps-setup-versioning.yml@self
- task: UniversalPackages@0
displayName: Download terminal-internal Universal Package
@@ -167,10 +164,7 @@ extends:
codeSign: ${{ parameters.codeSign }}
signingIdentity: ${{ parameters.signingIdentity }}
beforeBuildSteps:
- task: PkgESSetupBuild@12
displayName: Package ES - Setup Build
inputs:
disableOutputRedirect: true
- template: ./build/pipelines/templates-v2/steps-setup-versioning.yml@self
# WPF doesn't need the localizations or the universal package, but if it does... put them here.
- stage: Package

View File

@@ -0,0 +1,6 @@
steps:
- pwsh: |-
nuget install Microsoft.Windows.Terminal.Versioning -OutputDirectory _versioning
$VersionRoot = (Get-Item _versioning\Microsoft.Windows.*).FullName
& "$VersionRoot\build\Setup.ps1" -ProjectDirectory "$(Build.SourcesDirectory)" -Verbose
displayName: Set up versioning via M.W.T.V

View File

@@ -16,7 +16,7 @@ bool Search::IsStale(const Microsoft::Console::Render::IRenderData& renderData,
_lastMutationId != renderData.GetTextBuffer().GetLastMutationId();
}
bool Search::Reset(Microsoft::Console::Render::IRenderData& renderData, const std::wstring_view& needle, SearchFlag flags, bool reverse)
void Search::Reset(Microsoft::Console::Render::IRenderData& renderData, const std::wstring_view& needle, SearchFlag flags, bool reverse)
{
const auto& textBuffer = renderData.GetTextBuffer();
@@ -30,15 +30,15 @@ bool Search::Reset(Microsoft::Console::Render::IRenderData& renderData, const st
_results = std::move(result).value_or(std::vector<til::point_span>{});
_index = reverse ? gsl::narrow_cast<ptrdiff_t>(_results.size()) - 1 : 0;
_step = reverse ? -1 : 1;
return true;
}
void Search::MoveToCurrentSelection()
{
if (_renderData->IsSelectionActive())
{
MoveToPoint(_renderData->GetTextBuffer().ScreenToBufferPosition(_renderData->GetSelectionAnchor()));
}
else if (const auto span = _renderData->GetSearchHighlightFocused())
{
MoveToPoint(_step > 0 ? span->start : span->end);
}
}
void Search::MoveToPoint(const til::point anchor) noexcept

View File

@@ -36,9 +36,8 @@ public:
Search() = default;
bool IsStale(const Microsoft::Console::Render::IRenderData& renderData, const std::wstring_view& needle, SearchFlag flags) const noexcept;
bool Reset(Microsoft::Console::Render::IRenderData& renderData, const std::wstring_view& needle, SearchFlag flags, bool reverse);
void Reset(Microsoft::Console::Render::IRenderData& renderData, const std::wstring_view& needle, SearchFlag flags, bool reverse);
void MoveToCurrentSelection();
void MoveToPoint(til::point anchor) noexcept;
void MovePastPoint(til::point anchor) noexcept;
void FindNext(bool reverse) noexcept;

View File

@@ -451,14 +451,9 @@ size_t TextBuffer::FitTextIntoColumns(const std::wstring_view& chars, til::Coord
cwd.GraphemeNext(state, chars);
col += state.width;
// If we ran out of columns, we need to always return `columnLimit` and not `cols`,
// because if we tried inserting a wide glyph into just 1 remaining column it will
// fail to fit, but that remaining column still has been used up. When the caller sees
// `columns == columnLimit` they will line-wrap and continue inserting into the next row.
if (col > columnLimit)
{
columns = columnLimit;
return dist;
break;
}
dist += state.len;
@@ -466,7 +461,7 @@ size_t TextBuffer::FitTextIntoColumns(const std::wstring_view& chars, til::Coord
// But if we simply ran out of text we just need to return the actual number of columns.
columns = col;
return chars.size();
return dist;
}
// Pretend as if `position` is a regular cursor in the TextBuffer.

View File

@@ -154,7 +154,7 @@
<comment>{Locked=qps-ploc,qps-ploca,qps-plocm}</comment>
</data>
<data name="AppDescription" xml:space="preserve">
<value>Nová Terminál Windows</value>
<value>Nový Terminál Windows</value>
</data>
<data name="AppDescriptionPre" xml:space="preserve">
<value>Terminál Windows s náhledem připravovaných funkcí</value>
@@ -164,7 +164,7 @@
<comment>This is a menu item that will be displayed in the Windows File Explorer that launches the Canary version of Windows Terminal. Please mark one of the characters to be an accelerator key.</comment>
</data>
<data name="ShellExtension_OpenInTerminalMenuItem_Preview" xml:space="preserve">
<value>Otevřít náhled &amp;aplikace Terminal</value>
<value>Otevřít &amp;náhled Terminálu</value>
<comment>This is a menu item that will be displayed in the Windows File Explorer that launches the Preview version of Windows Terminal. Please mark one of the characters to be an accelerator key.</comment>
</data>
<data name="ShellExtension_OpenInTerminalMenuItem" xml:space="preserve">

View File

@@ -205,6 +205,13 @@
Visibility="{x:Bind Item.(local:TabPaletteItem.TabStatus).IsInputBroadcastActive, Mode=OneWay}" />
</StackPanel>
<Ellipse Grid.Column="4"
Width="8"
Height="8"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Fill="{x:Bind mtu:Converters.ColorToBrush(Item.(local:TabPaletteItem.TabStatus).TabColorIndicator), Mode=OneWay}" />
</Grid>
</DataTemplate>

View File

@@ -2956,13 +2956,13 @@ bool Pane::ContainsReadOnly() const
// - <none>
void Pane::CollectTaskbarStates(std::vector<winrt::TerminalApp::TaskbarState>& states)
{
if (_IsLeaf())
if (_content)
{
auto tbState{ winrt::make<winrt::TerminalApp::implementation::TaskbarState>(_content.TaskbarState(),
_content.TaskbarProgress()) };
states.push_back(tbState);
}
else
else if (_firstChild && _secondChild)
{
_firstChild->CollectTaskbarStates(states);
_secondChild->CollectTaskbarStates(states);

View File

@@ -154,7 +154,7 @@
<comment>{Locked=qps-ploc,qps-ploca,qps-plocm}</comment>
</data>
<data name="AppDescription" xml:space="preserve">
<value>Nová Terminál Windows</value>
<value>Nový Terminál Windows</value>
</data>
<data name="AppDescriptionPre" xml:space="preserve">
<value>Terminál Windows s náhledem připravovaných funkcí</value>
@@ -164,7 +164,7 @@
<comment>This is a menu item that will be displayed in the Windows File Explorer that launches the Canary version of Windows Terminal. Please mark one of the characters to be an accelerator key.</comment>
</data>
<data name="ShellExtension_OpenInTerminalMenuItem_Preview" xml:space="preserve">
<value>Otevřít náhled &amp;aplikace Terminal</value>
<value>Otevřít &amp;náhled Terminálu</value>
<comment>This is a menu item that will be displayed in the Windows File Explorer that launches the Preview version of Windows Terminal. Please mark one of the characters to be an accelerator key.</comment>
</data>
<data name="ShellExtension_OpenInTerminalMenuItem" xml:space="preserve">

View File

@@ -118,7 +118,7 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="InitialJsonParseErrorText" xml:space="preserve">
<value>파일에서 설정을 로드 하지 못했습니다. 후행 쉼표를 포함여 구문 오류가 있는지 확인 합니다.</value>
<value>파일에서 설정을 로드하지 못했습니다. 후행 쉼표를 포함여 구문 오류가 있는지 확인합니다.</value>
</data>
<data name="MissingDefaultProfileText" xml:space="preserve">
<value>첫 번째 프로필을 사용하여 프로필 목록에서 기본 프로필을 찾을 수 없습니다. "defaultProfile"이 프로필 중 하나의 GUID와 일치하는지 확인합니다.</value>
@@ -319,7 +319,7 @@
<value>상위 창의 백분율로 크기를 지정합니다. (0,1) 사이 값만 유효합니다.</value>
</data>
<data name="CmdNewTabDesc" xml:space="preserve">
<value>새 작업 만들기</value>
<value>새 만들기</value>
</data>
<data name="CmdNTDesc" xml:space="preserve">
<value>"new-tab" 하위 명령의 별칭입니다.</value>
@@ -524,7 +524,7 @@
<value>경고</value>
</data>
<data name="CloseReadOnlyDialog.Content" xml:space="preserve">
<value>읽기 전용 터미널을 닫으려고 합니다. 계속하시겠어요?</value>
<value>읽기 전용 터미널을 닫으려고 합니다. 계속하시겠습니까?</value>
</data>
<data name="LargePasteDialog.CloseButtonText" xml:space="preserve">
<value>취소</value>
@@ -616,7 +616,7 @@
<comment>{0} will be replaced with a number.</comment>
</data>
<data name="CrimsonColorButton.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
<value>홍</value>
<value>홍</value>
</data>
<data name="SteelBlueColorButton.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
<value>강철색</value>

View File

@@ -976,6 +976,7 @@ namespace winrt::TerminalApp::implementation
// active control in this tab. We'll just recalculate the
// current color anyways.
tab->_RecalculateAndApplyTabColor();
tab->_tabStatus.TabColorIndicator(tab->GetTabColor().value_or(Windows::UI::Colors::Transparent()));
}
});
@@ -1617,6 +1618,7 @@ namespace winrt::TerminalApp::implementation
_runtimeTabColor.emplace(color);
_RecalculateAndApplyTabColor();
_tabStatus.TabColorIndicator(color);
}
// Method Description:
@@ -1633,6 +1635,7 @@ namespace winrt::TerminalApp::implementation
_runtimeTabColor.reset();
_RecalculateAndApplyTabColor();
_tabStatus.TabColorIndicator(GetTabColor().value_or(Windows::UI::Colors::Transparent()));
}
winrt::Windows::UI::Xaml::Media::Brush TerminalTab::_BackgroundBrush()

View File

@@ -20,6 +20,7 @@ namespace winrt::TerminalApp::implementation
WINRT_OBSERVABLE_PROPERTY(bool, IsReadOnlyActive, PropertyChanged.raise);
WINRT_OBSERVABLE_PROPERTY(uint32_t, ProgressValue, PropertyChanged.raise);
WINRT_OBSERVABLE_PROPERTY(bool, IsInputBroadcastActive, PropertyChanged.raise);
WINRT_OBSERVABLE_PROPERTY(winrt::Windows::UI::Color, TabColorIndicator, PropertyChanged.raise);
};
}

View File

@@ -15,5 +15,6 @@ namespace TerminalApp
UInt32 ProgressValue { get; set; };
Boolean IsReadOnlyActive { get; set; };
Boolean IsInputBroadcastActive { get; set; };
Windows.UI.Color TabColorIndicator { get; set; };
}
}

View File

@@ -40,6 +40,7 @@
#include <winrt/Windows.UI.Xaml.Automation.Peers.h>
#include <winrt/Windows.UI.Xaml.Controls.h>
#include <winrt/Windows.UI.Xaml.Controls.Primitives.h>
#include <winrt/Windows.UI.Xaml.Shapes.h>
#include <winrt/Windows.UI.Xaml.Data.h>
#include <winrt/Windows.UI.Xaml.Documents.h>
#include <winrt/Windows.UI.Xaml.Input.h>

View File

@@ -1688,38 +1688,41 @@ namespace winrt::Microsoft::Terminal::Control::implementation
SearchResults ControlCore::Search(SearchRequest request)
{
const auto lock = _terminal->LockForWriting();
SearchFlag flags{};
WI_SetFlagIf(flags, SearchFlag::CaseInsensitive, !request.CaseSensitive);
WI_SetFlagIf(flags, SearchFlag::RegularExpression, request.RegularExpression);
const auto searchInvalidated = _searcher.IsStale(*_terminal.get(), request.Text, flags);
if (searchInvalidated || !request.Reset)
if (searchInvalidated || !request.ResetOnly)
{
std::vector<til::point_span> oldResults;
til::point_span oldFocused;
if (const auto focused = _terminal->GetSearchHighlightFocused())
{
oldFocused = *focused;
}
if (searchInvalidated)
{
oldResults = _searcher.ExtractResults();
_searcher.Reset(*_terminal.get(), request.Text, flags, !request.GoForward);
if (SnapSearchResultToSelection())
{
_searcher.MoveToCurrentSelection();
SnapSearchResultToSelection(false);
}
_terminal->SetSearchHighlights(_searcher.Results());
}
else
if (!request.ResetOnly)
{
_searcher.FindNext(!request.GoForward);
}
if (const auto idx = _searcher.CurrentMatch(); idx >= 0)
{
_terminal->SetSearchHighlightFocused(gsl::narrow<size_t>(idx), request.ScrollOffset);
}
_terminal->SetSearchHighlightFocused(gsl::narrow<size_t>(std::max<ptrdiff_t>(0, _searcher.CurrentMatch())));
_renderer->TriggerSearchHighlight(oldResults);
if (const auto focused = _terminal->GetSearchHighlightFocused(); focused && *focused != oldFocused)
{
_terminal->ScrollToSearchHighlight(request.ScrollOffset);
}
}
int32_t totalMatches = 0;
@@ -1747,27 +1750,11 @@ namespace winrt::Microsoft::Terminal::Control::implementation
{
const auto lock = _terminal->LockForWriting();
_terminal->SetSearchHighlights({});
_terminal->SetSearchHighlightFocused({}, 0);
_terminal->SetSearchHighlightFocused(0);
_renderer->TriggerSearchHighlight(_searcher.Results());
_searcher = {};
}
// Method Description:
// - Tells ControlCore to snap the current search result index to currently
// selected text if the search was started using it.
void ControlCore::SnapSearchResultToSelection(bool shouldSnap) noexcept
{
_snapSearchResultToSelection = shouldSnap;
}
// Method Description:
// - Returns true, if we should snap the current search result index to
// the currently selected text after a new search is started, else false.
bool ControlCore::SnapSearchResultToSelection() const noexcept
{
return _snapSearchResultToSelection;
}
void ControlCore::Close()
{
if (!_IsClosing())
@@ -2212,19 +2199,32 @@ namespace winrt::Microsoft::Terminal::Control::implementation
// - <none>
void ControlCore::ClearBuffer(Control::ClearBufferType clearType)
{
if (clearType == Control::ClearBufferType::Scrollback || clearType == Control::ClearBufferType::All)
std::wstring_view command;
switch (clearType)
{
case ClearBufferType::Screen:
command = L"\x1b[H\x1b[2J";
break;
case ClearBufferType::Scrollback:
command = L"\x1b[3J";
break;
case ClearBufferType::All:
command = L"\x1b[H\x1b[2J\x1b[3J";
break;
}
{
const auto lock = _terminal->LockForWriting();
_terminal->EraseScrollback();
_terminal->Write(command);
}
if (clearType == Control::ClearBufferType::Screen || clearType == Control::ClearBufferType::All)
{
// Send a signal to conpty to clear the buffer.
if (auto conpty{ _connection.try_as<TerminalConnection::ConptyConnection>() })
{
// ConPTY will emit sequences to sync up our buffer with its new
// contents.
// Since the clearing of ConPTY occurs asynchronously, this call can result weird issues,
// where a console application still sees contents that we've already deleted, etc.
// The correct way would be for ConPTY to emit the appropriate CSI n J sequences.
conpty.ClearBuffer();
}
}

View File

@@ -228,8 +228,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation
SearchResults Search(SearchRequest request);
const std::vector<til::point_span>& SearchResultRows() const noexcept;
void ClearSearch();
void SnapSearchResultToSelection(bool snap) noexcept;
bool SnapSearchResultToSelection() const noexcept;
void LeftClickOnTerminal(const til::point terminalPosition,
const int numberOfClicks,

View File

@@ -55,7 +55,7 @@ namespace Microsoft.Terminal.Control
Boolean GoForward;
Boolean CaseSensitive;
Boolean RegularExpression;
Boolean Reset;
Boolean ResetOnly;
Int32 ScrollOffset;
};
@@ -148,7 +148,6 @@ namespace Microsoft.Terminal.Control
SearchResults Search(SearchRequest request);
void ClearSearch();
Boolean SnapSearchResultToSelection;
Microsoft.Terminal.Core.Color ForegroundColor { get; };
Microsoft.Terminal.Core.Color BackgroundColor { get; };

View File

@@ -25,6 +25,12 @@ namespace Microsoft.Terminal.Control
Console,
};
enum DefaultInputScope
{
Default,
AlphanumericHalfWidth,
};
runtimeclass FontSizeChangedArgs
{
Int32 Width { get; };

View File

@@ -891,6 +891,9 @@ void _stdcall TerminalSetTheme(void* terminal, TerminalTheme theme, LPCWSTR font
renderSettings.SetColorTableEntry(tableIndex, gsl::at(theme.ColorTable, tableIndex));
}
// Save these values as the new default render settings.
renderSettings.SaveDefaultSettings();
publicTerminal->_terminal->SetCursorStyle(static_cast<Microsoft::Console::VirtualTerminal::DispatchTypes::CursorStyle>(theme.CursorStyle));
publicTerminal->_desiredFont = { fontFamily, 0, DEFAULT_FONT_WEIGHT, static_cast<float>(fontSize), CP_UTF8 };

View File

@@ -63,6 +63,7 @@ namespace Microsoft.Terminal.Control
Boolean DisablePartialInvalidation { get; };
Boolean SoftwareRendering { get; };
Microsoft.Terminal.Control.TextMeasurement TextMeasurement { get; };
Microsoft.Terminal.Control.DefaultInputScope DefaultInputScope { get; };
Boolean ShowMarks { get; };
Boolean UseBackgroundImageForWindow { get; };
Boolean RightClickContextMenu { get; };

View File

@@ -575,7 +575,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation
// but since code paths differ, extra work is required to ensure correctness.
if (!_core.HasMultiLineSelection())
{
_core.SnapSearchResultToSelection(true);
const auto selectedLine{ _core.SelectedText(true) };
_searchBox->PopulateTextbox(selectedLine);
}
@@ -862,6 +861,11 @@ namespace winrt::Microsoft::Terminal::Control::implementation
}
_interactivity.UpdateSettings();
{
const auto inputScope = settings.DefaultInputScope();
const auto alpha = inputScope == DefaultInputScope::AlphanumericHalfWidth;
::Microsoft::Console::TSF::Handle::SetDefaultScopeAlphanumericHalfWidth(alpha);
}
if (_automationPeer)
{
_automationPeer.SetControlPadding(Core::Padding{
@@ -1630,12 +1634,29 @@ namespace winrt::Microsoft::Terminal::Control::implementation
{
if (vkey == VK_ADD)
{
// Alt '+' <number> is used to input Unicode code points.
// Every time you press + it resets the entire state
// in the original OS implementation as well.
s.encoding = AltNumpadEncoding::Unicode;
s.accumulator = 0;
s.active = true;
static const auto enabled = []() {
wchar_t buffer[4]{};
DWORD size = sizeof(buffer);
RegGetValueW(
HKEY_CURRENT_USER,
L"Control Panel\\Input Method",
L"EnableHexNumpad",
RRF_RT_REG_SZ,
nullptr,
&buffer[0],
&size);
return size == 4 && memcmp(&buffer[0], L"1", 4) == 0;
}();
if (enabled)
{
// Alt '+' <number> is used to input Unicode code points.
// Every time you press + it resets the entire state
// in the original OS implementation as well.
s.encoding = AltNumpadEncoding::Unicode;
s.accumulator = 0;
s.active = true;
}
}
else if (vkey == VK_NUMPAD0 && s.encoding == AltNumpadEncoding::OEM && s.accumulator == 0)
{
@@ -3807,7 +3828,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
const auto goForward = _searchBox->GoForward();
const auto caseSensitive = _searchBox->CaseSensitive();
const auto regularExpression = _searchBox->RegularExpression();
const auto request = SearchRequest{ text, goForward, caseSensitive, regularExpression, true, _calculateSearchScrollOffset() };
const auto request = SearchRequest{ text, goForward, caseSensitive, regularExpression, true, _searchScrollOffset };
_handleSearchResults(_core.Search(request));
}

View File

@@ -101,6 +101,9 @@ void Terminal::UpdateSettings(ICoreSettings settings)
GetRenderSettings().SetColorTableEntry(TextColor::FRAME_BACKGROUND, til::color{ settings.TabColor().Value() });
}
// Save the changes made above and in UpdateAppearance as the new default render settings.
GetRenderSettings().SaveDefaultSettings();
if (!_startingTabColor && settings.StartingTabColor())
{
_startingTabColor = settings.StartingTabColor().Value();
@@ -209,12 +212,6 @@ void Terminal::SetCursorStyle(const DispatchTypes::CursorStyle cursorStyle)
engine.Dispatch().SetCursorStyle(cursorStyle);
}
void Terminal::EraseScrollback()
{
auto& engine = reinterpret_cast<OutputStateMachineEngine&>(_stateMachine->Engine());
engine.Dispatch().EraseInDisplay(DispatchTypes::EraseType::Scrollback);
}
bool Terminal::IsXtermBracketedPasteModeEnabled() const noexcept
{
return _systemMode.test(Mode::BracketedPaste);
@@ -1254,15 +1251,17 @@ void Terminal::SetSearchHighlights(const std::vector<til::point_span>& highlight
// Method Description:
// - Stores the focused search highlighted region in the terminal
// - If the region isn't empty, it will be brought into view
void Terminal::SetSearchHighlightFocused(const size_t focusedIdx, til::CoordType searchScrollOffset)
void Terminal::SetSearchHighlightFocused(const size_t focusedIdx) noexcept
{
_assertLocked();
_searchHighlightFocused = focusedIdx;
}
// bring the focused region into the view if the index is in valid range
if (focusedIdx < _searchHighlights.size())
void Terminal::ScrollToSearchHighlight(til::CoordType searchScrollOffset)
{
if (_searchHighlightFocused < _searchHighlights.size())
{
const auto focused = til::at(_searchHighlights, focusedIdx);
const auto focused = til::at(_searchHighlights, _searchHighlightFocused);
const auto adjustedStart = til::point{ focused.start.x, std::max(0, focused.start.y - searchScrollOffset) };
const auto adjustedEnd = til::point{ focused.end.x, std::max(0, focused.end.y - searchScrollOffset) };
_ScrollToPoints(adjustedStart, adjustedEnd);

View File

@@ -94,7 +94,6 @@ public:
void UpdateAppearance(const winrt::Microsoft::Terminal::Core::ICoreAppearance& appearance);
void SetFontInfo(const FontInfo& fontInfo);
void SetCursorStyle(const ::Microsoft::Console::VirtualTerminal::DispatchTypes::CursorStyle cursorStyle);
void EraseScrollback();
bool IsXtermBracketedPasteModeEnabled() const noexcept;
std::wstring_view GetWorkingDirectory() noexcept;
@@ -233,7 +232,8 @@ public:
void SetSearchMissingCommandCallback(std::function<void(std::wstring_view, const til::CoordType)> pfn) noexcept;
void SetClearQuickFixCallback(std::function<void()> pfn) noexcept;
void SetSearchHighlights(const std::vector<til::point_span>& highlights) noexcept;
void SetSearchHighlightFocused(const size_t focusedIdx, til::CoordType searchScrollOffset);
void SetSearchHighlightFocused(size_t focusedIdx) noexcept;
void ScrollToSearchHighlight(til::CoordType searchScrollOffset);
void BlinkCursor() noexcept;
void SetCursorOn(const bool isOn) noexcept;

View File

@@ -86,7 +86,7 @@ void Terminal::SetWindowTitle(const std::wstring_view title)
_assertLocked();
if (!_suppressApplicationTitle)
{
_title.emplace(title);
_title.emplace(title.empty() ? _startingTitle : title);
_pfnTitleChanged(_title.value());
}
}

View File

@@ -178,7 +178,7 @@
<!-- command name -->
<ColumnDefinition Width="*" />
<!-- key chord -->
<ColumnDefinition Width="150" />
<ColumnDefinition Width="auto" />
<!-- edit buttons -->
<!--
This needs to be 112 because that is the width of the row of buttons in edit mode + padding.
@@ -307,7 +307,7 @@
Glyph="&#xE74D;" />
</Button.Content>
<Button.Flyout>
<Flyout>
<Flyout FlyoutPresenterStyle="{StaticResource CustomFlyoutPresenterStyle}">
<StackPanel>
<TextBlock x:Uid="Actions_DeleteConfirmationMessage"
Style="{StaticResource CustomFlyoutTextStyle}" />

View File

@@ -289,14 +289,17 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
// Display a confirmation dialog.
TextBlock errorMessageTB{};
errorMessageTB.Text(RS_(L"Actions_RenameConflictConfirmationMessage"));
errorMessageTB.TextWrapping(TextWrapping::Wrap);
const auto conflictingCmdName{ conflictingCmd.Name() };
TextBlock conflictingCommandNameTB{};
conflictingCommandNameTB.Text(fmt::format(L"\"{}\"", conflictingCmdName.empty() ? RS_(L"Actions_UnnamedCommandName") : conflictingCmdName));
conflictingCommandNameTB.FontStyle(Windows::UI::Text::FontStyle::Italic);
conflictingCommandNameTB.TextWrapping(TextWrapping::Wrap);
TextBlock confirmationQuestionTB{};
confirmationQuestionTB.Text(RS_(L"Actions_RenameConflictConfirmationQuestion"));
confirmationQuestionTB.TextWrapping(TextWrapping::Wrap);
Button acceptBTN{};
acceptBTN.Content(box_value(RS_(L"Actions_RenameConflictConfirmationAcceptButton")));
@@ -320,7 +323,17 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
flyoutStack.Children().Append(confirmationQuestionTB);
flyoutStack.Children().Append(acceptBTN);
// This should match CustomFlyoutPresenterStyle in CommonResources.xaml!
// We don't have access to those resources here, so it's easier to just copy them over.
// This allows the flyout text to wrap
Style acceptChangesFlyoutStyle{ winrt::xaml_typename<FlyoutPresenter>() };
Setter horizontalScrollModeStyleSetter{ ScrollViewer::HorizontalScrollModeProperty(), box_value(ScrollMode::Disabled) };
Setter horizontalScrollBarVisibilityStyleSetter{ ScrollViewer::HorizontalScrollBarVisibilityProperty(), box_value(ScrollBarVisibility::Disabled) };
acceptChangesFlyoutStyle.Setters().Append(horizontalScrollModeStyleSetter);
acceptChangesFlyoutStyle.Setters().Append(horizontalScrollBarVisibilityStyleSetter);
Flyout acceptChangesFlyout{};
acceptChangesFlyout.FlyoutPresenterStyle(acceptChangesFlyoutStyle);
acceptChangesFlyout.Content(flyoutStack);
senderVM.AcceptChangesFlyout(acceptChangesFlyout);
}

View File

@@ -1030,9 +1030,9 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
}
}
void Appearances::FontFaceBox_SuggestionChosen(const AutoSuggestBox& sender, const AutoSuggestBoxSuggestionChosenEventArgs& args)
void Appearances::FontFaceBox_QuerySubmitted(const AutoSuggestBox& sender, const AutoSuggestBoxQuerySubmittedEventArgs& args)
{
const auto font = unbox_value<Editor::Font>(args.SelectedItem());
const auto font = unbox_value<Editor::Font>(args.ChosenSuggestion());
const auto fontName = font.Name();
auto fontSpec = sender.Text();

View File

@@ -179,7 +179,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
void FontFaceBox_GotFocus(const Windows::Foundation::IInspectable& sender, const Windows::UI::Xaml::RoutedEventArgs& e);
void FontFaceBox_LostFocus(const Windows::Foundation::IInspectable& sender, const Windows::UI::Xaml::RoutedEventArgs& e);
void FontFaceBox_SuggestionChosen(const winrt::Windows::UI::Xaml::Controls::AutoSuggestBox&, const winrt::Windows::UI::Xaml::Controls::AutoSuggestBoxSuggestionChosenEventArgs&);
void FontFaceBox_QuerySubmitted(const winrt::Windows::UI::Xaml::Controls::AutoSuggestBox&, const winrt::Windows::UI::Xaml::Controls::AutoSuggestBoxQuerySubmittedEventArgs&);
void FontFaceBox_TextChanged(const winrt::Windows::UI::Xaml::Controls::AutoSuggestBox&, const winrt::Windows::UI::Xaml::Controls::AutoSuggestBoxTextChangedEventArgs&);
void DeleteFontKeyValuePair_Click(const Windows::Foundation::IInspectable& sender, const Windows::UI::Xaml::RoutedEventArgs& e);
safe_void_coroutine BackgroundImage_Click(const Windows::Foundation::IInspectable& sender, const Windows::UI::Xaml::RoutedEventArgs& e);

View File

@@ -214,10 +214,11 @@
ItemTemplate="{StaticResource FontFaceComboBoxItemTemplate}"
ItemsSource="{x:Bind FilteredFontList, Mode=OneWay}"
LostFocus="FontFaceBox_LostFocus"
SuggestionChosen="FontFaceBox_SuggestionChosen"
QuerySubmitted="FontFaceBox_QuerySubmitted"
Text="{x:Bind Appearance.FontFace, Mode=OneWay}"
TextBoxStyle="{StaticResource TextBoxSettingStyle}"
TextChanged="FontFaceBox_TextChanged" />
TextChanged="FontFaceBox_TextChanged"
UpdateTextOnSelect="False" />
<CheckBox x:Name="ShowAllFontsCheckbox"
x:Uid="Profile_FontFaceShowAllFonts"
IsChecked="{x:Bind ShowAllFonts, Mode=TwoWay}" />

View File

@@ -115,7 +115,7 @@
<!-- Used for disclaimers -->
<Style x:Key="DisclaimerStyle"
TargetType="TextBlock">
<Setter Property="TextWrapping" Value="WrapWholeWords" />
<Setter Property="TextWrapping" Value="Wrap" />
<Setter Property="MaxWidth" Value="1000" />
</Style>
@@ -125,6 +125,14 @@
TargetType="TextBlock">
<Setter Property="FontWeight" Value="Bold" />
<Setter Property="Margin" Value="0,0,0,10" />
<Setter Property="TextWrapping" Value="Wrap" />
</Style>
<!-- Used for the flyout itself. Removes scroll bar to allow for text wrapping. -->
<Style x:Key="CustomFlyoutPresenterStyle"
TargetType="FlyoutPresenter">
<Setter Property="ScrollViewer.HorizontalScrollMode" Value="Disabled" />
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled" />
</Style>
<!-- Number Box -->
@@ -145,7 +153,7 @@
BasedOn="{StaticResource BaseButtonStyle}"
TargetType="Button">
<Setter Property="Margin" Value="10,0,0,0" />
<Setter Property="Height" Value="33" />
<Setter Property="MinHeight" Value="33" />
</Style>
<!-- Delete button based on Accent button template -->

View File

@@ -488,7 +488,7 @@
</StackPanel>
</Button.Content>
<Button.Flyout>
<Flyout>
<Flyout FlyoutPresenterStyle="{StaticResource CustomFlyoutPresenterStyle}">
<StackPanel>
<TextBlock x:Uid="ColorScheme_DeleteConfirmationMessage"
Style="{StaticResource CustomFlyoutTextStyle}" />

View File

@@ -27,20 +27,6 @@
</Page.Resources>
<StackPanel Style="{StaticResource SettingsStackStyle}">
<!-- Language -->
<local:SettingContainer x:Uid="Globals_Language"
Visibility="{x:Bind ViewModel.LanguageSelectorAvailable}">
<ComboBox ItemsSource="{x:Bind ViewModel.LanguageList}"
SelectedItem="{x:Bind ViewModel.CurrentLanguage, Mode=TwoWay}"
Style="{StaticResource ComboBoxSettingStyle}">
<ComboBox.ItemTemplate>
<DataTemplate x:DataType="x:String">
<TextBlock Text="{x:Bind local:GlobalAppearanceViewModel.LanguageDisplayConverter((x:String))}" />
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</local:SettingContainer>
<!-- Theme -->
<local:SettingContainer x:Uid="Globals_Theme">
<ComboBox AutomationProperties.AccessibilityView="Content"

View File

@@ -7,7 +7,6 @@
#include "EnumEntry.h"
#include <LibraryResources.h>
#include <WtExeUtils.h>
using namespace winrt;
using namespace winrt::Windows::UI::Xaml;
@@ -18,28 +17,6 @@ using namespace winrt::Windows::Foundation::Collections;
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
{
// For ComboBox an empty SelectedItem string denotes no selection.
// What we want instead is for "Use system language" to be selected by default.
// --> "und" is synonymous for "Use system language".
constexpr std::wstring_view systemLanguageTag{ L"und" };
static constexpr std::array appLanguageTags{
L"en-US",
L"de-DE",
L"es-ES",
L"fr-FR",
L"it-IT",
L"ja",
L"ko",
L"pt-BR",
L"qps-PLOC",
L"qps-PLOCA",
L"qps-PLOCM",
L"ru",
L"zh-Hans",
L"zh-Hant",
};
constexpr std::wstring_view systemThemeName{ L"system" };
constexpr std::wstring_view darkThemeName{ L"dark" };
constexpr std::wstring_view lightThemeName{ L"light" };
@@ -56,146 +33,6 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
_UpdateThemeList();
}
winrt::hstring GlobalAppearanceViewModel::LanguageDisplayConverter(const winrt::hstring& tag)
{
if (tag == systemLanguageTag)
{
return RS_(L"Globals_LanguageDefault");
}
winrt::Windows::Globalization::Language language{ tag };
return language.NativeName();
}
// Returns whether the language selector is available/shown.
//
// winrt::Windows::Globalization::ApplicationLanguages::PrimaryLanguageOverride()
// doesn't work for unpackaged applications. The corresponding code in TerminalApp is disabled.
// It would be confusing for our users if we presented a dysfunctional language selector.
bool GlobalAppearanceViewModel::LanguageSelectorAvailable()
{
return IsPackaged();
}
// Returns the list of languages the user may override the application language with.
// The returned list are BCP 47 language tags like {"und", "en-US", "de-DE", "es-ES", ...}.
// "und" is short for "undefined" and is synonymous for "Use system language" in this code.
winrt::Windows::Foundation::Collections::IObservableVector<winrt::hstring> GlobalAppearanceViewModel::LanguageList()
{
if (_languageList)
{
return _languageList;
}
if (!LanguageSelectorAvailable())
{
_languageList = {};
return _languageList;
}
// In order to return the language list this code does the following:
// [1] Get all possible languages we want to allow the user to choose.
// We have to acquire languages from multiple sources, creating duplicates. See below at [1].
// [2] Sort languages by their ASCII tags, forcing the UI in a consistent/stable order.
// I wanted to sort the localized language names initially, but it turned out to be complex.
// [3] Remove potential duplicates in our language list from [1].
// We don't want to have en-US twice in the list, do we?
// [4] Optionally remove unwanted language tags (like pseudo-localizations).
std::vector<winrt::hstring> tags;
// [1]:
{
// ManifestLanguages contains languages the app ships with.
// Unfortunately, we cannot use this source. Our manifest must contain the
// ~100 languages that are localized for the shell extension and start menu
// presentation so we align with Windows display languages for those surfaces.
// However, the actual content of our application is limited to a much smaller
// subset of approximately 14 languages. As such, we will code the limited
// subset of languages that we support for selection within the Settings
// dropdown to steer users towards the ones that we can display in the app.
// As per the function definition, the first item
// is always "Use system language" ("und").
tags.emplace_back(systemLanguageTag);
// Add our hard-coded languages after the system definition.
for (const auto& v : appLanguageTags)
{
tags.push_back(v);
}
}
// NOTE: The size of tags is always >0, due to tags[0] being hard-coded to "und".
const auto tagsBegin = ++tags.begin();
const auto tagsEnd = tags.end();
// [2]:
std::sort(tagsBegin, tagsEnd);
// I'd love for both, std::unique and std::remove_if, to occur in a single loop,
// but the code turned out to be complex and even less maintainable, so I gave up.
{
// [3] part 1:
auto it = std::unique(tagsBegin, tagsEnd);
// The qps- languages are useful for testing ("pseudo-localization").
// --> Leave them in if debug features are enabled.
if (!_GlobalSettings.DebugFeaturesEnabled())
{
// [4] part 1:
it = std::remove_if(tagsBegin, it, [](const winrt::hstring& tag) -> bool {
return til::starts_with(tag, L"qps-");
});
}
// [3], [4] part 2 (completing the so called "erase-remove idiom"):
tags.erase(it, tagsEnd);
}
_languageList = winrt::single_threaded_observable_vector(std::move(tags));
return _languageList;
}
winrt::Windows::Foundation::IInspectable GlobalAppearanceViewModel::CurrentLanguage()
{
if (_currentLanguage)
{
return _currentLanguage;
}
if (!LanguageSelectorAvailable())
{
_currentLanguage = {};
return _currentLanguage;
}
// NOTE: PrimaryLanguageOverride throws if this instance is unpackaged.
auto currentLanguage = winrt::Windows::Globalization::ApplicationLanguages::PrimaryLanguageOverride();
if (currentLanguage.empty())
{
currentLanguage = systemLanguageTag;
}
_currentLanguage = winrt::box_value(currentLanguage);
return _currentLanguage;
}
void GlobalAppearanceViewModel::CurrentLanguage(const winrt::Windows::Foundation::IInspectable& tag)
{
_currentLanguage = tag;
const auto currentLanguage = winrt::unbox_value<winrt::hstring>(_currentLanguage);
if (currentLanguage == systemLanguageTag)
{
_GlobalSettings.ClearLanguage();
}
else
{
_GlobalSettings.Language(currentLanguage);
}
}
// Function Description:
// - Updates the list of all themes available to choose from.
void GlobalAppearanceViewModel::_UpdateThemeList()

View File

@@ -22,16 +22,6 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
GETSET_BINDABLE_ENUM_SETTING(TabWidthMode, winrt::Microsoft::UI::Xaml::Controls::TabViewWidthMode, _GlobalSettings.TabWidthMode);
public:
// LanguageDisplayConverter maps the given BCP 47 tag to a localized string.
// For instance "en-US" produces "English (United States)", while "de-DE" produces
// "Deutsch (Deutschland)". This works independently of the user's locale.
static winrt::hstring LanguageDisplayConverter(const winrt::hstring& tag);
bool LanguageSelectorAvailable();
winrt::Windows::Foundation::Collections::IObservableVector<winrt::hstring> LanguageList();
winrt::Windows::Foundation::IInspectable CurrentLanguage();
void CurrentLanguage(const winrt::Windows::Foundation::IInspectable& tag);
winrt::Windows::Foundation::IInspectable CurrentTheme();
void CurrentTheme(const winrt::Windows::Foundation::IInspectable& tag);
static winrt::hstring ThemeNameConverter(const Model::Theme& theme);
@@ -52,8 +42,6 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
private:
Model::GlobalAppSettings _GlobalSettings;
winrt::Windows::Foundation::Collections::IObservableVector<winrt::hstring> _languageList;
winrt::Windows::Foundation::IInspectable _currentLanguage;
winrt::Windows::Foundation::IInspectable _currentTheme;
void _UpdateThemeList();

View File

@@ -11,11 +11,6 @@ namespace Microsoft.Terminal.Settings.Editor
{
GlobalAppearanceViewModel(Microsoft.Terminal.Settings.Model.GlobalAppSettings globalSettings);
static String LanguageDisplayConverter(String tag);
Boolean LanguageSelectorAvailable { get; };
Windows.Foundation.Collections.IObservableVector<String> LanguageList { get; };
IInspectable CurrentLanguage;
IInspectable CurrentTheme;
static String ThemeNameConverter(Microsoft.Terminal.Settings.Model.Theme theme);
Windows.Foundation.Collections.IObservableVector<Microsoft.Terminal.Settings.Model.Theme> ThemeList { get; };

View File

@@ -139,6 +139,29 @@
</ComboBox>
</local:SettingContainer>
<!-- Language -->
<local:SettingContainer x:Uid="Globals_Language"
Visibility="{x:Bind ViewModel.LanguageSelectorAvailable}">
<ComboBox ItemsSource="{x:Bind ViewModel.LanguageList}"
SelectedItem="{x:Bind ViewModel.CurrentLanguage, Mode=TwoWay}"
Style="{StaticResource ComboBoxSettingStyle}">
<ComboBox.ItemTemplate>
<DataTemplate x:DataType="x:String">
<TextBlock Text="{x:Bind local:LaunchViewModel.LanguageDisplayConverter((x:String))}" />
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</local:SettingContainer>
<!-- Language -->
<local:SettingContainer x:Uid="Globals_DefaultInputScope">
<ComboBox AutomationProperties.AccessibilityView="Content"
ItemTemplate="{StaticResource EnumComboBoxTemplate}"
ItemsSource="{x:Bind ViewModel.DefaultInputScopeList}"
SelectedItem="{x:Bind ViewModel.CurrentDefaultInputScope, Mode=TwoWay}"
Style="{StaticResource ComboBoxSettingStyle}" />
</local:SettingContainer>
<!-- Start on User Login -->
<local:SettingContainer x:Uid="Globals_StartOnUserLogin">
<ToggleSwitch IsOn="{x:Bind ViewModel.StartOnUserLogin, Mode=TwoWay}"

View File

@@ -5,7 +5,9 @@
#include "LaunchViewModel.h"
#include "LaunchViewModel.g.cpp"
#include "EnumEntry.h"
#include <LibraryResources.h>
#include <WtExeUtils.h>
using namespace winrt::Windows::UI::Xaml::Navigation;
using namespace winrt::Windows::Foundation;
@@ -14,11 +16,34 @@ using namespace winrt::Windows::UI::Xaml::Data;
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
{
// For ComboBox an empty SelectedItem string denotes no selection.
// What we want instead is for "Use system language" to be selected by default.
// --> "und" is synonymous for "Use system language".
constexpr std::wstring_view systemLanguageTag{ L"und" };
static constexpr std::array appLanguageTags{
L"en-US",
L"de-DE",
L"es-ES",
L"fr-FR",
L"it-IT",
L"ja",
L"ko",
L"pt-BR",
L"qps-PLOC",
L"qps-PLOCA",
L"qps-PLOCM",
L"ru",
L"zh-Hans",
L"zh-Hant",
};
LaunchViewModel::LaunchViewModel(Model::CascadiaSettings settings) :
_Settings{ settings }
{
_useDefaultLaunchPosition = isnan(InitialPosX()) && isnan(InitialPosY());
INITIALIZE_BINDABLE_ENUM_SETTING(DefaultInputScope, DefaultInputScope, winrt::Microsoft::Terminal::Control::DefaultInputScope, L"Globals_DefaultInputScope", L"Content");
INITIALIZE_BINDABLE_ENUM_SETTING(FirstWindowPreference, FirstWindowPreference, FirstWindowPreference, L"Globals_FirstWindowPreference", L"Content");
INITIALIZE_BINDABLE_ENUM_SETTING(LaunchMode, LaunchMode, LaunchMode, L"Globals_LaunchMode", L"Content");
// More options were added to the JSON mapper when the enum was made into [Flags]
@@ -40,6 +65,146 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
});
}
winrt::hstring LaunchViewModel::LanguageDisplayConverter(const winrt::hstring& tag)
{
if (tag == systemLanguageTag)
{
return RS_(L"Globals_LanguageDefault");
}
winrt::Windows::Globalization::Language language{ tag };
return language.NativeName();
}
// Returns whether the language selector is available/shown.
//
// winrt::Windows::Globalization::ApplicationLanguages::PrimaryLanguageOverride()
// doesn't work for unpackaged applications. The corresponding code in TerminalApp is disabled.
// It would be confusing for our users if we presented a dysfunctional language selector.
bool LaunchViewModel::LanguageSelectorAvailable()
{
return IsPackaged();
}
// Returns the list of languages the user may override the application language with.
// The returned list are BCP 47 language tags like {"und", "en-US", "de-DE", "es-ES", ...}.
// "und" is short for "undefined" and is synonymous for "Use system language" in this code.
winrt::Windows::Foundation::Collections::IObservableVector<winrt::hstring> LaunchViewModel::LanguageList()
{
if (_languageList)
{
return _languageList;
}
if (!LanguageSelectorAvailable())
{
_languageList = {};
return _languageList;
}
// In order to return the language list this code does the following:
// [1] Get all possible languages we want to allow the user to choose.
// We have to acquire languages from multiple sources, creating duplicates. See below at [1].
// [2] Sort languages by their ASCII tags, forcing the UI in a consistent/stable order.
// I wanted to sort the localized language names initially, but it turned out to be complex.
// [3] Remove potential duplicates in our language list from [1].
// We don't want to have en-US twice in the list, do we?
// [4] Optionally remove unwanted language tags (like pseudo-localizations).
std::vector<winrt::hstring> tags;
// [1]:
{
// ManifestLanguages contains languages the app ships with.
// Unfortunately, we cannot use this source. Our manifest must contain the
// ~100 languages that are localized for the shell extension and start menu
// presentation so we align with Windows display languages for those surfaces.
// However, the actual content of our application is limited to a much smaller
// subset of approximately 14 languages. As such, we will code the limited
// subset of languages that we support for selection within the Settings
// dropdown to steer users towards the ones that we can display in the app.
// As per the function definition, the first item
// is always "Use system language" ("und").
tags.emplace_back(systemLanguageTag);
// Add our hard-coded languages after the system definition.
for (const auto& v : appLanguageTags)
{
tags.push_back(v);
}
}
// NOTE: The size of tags is always >0, due to tags[0] being hard-coded to "und".
const auto tagsBegin = ++tags.begin();
const auto tagsEnd = tags.end();
// [2]:
std::sort(tagsBegin, tagsEnd);
// I'd love for both, std::unique and std::remove_if, to occur in a single loop,
// but the code turned out to be complex and even less maintainable, so I gave up.
{
// [3] part 1:
auto it = std::unique(tagsBegin, tagsEnd);
// The qps- languages are useful for testing ("pseudo-localization").
// --> Leave them in if debug features are enabled.
if (!_Settings.GlobalSettings().DebugFeaturesEnabled())
{
// [4] part 1:
it = std::remove_if(tagsBegin, it, [](const winrt::hstring& tag) -> bool {
return til::starts_with(tag, L"qps-");
});
}
// [3], [4] part 2 (completing the so called "erase-remove idiom"):
tags.erase(it, tagsEnd);
}
_languageList = winrt::single_threaded_observable_vector(std::move(tags));
return _languageList;
}
winrt::Windows::Foundation::IInspectable LaunchViewModel::CurrentLanguage()
{
if (_currentLanguage)
{
return _currentLanguage;
}
if (!LanguageSelectorAvailable())
{
_currentLanguage = {};
return _currentLanguage;
}
// NOTE: PrimaryLanguageOverride throws if this instance is unpackaged.
auto currentLanguage = winrt::Windows::Globalization::ApplicationLanguages::PrimaryLanguageOverride();
if (currentLanguage.empty())
{
currentLanguage = systemLanguageTag;
}
_currentLanguage = winrt::box_value(currentLanguage);
return _currentLanguage;
}
void LaunchViewModel::CurrentLanguage(const winrt::Windows::Foundation::IInspectable& tag)
{
_currentLanguage = tag;
const auto currentLanguage = winrt::unbox_value<winrt::hstring>(_currentLanguage);
if (currentLanguage == systemLanguageTag)
{
_Settings.GlobalSettings().ClearLanguage();
}
else
{
_Settings.GlobalSettings().Language(currentLanguage);
}
}
winrt::hstring LaunchViewModel::LaunchParametersCurrentValue()
{
const auto launchModeString = CurrentLaunchMode().as<EnumEntry>()->EnumName();

View File

@@ -14,6 +14,16 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
public:
LaunchViewModel(Model::CascadiaSettings settings);
// LanguageDisplayConverter maps the given BCP 47 tag to a localized string.
// For instance "en-US" produces "English (United States)", while "de-DE" produces
// "Deutsch (Deutschland)". This works independently of the user's locale.
static winrt::hstring LanguageDisplayConverter(const winrt::hstring& tag);
bool LanguageSelectorAvailable();
winrt::Windows::Foundation::Collections::IObservableVector<winrt::hstring> LanguageList();
winrt::Windows::Foundation::IInspectable CurrentLanguage();
void CurrentLanguage(const winrt::Windows::Foundation::IInspectable& tag);
winrt::hstring LaunchParametersCurrentValue();
double InitialPosX();
double InitialPosY();
@@ -35,6 +45,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
void CurrentLaunchMode(const winrt::Windows::Foundation::IInspectable& enumEntry);
winrt::Windows::Foundation::Collections::IObservableVector<winrt::Microsoft::Terminal::Settings::Editor::EnumEntry> LaunchModeList();
GETSET_BINDABLE_ENUM_SETTING(DefaultInputScope, winrt::Microsoft::Terminal::Control::DefaultInputScope, _Settings.GlobalSettings().DefaultInputScope);
GETSET_BINDABLE_ENUM_SETTING(FirstWindowPreference, Model::FirstWindowPreference, _Settings.GlobalSettings().FirstWindowPreference);
GETSET_BINDABLE_ENUM_SETTING(WindowingBehavior, Model::WindowingMode, _Settings.GlobalSettings().WindowingBehavior);
@@ -45,6 +56,8 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
private:
Model::CascadiaSettings _Settings;
winrt::Windows::Foundation::Collections::IObservableVector<winrt::hstring> _languageList;
winrt::Windows::Foundation::IInspectable _currentLanguage;
bool _useDefaultLaunchPosition;
winrt::Windows::Foundation::Collections::IObservableVector<winrt::Microsoft::Terminal::Settings::Editor::EnumEntry> _LaunchModeList;

View File

@@ -11,6 +11,14 @@ namespace Microsoft.Terminal.Settings.Editor
{
LaunchViewModel(Microsoft.Terminal.Settings.Model.CascadiaSettings settings);
static String LanguageDisplayConverter(String tag);
Boolean LanguageSelectorAvailable { get; };
Windows.Foundation.Collections.IObservableVector<String> LanguageList { get; };
IInspectable CurrentLanguage;
IInspectable CurrentDefaultInputScope;
IObservableVector<Microsoft.Terminal.Settings.Editor.EnumEntry> DefaultInputScopeList { get; };
String LaunchParametersCurrentValue { get; };
Double InitialPosX;
Double InitialPosY;

View File

@@ -246,9 +246,22 @@
<comment>A description explaining how this control changes the app's language. {Locked="Windows"}</comment>
</data>
<data name="Globals_LanguageDefault" xml:space="preserve">
<value>Systemstandard verwenden</value>
<value>Standard</value>
<comment>The app contains a control allowing users to choose the app's language. If this value is chosen, the language preference list of the system settings is used instead.</comment>
</data>
<data name="Globals_DefaultInputScope.Header" xml:space="preserve">
<value>Standard-IME-Eingabemodus</value>
<comment>The "input scope" of an IME tells it what type of characters should be available for input. A Chinese IME for instance may show English letters instead of Chinese ones. It's a technical term. We're using "input mode" instead of "input scope" to make it easier to understand for users.</comment>
</data>
<data name="Globals_DefaultInputScope.HelpText" xml:space="preserve">
<value>Informiert den IME, welche Sprache standardmäßig verwendet werden soll. Für Sprachen, die auf einem IME basieren und standardmäßig keine lateinischen Zeichen verwenden, kann diese Einstellung verwendet werden, um beim Start die Eingabe in Englisch zu erzwingen.</value>
</data>
<data name="Globals_DefaultInputScopeDefault.Content" xml:space="preserve">
<value>Standard</value>
</data>
<data name="Globals_DefaultInputScopeAlphanumericHalfWidth.Content" xml:space="preserve">
<value>Alphanumerische Halbbreite (Englisch)</value>
</data>
<data name="Globals_AlwaysShowTabs.Header" xml:space="preserve">
<value>Registerkarten immer anzeigen</value>
<comment>Header for a control to toggle if the app should always show the tabs (similar to a website browser).</comment>

View File

@@ -246,9 +246,22 @@
<comment>A description explaining how this control changes the app's language. {Locked="Windows"}</comment>
</data>
<data name="Globals_LanguageDefault" xml:space="preserve">
<value>Use system default</value>
<value>Default</value>
<comment>The app contains a control allowing users to choose the app's language. If this value is chosen, the language preference list of the system settings is used instead.</comment>
</data>
<data name="Globals_DefaultInputScope.Header" xml:space="preserve">
<value>Default IME input mode</value>
<comment>The "input scope" of an IME tells it what type of characters should be available for input. A Chinese IME for instance may show English letters instead of Chinese ones. It's a technical term. We're using "input mode" instead of "input scope" to make it easier to understand for users.</comment>
</data>
<data name="Globals_DefaultInputScope.HelpText" xml:space="preserve">
<value>Informs the IME what language to use by default. For languages that rely on an IME and don't use Latin characters by default, this setting can be used to force English input on startup.</value>
</data>
<data name="Globals_DefaultInputScopeDefault.Content" xml:space="preserve">
<value>Default</value>
</data>
<data name="Globals_DefaultInputScopeAlphanumericHalfWidth.Content" xml:space="preserve">
<value>Alphanumeric Half-Width (English)</value>
</data>
<data name="Globals_AlwaysShowTabs.Header" xml:space="preserve">
<value>Always show tabs</value>
<comment>Header for a control to toggle if the app should always show the tabs (similar to a website browser).</comment>

View File

@@ -246,9 +246,22 @@
<comment>A description explaining how this control changes the app's language. {Locked="Windows"}</comment>
</data>
<data name="Globals_LanguageDefault" xml:space="preserve">
<value>Usar los valores predeterminados del sistema</value>
<value>Predeterminado</value>
<comment>The app contains a control allowing users to choose the app's language. If this value is chosen, the language preference list of the system settings is used instead.</comment>
</data>
<data name="Globals_DefaultInputScope.Header" xml:space="preserve">
<value>Modo de entrada IME predeterminado</value>
<comment>The "input scope" of an IME tells it what type of characters should be available for input. A Chinese IME for instance may show English letters instead of Chinese ones. It's a technical term. We're using "input mode" instead of "input scope" to make it easier to understand for users.</comment>
</data>
<data name="Globals_DefaultInputScope.HelpText" xml:space="preserve">
<value>Informa al IME qué idioma usar de forma predeterminada. Para los idiomas que dependen de un IME y no usan caracteres latinos de forma predeterminada, esta configuración se puede usar para forzar la entrada de inglés al iniciar.</value>
</data>
<data name="Globals_DefaultInputScopeDefault.Content" xml:space="preserve">
<value>Predeterminado</value>
</data>
<data name="Globals_DefaultInputScopeAlphanumericHalfWidth.Content" xml:space="preserve">
<value>Ancho medio alfanumérico (inglés)</value>
</data>
<data name="Globals_AlwaysShowTabs.Header" xml:space="preserve">
<value>Mostrar pestañas siempre</value>
<comment>Header for a control to toggle if the app should always show the tabs (similar to a website browser).</comment>
@@ -1539,6 +1552,10 @@
<value>Texto</value>
<comment>Header for a group of settings that control the appearance of text in the app.</comment>
</data>
<data name="Globals_WarningsHeader.Text" xml:space="preserve">
<value>Advertencias</value>
<comment>Header for a group of settings that control the warnings in the app.</comment>
</data>
<data name="Profile_WindowHeader.Text" xml:space="preserve">
<value>Ventana</value>
<comment>Header for a group of settings that control the appearance of the window frame of the app.</comment>
@@ -1819,6 +1836,15 @@
<value>Advertir al cerrar más de una pestaña</value>
<comment>Header for a control to toggle whether to show a confirm dialog box when closing the application with multiple tabs open.</comment>
</data>
<data name="Globals_InputServiceWarning.Header" xml:space="preserve">
<value>Advertir cuando el servicio "Panel de escritura a mano y teclado táctil" está deshabilitado</value>
</data>
<data name="Globals_WarnAboutLargePaste.Header" xml:space="preserve">
<value>Advertir al intentar pegar más de 5 KiB de caracteres</value>
</data>
<data name="Globals_WarnAboutMultiLinePaste.Header" xml:space="preserve">
<value>Advertir al intentar pegar un carácter de "nueva línea"</value>
</data>
<data name="Settings_PortableModeNote.Text" xml:space="preserve">
<value>Terminal Windows se ejecuta en modo portátil.</value>
<comment>A disclaimer that indicates that Terminal is running in a mode that saves settings to a different folder.</comment>

View File

@@ -246,9 +246,22 @@
<comment>A description explaining how this control changes the app's language. {Locked="Windows"}</comment>
</data>
<data name="Globals_LanguageDefault" xml:space="preserve">
<value>Utiliser la valeur par défaut du système</value>
<value>Par défaut</value>
<comment>The app contains a control allowing users to choose the app's language. If this value is chosen, the language preference list of the system settings is used instead.</comment>
</data>
<data name="Globals_DefaultInputScope.Header" xml:space="preserve">
<value>Mode dentrée IME par défaut</value>
<comment>The "input scope" of an IME tells it what type of characters should be available for input. A Chinese IME for instance may show English letters instead of Chinese ones. It's a technical term. We're using "input mode" instead of "input scope" to make it easier to understand for users.</comment>
</data>
<data name="Globals_DefaultInputScope.HelpText" xml:space="preserve">
<value>Indique à IME la langue à utiliser par défaut. Pour les langues qui s'appuient sur un IME et qui n'utilisent pas les caractères latins par défaut, ce paramètre peut être utilisé pour forcer la saisie de l'anglais au démarrage.</value>
</data>
<data name="Globals_DefaultInputScopeDefault.Content" xml:space="preserve">
<value>Par défaut</value>
</data>
<data name="Globals_DefaultInputScopeAlphanumericHalfWidth.Content" xml:space="preserve">
<value>Demi-largeur alphanumérique (anglais)</value>
</data>
<data name="Globals_AlwaysShowTabs.Header" xml:space="preserve">
<value>Toujours afficher les onglets</value>
<comment>Header for a control to toggle if the app should always show the tabs (similar to a website browser).</comment>
@@ -1539,6 +1552,10 @@
<value>Texte</value>
<comment>Header for a group of settings that control the appearance of text in the app.</comment>
</data>
<data name="Globals_WarningsHeader.Text" xml:space="preserve">
<value>Avertissements</value>
<comment>Header for a group of settings that control the warnings in the app.</comment>
</data>
<data name="Profile_WindowHeader.Text" xml:space="preserve">
<value>Fenêtre</value>
<comment>Header for a group of settings that control the appearance of the window frame of the app.</comment>
@@ -1819,6 +1836,15 @@
<value>M'avertir lorsque je ferme plusieurs onglets</value>
<comment>Header for a control to toggle whether to show a confirm dialog box when closing the application with multiple tabs open.</comment>
</data>
<data name="Globals_InputServiceWarning.Header" xml:space="preserve">
<value>Avertir lorsque le « service clavier tactile et volet décriture manuscrite » est désactivé</value>
</data>
<data name="Globals_WarnAboutLargePaste.Header" xml:space="preserve">
<value>Avertissement lors de la tentative de collage de plus de 5 Kio de caractères</value>
</data>
<data name="Globals_WarnAboutMultiLinePaste.Header" xml:space="preserve">
<value>Avertir lors de la tentative de collage dun caractère « nouvelle ligne »</value>
</data>
<data name="Settings_PortableModeNote.Text" xml:space="preserve">
<value>Terminal Windows sexécute en mode portable.</value>
<comment>A disclaimer that indicates that Terminal is running in a mode that saves settings to a different folder.</comment>

View File

@@ -246,9 +246,22 @@
<comment>A description explaining how this control changes the app's language. {Locked="Windows"}</comment>
</data>
<data name="Globals_LanguageDefault" xml:space="preserve">
<value>Usa impostazioni predefinite di sistema</value>
<value>Impostazione predefinita</value>
<comment>The app contains a control allowing users to choose the app's language. If this value is chosen, the language preference list of the system settings is used instead.</comment>
</data>
<data name="Globals_DefaultInputScope.Header" xml:space="preserve">
<value>Modalità di input IME predefinita</value>
<comment>The "input scope" of an IME tells it what type of characters should be available for input. A Chinese IME for instance may show English letters instead of Chinese ones. It's a technical term. We're using "input mode" instead of "input scope" to make it easier to understand for users.</comment>
</data>
<data name="Globals_DefaultInputScope.HelpText" xml:space="preserve">
<value>Informa l'IME della lingua da usare per impostazione predefinita. Per le lingue che si affidano a un IME e che non usano i caratteri latini per impostazione predefinita, questa impostazione può essere usata per forzare l'inserimento dell'inglese all'avvio.</value>
</data>
<data name="Globals_DefaultInputScopeDefault.Content" xml:space="preserve">
<value>Impostazione predefinita</value>
</data>
<data name="Globals_DefaultInputScopeAlphanumericHalfWidth.Content" xml:space="preserve">
<value>Mezza larghezza alfanumerica (inglese)</value>
</data>
<data name="Globals_AlwaysShowTabs.Header" xml:space="preserve">
<value>Mostra sempre le schede</value>
<comment>Header for a control to toggle if the app should always show the tabs (similar to a website browser).</comment>
@@ -1539,6 +1552,10 @@
<value>Testo</value>
<comment>Header for a group of settings that control the appearance of text in the app.</comment>
</data>
<data name="Globals_WarningsHeader.Text" xml:space="preserve">
<value>Avvisi</value>
<comment>Header for a group of settings that control the warnings in the app.</comment>
</data>
<data name="Profile_WindowHeader.Text" xml:space="preserve">
<value>Finestra</value>
<comment>Header for a group of settings that control the appearance of the window frame of the app.</comment>
@@ -1819,6 +1836,15 @@
<value>Avvisa in caso di chiusura di più schede</value>
<comment>Header for a control to toggle whether to show a confirm dialog box when closing the application with multiple tabs open.</comment>
</data>
<data name="Globals_InputServiceWarning.Header" xml:space="preserve">
<value>Avvisa quando il servizio "Tastiera virtuale e pannello per la grafia" è disabilitato</value>
</data>
<data name="Globals_WarnAboutLargePaste.Header" xml:space="preserve">
<value>Avvisa quando si tenta di incollare più di 5 KiB di caratteri</value>
</data>
<data name="Globals_WarnAboutMultiLinePaste.Header" xml:space="preserve">
<value>Avvisa quando si prova a incollare un carattere "nuova riga"</value>
</data>
<data name="Settings_PortableModeNote.Text" xml:space="preserve">
<value>Terminale Windows è in esecuzione in modalità portatile.</value>
<comment>A disclaimer that indicates that Terminal is running in a mode that saves settings to a different folder.</comment>

View File

@@ -246,9 +246,22 @@
<comment>A description explaining how this control changes the app's language. {Locked="Windows"}</comment>
</data>
<data name="Globals_LanguageDefault" xml:space="preserve">
<value>システムの既定値を使用</value>
<value>既定値</value>
<comment>The app contains a control allowing users to choose the app's language. If this value is chosen, the language preference list of the system settings is used instead.</comment>
</data>
<data name="Globals_DefaultInputScope.Header" xml:space="preserve">
<value>既定の IME 入力モード</value>
<comment>The "input scope" of an IME tells it what type of characters should be available for input. A Chinese IME for instance may show English letters instead of Chinese ones. It's a technical term. We're using "input mode" instead of "input scope" to make it easier to understand for users.</comment>
</data>
<data name="Globals_DefaultInputScope.HelpText" xml:space="preserve">
<value>既定で使用する言語を IME に通知します。IME に依存し、既定ではラテン文字を使用しない言語では、スタートアップ時に英語入力を強制するためにこの設定を使用できます。</value>
</data>
<data name="Globals_DefaultInputScopeDefault.Content" xml:space="preserve">
<value>既定値</value>
</data>
<data name="Globals_DefaultInputScopeAlphanumericHalfWidth.Content" xml:space="preserve">
<value>半角英数字 (英語)</value>
</data>
<data name="Globals_AlwaysShowTabs.Header" xml:space="preserve">
<value>常にタブを表示する</value>
<comment>Header for a control to toggle if the app should always show the tabs (similar to a website browser).</comment>
@@ -1539,6 +1552,10 @@
<value>テキスト</value>
<comment>Header for a group of settings that control the appearance of text in the app.</comment>
</data>
<data name="Globals_WarningsHeader.Text" xml:space="preserve">
<value>警告</value>
<comment>Header for a group of settings that control the warnings in the app.</comment>
</data>
<data name="Profile_WindowHeader.Text" xml:space="preserve">
<value>ウィンドウ</value>
<comment>Header for a group of settings that control the appearance of the window frame of the app.</comment>
@@ -1819,6 +1836,15 @@
<value>複数のタブを閉じるときに警告する</value>
<comment>Header for a control to toggle whether to show a confirm dialog box when closing the application with multiple tabs open.</comment>
</data>
<data name="Globals_InputServiceWarning.Header" xml:space="preserve">
<value>[タッチ キーボードと手書きパネル サービス] が無効になっている場合に警告する</value>
</data>
<data name="Globals_WarnAboutLargePaste.Header" xml:space="preserve">
<value>5 KiB を超える文字を貼り付けようとしたときに警告する</value>
</data>
<data name="Globals_WarnAboutMultiLinePaste.Header" xml:space="preserve">
<value>"改行" 文字を貼り付けようとしたときに警告する</value>
</data>
<data name="Settings_PortableModeNote.Text" xml:space="preserve">
<value>Windows ターミナルはポータブル モードで実行されています。</value>
<comment>A disclaimer that indicates that Terminal is running in a mode that saves settings to a different folder.</comment>

View File

@@ -246,9 +246,22 @@
<comment>A description explaining how this control changes the app's language. {Locked="Windows"}</comment>
</data>
<data name="Globals_LanguageDefault" xml:space="preserve">
<value>시스템 기본값 사용</value>
<value>기본값</value>
<comment>The app contains a control allowing users to choose the app's language. If this value is chosen, the language preference list of the system settings is used instead.</comment>
</data>
<data name="Globals_DefaultInputScope.Header" xml:space="preserve">
<value>기본 IME 입력 모드</value>
<comment>The "input scope" of an IME tells it what type of characters should be available for input. A Chinese IME for instance may show English letters instead of Chinese ones. It's a technical term. We're using "input mode" instead of "input scope" to make it easier to understand for users.</comment>
</data>
<data name="Globals_DefaultInputScope.HelpText" xml:space="preserve">
<value>기본적으로 사용할 언어를 IME에 알릴 수 있습니다. IME를 사용하고 기본적으로 라틴 문자를 사용하지 않는 언어의 경우 이 설정을 사용하여 시작할 때 영어 입력을 강제 적용할 수 있습니다.</value>
</data>
<data name="Globals_DefaultInputScopeDefault.Content" xml:space="preserve">
<value>기본값</value>
</data>
<data name="Globals_DefaultInputScopeAlphanumericHalfWidth.Content" xml:space="preserve">
<value>영숫자 반자(영어)</value>
</data>
<data name="Globals_AlwaysShowTabs.Header" xml:space="preserve">
<value>항상 탭 표시</value>
<comment>Header for a control to toggle if the app should always show the tabs (similar to a website browser).</comment>
@@ -1539,6 +1552,10 @@
<value>텍스트</value>
<comment>Header for a group of settings that control the appearance of text in the app.</comment>
</data>
<data name="Globals_WarningsHeader.Text" xml:space="preserve">
<value>경고</value>
<comment>Header for a group of settings that control the warnings in the app.</comment>
</data>
<data name="Profile_WindowHeader.Text" xml:space="preserve">
<value>창</value>
<comment>Header for a group of settings that control the appearance of the window frame of the app.</comment>
@@ -1819,6 +1836,15 @@
<value>두 개 이상의 탭을 닫을 때 경고</value>
<comment>Header for a control to toggle whether to show a confirm dialog box when closing the application with multiple tabs open.</comment>
</data>
<data name="Globals_InputServiceWarning.Header" xml:space="preserve">
<value>"터치 키보드 및 필기 패널 서비스"를 사용할 수 없는 경우 경고</value>
</data>
<data name="Globals_WarnAboutLargePaste.Header" xml:space="preserve">
<value>5KiB가 넘는 문자를 붙여넣으려고 할 때 경고</value>
</data>
<data name="Globals_WarnAboutMultiLinePaste.Header" xml:space="preserve">
<value>"줄 바꾸기" 문자를 붙여넣을 때 경고</value>
</data>
<data name="Settings_PortableModeNote.Text" xml:space="preserve">
<value>Windows 터미널이 이식 가능 모드에서 실행되고 있습니다.</value>
<comment>A disclaimer that indicates that Terminal is running in a mode that saves settings to a different folder.</comment>

View File

@@ -246,9 +246,22 @@
<comment>A description explaining how this control changes the app's language. {Locked="Windows"}</comment>
</data>
<data name="Globals_LanguageDefault" xml:space="preserve">
<value>Usar o padrão do sistema</value>
<value>Padrão</value>
<comment>The app contains a control allowing users to choose the app's language. If this value is chosen, the language preference list of the system settings is used instead.</comment>
</data>
<data name="Globals_DefaultInputScope.Header" xml:space="preserve">
<value>Modo de entrada padrão do IME</value>
<comment>The "input scope" of an IME tells it what type of characters should be available for input. A Chinese IME for instance may show English letters instead of Chinese ones. It's a technical term. We're using "input mode" instead of "input scope" to make it easier to understand for users.</comment>
</data>
<data name="Globals_DefaultInputScope.HelpText" xml:space="preserve">
<value>Informa ao IME qual idioma usar por padrão. Para idiomas que dependem de um IME e não utilizam caracteres latinos por padrão, essa configuração pode forçar a entrada em inglês na inicialização.</value>
</data>
<data name="Globals_DefaultInputScopeDefault.Content" xml:space="preserve">
<value>Padrão</value>
</data>
<data name="Globals_DefaultInputScopeAlphanumericHalfWidth.Content" xml:space="preserve">
<value>Alfanumérico Meia-Largura (Inglês)</value>
</data>
<data name="Globals_AlwaysShowTabs.Header" xml:space="preserve">
<value>Sempre mostrar as guias</value>
<comment>Header for a control to toggle if the app should always show the tabs (similar to a website browser).</comment>

View File

@@ -246,9 +246,22 @@
<comment>A description explaining how this control changes the app's language. {Locked="Windows"}</comment>
</data>
<data name="Globals_LanguageDefault" xml:space="preserve">
<value>Ůŝê ѕŷŝτėм đєƒāùľŧ !!! !!</value>
<value>Ďėƒąūļτ !!</value>
<comment>The app contains a control allowing users to choose the app's language. If this value is chosen, the language preference list of the system settings is used instead.</comment>
</data>
<data name="Globals_DefaultInputScope.Header" xml:space="preserve">
<value>Đέƒàųŀт ĨΜЗ ΐήрũŧ mоδę !!! !!! </value>
<comment>The "input scope" of an IME tells it what type of characters should be available for input. A Chinese IME for instance may show English letters instead of Chinese ones. It's a technical term. We're using "input mode" instead of "input scope" to make it easier to understand for users.</comment>
</data>
<data name="Globals_DefaultInputScope.HelpText" xml:space="preserve">
<value>Íŋƒбгмş ţђе ÎМЕ ẁћдŧ ļàņĝŭªġé ŧб üśе ьý ðěƒαűľŧ. ₣òѓ ļάņģųαģєś ţћáŧ ґ℮ŀу öŋ àи ĪΜÊ ǻйð δŏй'т цѕέ £âтĩŋ çħãѓâćтèřš ъγ ðėƒāџľŧ, ţнϊś ŝэťтĭñġ ċάń ье цѕёð τό ƒóřċε ∑ήģĺîѕħ îήρüт οŋ şŧªřťúр. !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !</value>
</data>
<data name="Globals_DefaultInputScopeDefault.Content" xml:space="preserve">
<value>Ðеƒãϋĺţ !!</value>
</data>
<data name="Globals_DefaultInputScopeAlphanumericHalfWidth.Content" xml:space="preserve">
<value>Дĺρħăпυмегїç Ηâŀƒ-Щιδτĥ (Ęñģℓîšĥ) !!! !!! !!! </value>
</data>
<data name="Globals_AlwaysShowTabs.Header" xml:space="preserve">
<value>Άľώāŷš şђǿŵ тãвŝ !!! !</value>
<comment>Header for a control to toggle if the app should always show the tabs (similar to a website browser).</comment>
@@ -1539,6 +1552,10 @@
<value>Ţέхţ !</value>
<comment>Header for a group of settings that control the appearance of text in the app.</comment>
</data>
<data name="Globals_WarningsHeader.Text" xml:space="preserve">
<value>Ẅåŕⁿįņğѕ !!</value>
<comment>Header for a group of settings that control the warnings in the app.</comment>
</data>
<data name="Profile_WindowHeader.Text" xml:space="preserve">
<value>Щіňďош !</value>
<comment>Header for a group of settings that control the appearance of the window frame of the app.</comment>
@@ -1819,6 +1836,15 @@
<value>Ẃářй ẅђëπ ĉľôśĩήĝ mǿѓĕ тĥąπ òπё τάь !!! !!! !!! !</value>
<comment>Header for a control to toggle whether to show a confirm dialog box when closing the application with multiple tabs open.</comment>
</data>
<data name="Globals_InputServiceWarning.Header" xml:space="preserve">
<value>Ẃǻґņ ώћĕπ "Ŧõũčђ Κзγьοдгď ąʼnð Нáлđẅŕīťίńģ Ρàňεℓ Śεŕνîçé" íš đìşāъŀêδ !!! !!! !!! !!! !!! !!! !!</value>
</data>
<data name="Globals_WarnAboutLargePaste.Header" xml:space="preserve">
<value>Ẃăґи ẅнěπ тґўіήĝ τø рáŝťё mοřé ţħäή 5 ΚĩВ òƒ ĉħāґąćτєґѕ !!! !!! !!! !!! !!! !</value>
</data>
<data name="Globals_WarnAboutMultiLinePaste.Header" xml:space="preserve">
<value>Щāřπ ẃĥєи ťгýīлğ ţõ ρäşŧè ª "пėщ ľїл℮" ςћářǻ¢ţēř !!! !!! !!! !!! !!</value>
</data>
<data name="Settings_PortableModeNote.Text" xml:space="preserve">
<value>Ẅїηðσшѕ Ţеřmíńăľ īѕ ґϋййïʼnģ ĭņ рόѓťáъℓė mōďе. !!! !!! !!! !!! !</value>
<comment>A disclaimer that indicates that Terminal is running in a mode that saves settings to a different folder.</comment>

View File

@@ -246,9 +246,22 @@
<comment>A description explaining how this control changes the app's language. {Locked="Windows"}</comment>
</data>
<data name="Globals_LanguageDefault" xml:space="preserve">
<value>Ůŝê ѕŷŝτėм đєƒāùľŧ !!! !!</value>
<value>Ďėƒąūļτ !!</value>
<comment>The app contains a control allowing users to choose the app's language. If this value is chosen, the language preference list of the system settings is used instead.</comment>
</data>
<data name="Globals_DefaultInputScope.Header" xml:space="preserve">
<value>Đέƒàųŀт ĨΜЗ ΐήрũŧ mоδę !!! !!! </value>
<comment>The "input scope" of an IME tells it what type of characters should be available for input. A Chinese IME for instance may show English letters instead of Chinese ones. It's a technical term. We're using "input mode" instead of "input scope" to make it easier to understand for users.</comment>
</data>
<data name="Globals_DefaultInputScope.HelpText" xml:space="preserve">
<value>Íŋƒбгмş ţђе ÎМЕ ẁћдŧ ļàņĝŭªġé ŧб üśе ьý ðěƒαűľŧ. ₣òѓ ļάņģųαģєś ţћáŧ ґ℮ŀу öŋ àи ĪΜÊ ǻйð δŏй'т цѕέ £âтĩŋ çħãѓâćтèřš ъγ ðėƒāџľŧ, ţнϊś ŝэťтĭñġ ċάń ье цѕёð τό ƒóřċε ∑ήģĺîѕħ îήρüт οŋ şŧªřťúр. !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !</value>
</data>
<data name="Globals_DefaultInputScopeDefault.Content" xml:space="preserve">
<value>Ðеƒãϋĺţ !!</value>
</data>
<data name="Globals_DefaultInputScopeAlphanumericHalfWidth.Content" xml:space="preserve">
<value>Дĺρħăпυмегїç Ηâŀƒ-Щιδτĥ (Ęñģℓîšĥ) !!! !!! !!! </value>
</data>
<data name="Globals_AlwaysShowTabs.Header" xml:space="preserve">
<value>Άľώāŷš şђǿŵ тãвŝ !!! !</value>
<comment>Header for a control to toggle if the app should always show the tabs (similar to a website browser).</comment>
@@ -1539,6 +1552,10 @@
<value>Ţέхţ !</value>
<comment>Header for a group of settings that control the appearance of text in the app.</comment>
</data>
<data name="Globals_WarningsHeader.Text" xml:space="preserve">
<value>Ẅåŕⁿįņğѕ !!</value>
<comment>Header for a group of settings that control the warnings in the app.</comment>
</data>
<data name="Profile_WindowHeader.Text" xml:space="preserve">
<value>Щіňďош !</value>
<comment>Header for a group of settings that control the appearance of the window frame of the app.</comment>
@@ -1819,6 +1836,15 @@
<value>Ẃářй ẅђëπ ĉľôśĩήĝ mǿѓĕ тĥąπ òπё τάь !!! !!! !!! !</value>
<comment>Header for a control to toggle whether to show a confirm dialog box when closing the application with multiple tabs open.</comment>
</data>
<data name="Globals_InputServiceWarning.Header" xml:space="preserve">
<value>Ẃǻґņ ώћĕπ "Ŧõũčђ Κзγьοдгď ąʼnð Нáлđẅŕīťίńģ Ρàňεℓ Śεŕνîçé" íš đìşāъŀêδ !!! !!! !!! !!! !!! !!! !!</value>
</data>
<data name="Globals_WarnAboutLargePaste.Header" xml:space="preserve">
<value>Ẃăґи ẅнěπ тґўіήĝ τø рáŝťё mοřé ţħäή 5 ΚĩВ òƒ ĉħāґąćτєґѕ !!! !!! !!! !!! !!! !</value>
</data>
<data name="Globals_WarnAboutMultiLinePaste.Header" xml:space="preserve">
<value>Щāřπ ẃĥєи ťгýīлğ ţõ ρäşŧè ª "пėщ ľїл℮" ςћářǻ¢ţēř !!! !!! !!! !!! !!</value>
</data>
<data name="Settings_PortableModeNote.Text" xml:space="preserve">
<value>Ẅїηðσшѕ Ţеřmíńăľ īѕ ґϋййïʼnģ ĭņ рόѓťáъℓė mōďе. !!! !!! !!! !!! !</value>
<comment>A disclaimer that indicates that Terminal is running in a mode that saves settings to a different folder.</comment>

View File

@@ -246,9 +246,22 @@
<comment>A description explaining how this control changes the app's language. {Locked="Windows"}</comment>
</data>
<data name="Globals_LanguageDefault" xml:space="preserve">
<value>Ůŝê ѕŷŝτėм đєƒāùľŧ !!! !!</value>
<value>Ďėƒąūļτ !!</value>
<comment>The app contains a control allowing users to choose the app's language. If this value is chosen, the language preference list of the system settings is used instead.</comment>
</data>
<data name="Globals_DefaultInputScope.Header" xml:space="preserve">
<value>Đέƒàųŀт ĨΜЗ ΐήрũŧ mоδę !!! !!! </value>
<comment>The "input scope" of an IME tells it what type of characters should be available for input. A Chinese IME for instance may show English letters instead of Chinese ones. It's a technical term. We're using "input mode" instead of "input scope" to make it easier to understand for users.</comment>
</data>
<data name="Globals_DefaultInputScope.HelpText" xml:space="preserve">
<value>Íŋƒбгмş ţђе ÎМЕ ẁћдŧ ļàņĝŭªġé ŧб üśе ьý ðěƒαűľŧ. ₣òѓ ļάņģųαģєś ţћáŧ ґ℮ŀу öŋ àи ĪΜÊ ǻйð δŏй'т цѕέ £âтĩŋ çħãѓâćтèřš ъγ ðėƒāџľŧ, ţнϊś ŝэťтĭñġ ċάń ье цѕёð τό ƒóřċε ∑ήģĺîѕħ îήρüт οŋ şŧªřťúр. !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !</value>
</data>
<data name="Globals_DefaultInputScopeDefault.Content" xml:space="preserve">
<value>Ðеƒãϋĺţ !!</value>
</data>
<data name="Globals_DefaultInputScopeAlphanumericHalfWidth.Content" xml:space="preserve">
<value>Дĺρħăпυмегїç Ηâŀƒ-Щιδτĥ (Ęñģℓîšĥ) !!! !!! !!! </value>
</data>
<data name="Globals_AlwaysShowTabs.Header" xml:space="preserve">
<value>Άľώāŷš şђǿŵ тãвŝ !!! !</value>
<comment>Header for a control to toggle if the app should always show the tabs (similar to a website browser).</comment>
@@ -1539,6 +1552,10 @@
<value>Ţέхţ !</value>
<comment>Header for a group of settings that control the appearance of text in the app.</comment>
</data>
<data name="Globals_WarningsHeader.Text" xml:space="preserve">
<value>Ẅåŕⁿįņğѕ !!</value>
<comment>Header for a group of settings that control the warnings in the app.</comment>
</data>
<data name="Profile_WindowHeader.Text" xml:space="preserve">
<value>Щіňďош !</value>
<comment>Header for a group of settings that control the appearance of the window frame of the app.</comment>
@@ -1819,6 +1836,15 @@
<value>Ẃářй ẅђëπ ĉľôśĩήĝ mǿѓĕ тĥąπ òπё τάь !!! !!! !!! !</value>
<comment>Header for a control to toggle whether to show a confirm dialog box when closing the application with multiple tabs open.</comment>
</data>
<data name="Globals_InputServiceWarning.Header" xml:space="preserve">
<value>Ẃǻґņ ώћĕπ "Ŧõũčђ Κзγьοдгď ąʼnð Нáлđẅŕīťίńģ Ρàňεℓ Śεŕνîçé" íš đìşāъŀêδ !!! !!! !!! !!! !!! !!! !!</value>
</data>
<data name="Globals_WarnAboutLargePaste.Header" xml:space="preserve">
<value>Ẃăґи ẅнěπ тґўіήĝ τø рáŝťё mοřé ţħäή 5 ΚĩВ òƒ ĉħāґąćτєґѕ !!! !!! !!! !!! !!! !</value>
</data>
<data name="Globals_WarnAboutMultiLinePaste.Header" xml:space="preserve">
<value>Щāřπ ẃĥєи ťгýīлğ ţõ ρäşŧè ª "пėщ ľїл℮" ςћářǻ¢ţēř !!! !!! !!! !!! !!</value>
</data>
<data name="Settings_PortableModeNote.Text" xml:space="preserve">
<value>Ẅїηðσшѕ Ţеřmíńăľ īѕ ґϋййïʼnģ ĭņ рόѓťáъℓė mōďе. !!! !!! !!! !!! !</value>
<comment>A disclaimer that indicates that Terminal is running in a mode that saves settings to a different folder.</comment>

View File

@@ -246,9 +246,22 @@
<comment>A description explaining how this control changes the app's language. {Locked="Windows"}</comment>
</data>
<data name="Globals_LanguageDefault" xml:space="preserve">
<value>Использовать системные параметры по умолчанию</value>
<value>По умолчанию</value>
<comment>The app contains a control allowing users to choose the app's language. If this value is chosen, the language preference list of the system settings is used instead.</comment>
</data>
<data name="Globals_DefaultInputScope.Header" xml:space="preserve">
<value>Режим ввода IME по умолчанию</value>
<comment>The "input scope" of an IME tells it what type of characters should be available for input. A Chinese IME for instance may show English letters instead of Chinese ones. It's a technical term. We're using "input mode" instead of "input scope" to make it easier to understand for users.</comment>
</data>
<data name="Globals_DefaultInputScope.HelpText" xml:space="preserve">
<value>Сообщает IME, какой язык нужно использовать по умолчанию. Для языков, которые применяют IME и не используют латинские символы по умолчанию, этот параметр можно использовать для принудительного ввода на английском языке при запуске.</value>
</data>
<data name="Globals_DefaultInputScopeDefault.Content" xml:space="preserve">
<value>По умолчанию</value>
</data>
<data name="Globals_DefaultInputScopeAlphanumericHalfWidth.Content" xml:space="preserve">
<value>Буквенно-цифровой полуширинный (английский)</value>
</data>
<data name="Globals_AlwaysShowTabs.Header" xml:space="preserve">
<value>Всегда отображать вкладки</value>
<comment>Header for a control to toggle if the app should always show the tabs (similar to a website browser).</comment>
@@ -1539,6 +1552,10 @@
<value>Текст</value>
<comment>Header for a group of settings that control the appearance of text in the app.</comment>
</data>
<data name="Globals_WarningsHeader.Text" xml:space="preserve">
<value>Предупреждения</value>
<comment>Header for a group of settings that control the warnings in the app.</comment>
</data>
<data name="Profile_WindowHeader.Text" xml:space="preserve">
<value>Окно</value>
<comment>Header for a group of settings that control the appearance of the window frame of the app.</comment>
@@ -1819,6 +1836,15 @@
<value>Предупреждать при закрытии нескольких вкладок</value>
<comment>Header for a control to toggle whether to show a confirm dialog box when closing the application with multiple tabs open.</comment>
</data>
<data name="Globals_InputServiceWarning.Header" xml:space="preserve">
<value>Предупреждать, если параметр "Служба сенсорной клавиатуры и панели рукописного ввода" отключен</value>
</data>
<data name="Globals_WarnAboutLargePaste.Header" xml:space="preserve">
<value>Предупреждать при попытке вставки более 5 КиБ символов</value>
</data>
<data name="Globals_WarnAboutMultiLinePaste.Header" xml:space="preserve">
<value>Предупреждать при попытке вставки символа "новая строка"</value>
</data>
<data name="Settings_PortableModeNote.Text" xml:space="preserve">
<value>Терминал Windows работает в переносном режиме.</value>
<comment>A disclaimer that indicates that Terminal is running in a mode that saves settings to a different folder.</comment>

View File

@@ -246,9 +246,22 @@
<comment>A description explaining how this control changes the app's language. {Locked="Windows"}</comment>
</data>
<data name="Globals_LanguageDefault" xml:space="preserve">
<value>使用系统默认</value>
<value>默认</value>
<comment>The app contains a control allowing users to choose the app's language. If this value is chosen, the language preference list of the system settings is used instead.</comment>
</data>
<data name="Globals_DefaultInputScope.Header" xml:space="preserve">
<value>默认输入法输入模式</value>
<comment>The "input scope" of an IME tells it what type of characters should be available for input. A Chinese IME for instance may show English letters instead of Chinese ones. It's a technical term. We're using "input mode" instead of "input scope" to make it easier to understand for users.</comment>
</data>
<data name="Globals_DefaultInputScope.HelpText" xml:space="preserve">
<value>告知输入法默认使用的语言。对于依赖于输入法且默认不使用拉丁字符的语言,此设置可用于在启动时强制进行英语输入。</value>
</data>
<data name="Globals_DefaultInputScopeDefault.Content" xml:space="preserve">
<value>默认</value>
</data>
<data name="Globals_DefaultInputScopeAlphanumericHalfWidth.Content" xml:space="preserve">
<value>字母数字半角(英语)</value>
</data>
<data name="Globals_AlwaysShowTabs.Header" xml:space="preserve">
<value>始终显示选项卡</value>
<comment>Header for a control to toggle if the app should always show the tabs (similar to a website browser).</comment>
@@ -1157,7 +1170,7 @@
<comment>Header for a control to determine the title of the tab. This is represented using a text box.</comment>
</data>
<data name="Profile_TabTitle.HelpText" xml:space="preserve">
<value>将配置文件名称替换为标题,以在启动时传递给外壳。</value>
<value>将配置文件名称替换为标题,以在启动时传递给 shell。</value>
<comment>A description for what the "tab title" setting does. Presented near "Profile_TabTitle".</comment>
</data>
<data name="Profile_UnfocusedAppearanceTextBlock.Text" xml:space="preserve">
@@ -1539,6 +1552,10 @@
<value>文本</value>
<comment>Header for a group of settings that control the appearance of text in the app.</comment>
</data>
<data name="Globals_WarningsHeader.Text" xml:space="preserve">
<value>警告</value>
<comment>Header for a group of settings that control the warnings in the app.</comment>
</data>
<data name="Profile_WindowHeader.Text" xml:space="preserve">
<value>窗口</value>
<comment>Header for a group of settings that control the appearance of the window frame of the app.</comment>
@@ -1819,6 +1836,15 @@
<value>关闭多个选项卡时发出警告</value>
<comment>Header for a control to toggle whether to show a confirm dialog box when closing the application with multiple tabs open.</comment>
</data>
<data name="Globals_InputServiceWarning.Header" xml:space="preserve">
<value>禁用“触摸键盘和手写面板服务”时发出警告</value>
</data>
<data name="Globals_WarnAboutLargePaste.Header" xml:space="preserve">
<value>尝试粘贴超过 5 KiB 字符时发出警告</value>
</data>
<data name="Globals_WarnAboutMultiLinePaste.Header" xml:space="preserve">
<value>尝试粘贴“新行”字符时发出警告</value>
</data>
<data name="Settings_PortableModeNote.Text" xml:space="preserve">
<value>Windows 终端正在便携模式下运行。</value>
<comment>A disclaimer that indicates that Terminal is running in a mode that saves settings to a different folder.</comment>

View File

@@ -246,9 +246,22 @@
<comment>A description explaining how this control changes the app's language. {Locked="Windows"}</comment>
</data>
<data name="Globals_LanguageDefault" xml:space="preserve">
<value>使用系統預設</value>
<value>預設</value>
<comment>The app contains a control allowing users to choose the app's language. If this value is chosen, the language preference list of the system settings is used instead.</comment>
</data>
<data name="Globals_DefaultInputScope.Header" xml:space="preserve">
<value>預設 IME 輸入模式</value>
<comment>The "input scope" of an IME tells it what type of characters should be available for input. A Chinese IME for instance may show English letters instead of Chinese ones. It's a technical term. We're using "input mode" instead of "input scope" to make it easier to understand for users.</comment>
</data>
<data name="Globals_DefaultInputScope.HelpText" xml:space="preserve">
<value>通知 IME 預設使用的語言。對於依賴 IME 且預設不使用拉丁字元的語言,此設定可用來強制啟動英文輸入。</value>
</data>
<data name="Globals_DefaultInputScopeDefault.Content" xml:space="preserve">
<value>預設</value>
</data>
<data name="Globals_DefaultInputScopeAlphanumericHalfWidth.Content" xml:space="preserve">
<value>英數字元半寬 (英文)</value>
</data>
<data name="Globals_AlwaysShowTabs.Header" xml:space="preserve">
<value>永遠顯示索引標籤</value>
<comment>Header for a control to toggle if the app should always show the tabs (similar to a website browser).</comment>
@@ -1539,6 +1552,10 @@
<value>文字</value>
<comment>Header for a group of settings that control the appearance of text in the app.</comment>
</data>
<data name="Globals_WarningsHeader.Text" xml:space="preserve">
<value>警告</value>
<comment>Header for a group of settings that control the warnings in the app.</comment>
</data>
<data name="Profile_WindowHeader.Text" xml:space="preserve">
<value>視窗</value>
<comment>Header for a group of settings that control the appearance of the window frame of the app.</comment>
@@ -1819,6 +1836,15 @@
<value>關閉多個索引標籤時發出警告</value>
<comment>Header for a control to toggle whether to show a confirm dialog box when closing the application with multiple tabs open.</comment>
</data>
<data name="Globals_InputServiceWarning.Header" xml:space="preserve">
<value>停用「觸控式鍵盤和手寫面板服務」時發出警告</value>
</data>
<data name="Globals_WarnAboutLargePaste.Header" xml:space="preserve">
<value>嘗試貼上超過 5 個 KiB 字元時發出警告</value>
</data>
<data name="Globals_WarnAboutMultiLinePaste.Header" xml:space="preserve">
<value>嘗試貼上「新行」字元時發出警告</value>
</data>
<data name="Settings_PortableModeNote.Text" xml:space="preserve">
<value>Windows 終端機正以可攜式模式執行。</value>
<comment>A disclaimer that indicates that Terminal is running in a mode that saves settings to a different folder.</comment>

View File

@@ -44,6 +44,9 @@
<StaticResource x:Key="SettingContainerMessageForeground"
ResourceKey="TextFillColorPrimaryBrush" />
<StaticResource x:Key="SettingContainerResetButtonIconForeground"
ResourceKey="SystemAccentColorDark2" />
</ResourceDictionary>
<ResourceDictionary x:Key="HighContrast">
<Style x:Key="SecondaryTextBlockStyle"
@@ -73,6 +76,9 @@
ResourceKey="SystemColorWindowTextColorBrush" />
<StaticResource x:Key="SettingContainerMessageForeground"
ResourceKey="SystemColorWindowTextColorBrush" />
<StaticResource x:Key="SettingContainerResetButtonIconForeground"
ResourceKey="SystemAccentColorLight1" />
</ResourceDictionary>
<ResourceDictionary x:Key="Dark">
<Style x:Key="SecondaryTextBlockStyle"
@@ -106,6 +112,9 @@
ResourceKey="TextFillColorPrimaryBrush" />
<StaticResource x:Key="SettingContainerMessageForeground"
ResourceKey="TextFillColorPrimaryBrush" />
<StaticResource x:Key="SettingContainerResetButtonIconForeground"
ResourceKey="SystemAccentColorLight2" />
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
@@ -136,7 +145,7 @@
<Style x:Key="SettingContainerFontIconStyle"
TargetType="FontIcon">
<Setter Property="Foreground" Value="{StaticResource SystemAccentColor}" />
<Setter Property="Foreground" Value="{ThemeResource SettingContainerResetButtonIconForeground}" />
<Setter Property="FontSize" Value="11" />
<Setter Property="FontFamily" Value="{ThemeResource SymbolThemeFontFamily}" />
</Style>

View File

@@ -774,7 +774,7 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
// covers actions w/out args
// - "command": "unbound" --> "unbound"
// - "command": "copy" --> "copy"
changes.emplace(fmt::format(FMT_COMPILE("{}"), json.asString()));
changes.emplace(json.asString());
}
else
{

View File

@@ -33,6 +33,7 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
DEFINE_ENUM_MAP(winrt::Windows::UI::Xaml::ElementTheme, ElementTheme);
DEFINE_ENUM_MAP(Model::NewTabPosition, NewTabPosition);
DEFINE_ENUM_MAP(winrt::Microsoft::UI::Xaml::Controls::TabViewWidthMode, TabViewWidthMode);
DEFINE_ENUM_MAP(Microsoft::Terminal::Control::DefaultInputScope, DefaultInputScope);
DEFINE_ENUM_MAP(Model::FirstWindowPreference, FirstWindowPreference);
DEFINE_ENUM_MAP(Model::LaunchMode, LaunchMode);
DEFINE_ENUM_MAP(Model::TabSwitcherMode, TabSwitcherMode);

View File

@@ -29,6 +29,7 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
static winrt::Windows::Foundation::Collections::IMap<winrt::hstring, winrt::Windows::UI::Xaml::ElementTheme> ElementTheme();
static winrt::Windows::Foundation::Collections::IMap<winrt::hstring, NewTabPosition> NewTabPosition();
static winrt::Windows::Foundation::Collections::IMap<winrt::hstring, winrt::Microsoft::UI::Xaml::Controls::TabViewWidthMode> TabViewWidthMode();
static winrt::Windows::Foundation::Collections::IMap<winrt::hstring, winrt::Microsoft::Terminal::Control::DefaultInputScope> DefaultInputScope();
static winrt::Windows::Foundation::Collections::IMap<winrt::hstring, FirstWindowPreference> FirstWindowPreference();
static winrt::Windows::Foundation::Collections::IMap<winrt::hstring, LaunchMode> LaunchMode();
static winrt::Windows::Foundation::Collections::IMap<winrt::hstring, TabSwitcherMode> TabSwitcherMode();

View File

@@ -11,6 +11,7 @@ namespace Microsoft.Terminal.Settings.Model
static Windows.Foundation.Collections.IMap<String, Windows.UI.Xaml.ElementTheme> ElementTheme { get; };
static Windows.Foundation.Collections.IMap<String, Microsoft.Terminal.Settings.Model.NewTabPosition> NewTabPosition { get; };
static Windows.Foundation.Collections.IMap<String, Microsoft.UI.Xaml.Controls.TabViewWidthMode> TabViewWidthMode { get; };
static Windows.Foundation.Collections.IMap<String, Microsoft.Terminal.Control.DefaultInputScope> DefaultInputScope { get; };
static Windows.Foundation.Collections.IMap<String, Microsoft.Terminal.Settings.Model.FirstWindowPreference> FirstWindowPreference { get; };
static Windows.Foundation.Collections.IMap<String, Microsoft.Terminal.Settings.Model.LaunchMode> LaunchMode { get; };
static Windows.Foundation.Collections.IMap<String, Microsoft.Terminal.Settings.Model.TabSwitcherMode> TabSwitcherMode { get; };

View File

@@ -269,6 +269,10 @@ Json::Value GlobalAppSettings::ToJson()
{
_TextMeasurement.reset();
}
if (_DefaultInputScope == Control::DefaultInputScope::Default)
{
_DefaultInputScope.reset();
}
if (_DisablePartialInvalidation == false)
{

View File

@@ -73,6 +73,7 @@ namespace Microsoft.Terminal.Settings.Model
INHERITABLE_SETTING(Boolean, TrimPaste);
INHERITABLE_SETTING(LaunchPosition, InitialPosition);
INHERITABLE_SETTING(Boolean, CenterOnLaunch);
INHERITABLE_SETTING(Microsoft.Terminal.Control.DefaultInputScope, DefaultInputScope);
INHERITABLE_SETTING(FirstWindowPreference, FirstWindowPreference);
INHERITABLE_SETTING(LaunchMode, LaunchMode);
INHERITABLE_SETTING(Boolean, SnapToGridOnResize);

View File

@@ -28,6 +28,7 @@ Author(s):
X(bool, DisablePartialInvalidation, "rendering.disablePartialInvalidation", false) \
X(bool, SoftwareRendering, "rendering.software", false) \
X(winrt::Microsoft::Terminal::Control::TextMeasurement, TextMeasurement, "compatibility.textMeasurement") \
X(winrt::Microsoft::Terminal::Control::DefaultInputScope, DefaultInputScope, "defaultInputScope") \
X(bool, UseBackgroundImageForWindow, "experimental.useBackgroundImageForWindow", false) \
X(bool, ForceVTInput, "experimental.input.forceVT", false) \
X(bool, TrimBlockSelection, "trimBlockSelection", true) \

View File

@@ -368,6 +368,7 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
_DisablePartialInvalidation = globalSettings.DisablePartialInvalidation();
_SoftwareRendering = globalSettings.SoftwareRendering();
_TextMeasurement = globalSettings.TextMeasurement();
_DefaultInputScope = globalSettings.DefaultInputScope();
_UseBackgroundImageForWindow = globalSettings.UseBackgroundImageForWindow();
_ForceVTInput = globalSettings.ForceVTInput();
_TrimBlockSelection = globalSettings.TrimBlockSelection();

View File

@@ -161,6 +161,7 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
INHERITABLE_SETTING(Model::TerminalSettings, bool, DisablePartialInvalidation, false);
INHERITABLE_SETTING(Model::TerminalSettings, bool, SoftwareRendering, false);
INHERITABLE_SETTING(Model::TerminalSettings, Microsoft::Terminal::Control::TextMeasurement, TextMeasurement);
INHERITABLE_SETTING(Model::TerminalSettings, Microsoft::Terminal::Control::DefaultInputScope, DefaultInputScope);
INHERITABLE_SETTING(Model::TerminalSettings, bool, UseBackgroundImageForWindow, false);
INHERITABLE_SETTING(Model::TerminalSettings, bool, ForceVTInput, false);

View File

@@ -782,3 +782,11 @@ JSON_ENUM_MAPPER(::winrt::Microsoft::Terminal::Control::TextMeasurement)
pair_type{ "console", ValueType::Console },
};
};
JSON_ENUM_MAPPER(::winrt::Microsoft::Terminal::Control::DefaultInputScope)
{
JSON_MAPPINGS(2) = {
pair_type{ "default", ValueType::Default },
pair_type{ "alphanumericHalfWidth", ValueType::AlphanumericHalfWidth },
};
};

View File

@@ -8,7 +8,8 @@
"action": "experimental.colorSelection"
// default fg and bg (i07 and i00)
},
"keys": "alt+1"
"keys": "alt+1",
"id": "Terminal.ColorSelectionDefaultFgAndBg"
},
{
"command":
@@ -16,7 +17,8 @@
"action": "experimental.colorSelection",
"foreground": "i08"
},
"keys": "alt+2"
"keys": "alt+2",
"id": "Terminal.ColorSelectionFgIndex8"
},
{
"command":
@@ -24,7 +26,8 @@
"action": "experimental.colorSelection",
"foreground": "i0c"
},
"keys": "alt+3"
"keys": "alt+3",
"id": "Terminal.ColorSelectionFgIndex12"
},
{
"command":
@@ -32,7 +35,8 @@
"action": "experimental.colorSelection",
"foreground": "i0a"
},
"keys": "alt+4"
"keys": "alt+4",
"id": "Terminal.ColorSelectionFgIndex10"
},
{
"command":
@@ -40,7 +44,8 @@
"action": "experimental.colorSelection",
"foreground": "i0e"
},
"keys": "alt+5"
"keys": "alt+5",
"id": "Terminal.ColorSelectionFgIndex14"
},
{
"command":
@@ -48,7 +53,8 @@
"action": "experimental.colorSelection",
"foreground": "i09"
},
"keys": "alt+6"
"keys": "alt+6",
"id": "Terminal.ColorSelectionFgIndex9"
},
{
"command":
@@ -56,7 +62,8 @@
"action": "experimental.colorSelection",
"foreground": "i0d"
},
"keys": "alt+7"
"keys": "alt+7",
"id": "Terminal.ColorSelectionFgIndex13"
},
{
"command":
@@ -64,7 +71,8 @@
"action": "experimental.colorSelection",
"foreground": "i0b"
},
"keys": "alt+8"
"keys": "alt+8",
"id": "Terminal.ColorSelectionFgIndex11"
},
{
"command":
@@ -72,7 +80,8 @@
"action": "experimental.colorSelection",
"foreground": "i0f"
},
"keys": "alt+9"
"keys": "alt+9",
"id": "Terminal.ColorSelectionFgIndex15"
},
{
"command":
@@ -80,7 +89,8 @@
"action": "experimental.colorSelection",
"foreground": "i03"
},
"keys": "alt+0"
"keys": "alt+0",
"id": "Terminal.ColorSelectionFgIndex3"
},
// background
{
@@ -90,7 +100,8 @@
"foreground": "i00",
"background": "i07"
},
"keys": "ctrl+1"
"keys": "ctrl+1",
"id": "Terminal.ColorSelectionBgIndex7"
},
{
"command":
@@ -99,7 +110,8 @@
"foreground": "i00",
"background": "i08"
},
"keys": "ctrl+2"
"keys": "ctrl+2",
"id": "Terminal.ColorSelectionBgIndex8"
},
{
"command":
@@ -108,7 +120,8 @@
"foreground": "i00",
"background": "i0c"
},
"keys": "ctrl+3"
"keys": "ctrl+3",
"id": "Terminal.ColorSelectionBgIndex12"
},
{
"command":
@@ -117,7 +130,8 @@
"foreground": "i00",
"background": "i0a"
},
"keys": "ctrl+4"
"keys": "ctrl+4",
"id": "Terminal.ColorSelectionBgIndex10"
},
{
"command":
@@ -126,7 +140,8 @@
"foreground": "i00",
"background": "i0e"
},
"keys": "ctrl+5"
"keys": "ctrl+5",
"id": "Terminal.ColorSelectionBgIndex14"
},
{
"command":
@@ -135,7 +150,8 @@
"foreground": "i00",
"background": "i09"
},
"keys": "ctrl+6"
"keys": "ctrl+6",
"id": "Terminal.ColorSelectionBgIndex9"
},
{
"command":
@@ -144,7 +160,8 @@
"foreground": "i00",
"background": "i0d"
},
"keys": "ctrl+7"
"keys": "ctrl+7",
"id": "Terminal.ColorSelectionBgIndex13"
},
{
"command":
@@ -153,7 +170,8 @@
"foreground": "i00",
"background": "i0b"
},
"keys": "ctrl+8"
"keys": "ctrl+8",
"id": "Terminal.ColorSelectionBgIndex11"
},
{
"command":
@@ -162,7 +180,8 @@
"foreground": "i00",
"background": "i0f"
},
"keys": "ctrl+9"
"keys": "ctrl+9",
"id": "Terminal.ColorSelectionBgIndex15"
},
{
"command":
@@ -171,7 +190,8 @@
"foreground": "i00",
"background": "i03"
},
"keys": "ctrl+0"
"keys": "ctrl+0",
"id": "Terminal.ColorSelectionBgIndex3"
},
// with matching
// Foreground, all matches
@@ -182,7 +202,8 @@
"matchMode": "all",
// default fg and bg (i07 and i00)
},
"keys": "alt+shift+1"
"keys": "alt+shift+1",
"id": "Terminal.ColorSelectionMatchDefaultFgAndBg"
},
{
"command":
@@ -191,7 +212,8 @@
"matchMode": "all",
"foreground": "i08"
},
"keys": "alt+shift+2"
"keys": "alt+shift+2",
"id": "Terminal.ColorSelectionMatchFgIndex8"
},
{
"command":
@@ -200,7 +222,8 @@
"matchMode": "all",
"foreground": "i0c"
},
"keys": "alt+shift+3"
"keys": "alt+shift+3",
"id": "Terminal.ColorSelectionMatchFgIndex12"
},
{
"command":
@@ -209,7 +232,8 @@
"matchMode": "all",
"foreground": "i0a"
},
"keys": "alt+shift+4"
"keys": "alt+shift+4",
"id": "Terminal.ColorSelectionMatchFgIndex10"
},
{
"command":
@@ -218,7 +242,8 @@
"matchMode": "all",
"foreground": "i0e"
},
"keys": "alt+shift+5"
"keys": "alt+shift+5",
"id": "Terminal.ColorSelectionMatchFgIndex14"
},
{
"command":
@@ -227,7 +252,8 @@
"matchMode": "all",
"foreground": "i09"
},
"keys": "alt+shift+6"
"keys": "alt+shift+6",
"id": "Terminal.ColorSelectionMatchFgIndex9"
},
{
"command":
@@ -236,7 +262,8 @@
"matchMode": "all",
"foreground": "i0d"
},
"keys": "alt+shift+7"
"keys": "alt+shift+7",
"id": "Terminal.ColorSelectionMatchFgIndex13"
},
{
"command":
@@ -245,7 +272,8 @@
"matchMode": "all",
"foreground": "i0b"
},
"keys": "alt+shift+8"
"keys": "alt+shift+8",
"id": "Terminal.ColorSelectionMatchFgIndex11"
},
{
"command":
@@ -254,7 +282,8 @@
"matchMode": "all",
"foreground": "i0f"
},
"keys": "alt+shift+9"
"keys": "alt+shift+9",
"id": "Terminal.ColorSelectionMatchFgIndex15"
},
{
"command":
@@ -263,7 +292,8 @@
"matchMode": "all",
"foreground": "i03"
},
"keys": "alt+shift+0"
"keys": "alt+shift+0",
"id": "Terminal.ColorSelectionMatchFgIndex3"
},
// background, all matches
{
@@ -274,7 +304,8 @@
"foreground": "i00",
"background": "i07"
},
"keys": "ctrl+shift+1"
"keys": "ctrl+shift+1",
"id": "Terminal.ColorSelectionMatchBgIndex7"
},
{
"command":
@@ -284,7 +315,8 @@
"foreground": "i00",
"background": "i08"
},
"keys": "ctrl+shift+2"
"keys": "ctrl+shift+2",
"id": "Terminal.ColorSelectionMatchBgIndex8"
},
{
"command":
@@ -294,7 +326,8 @@
"foreground": "i00",
"background": "i0c"
},
"keys": "ctrl+shift+3"
"keys": "ctrl+shift+3",
"id": "Terminal.ColorSelectionMatchBgIndex12"
},
{
"command":
@@ -304,7 +337,8 @@
"foreground": "i00",
"background": "i0a"
},
"keys": "ctrl+shift+4"
"keys": "ctrl+shift+4",
"id": "Terminal.ColorSelectionMatchBgIndex10"
},
{
"command":
@@ -314,7 +348,8 @@
"foreground": "i00",
"background": "i0e"
},
"keys": "ctrl+shift+5"
"keys": "ctrl+shift+5",
"id": "Terminal.ColorSelectionMatchBgIndex14"
},
{
"command":
@@ -324,7 +359,8 @@
"foreground": "i00",
"background": "i09"
},
"keys": "ctrl+shift+6"
"keys": "ctrl+shift+6",
"id": "Terminal.ColorSelectionMatchBgIndex9"
},
{
"command":
@@ -334,7 +370,8 @@
"foreground": "i00",
"background": "i0d"
},
"keys": "ctrl+shift+7"
"keys": "ctrl+shift+7",
"id": "Terminal.ColorSelectionMatchBgIndex13"
},
{
"command":
@@ -344,7 +381,8 @@
"foreground": "i00",
"background": "i0b"
},
"keys": "ctrl+shift+8"
"keys": "ctrl+shift+8",
"id": "Terminal.ColorSelectionMatchBgIndex11"
},
{
"command":
@@ -354,7 +392,8 @@
"foreground": "i00",
"background": "i0f"
},
"keys": "ctrl+shift+9"
"keys": "ctrl+shift+9",
"id": "Terminal.ColorSelectionMatchBgIndex15"
},
{
"command":
@@ -364,7 +403,8 @@
"foreground": "i00",
"background": "i03"
},
"keys": "ctrl+shift+0"
"keys": "ctrl+shift+0",
"id": "Terminal.ColorSelectionMatchBgIndex3"
}
]
}

View File

@@ -304,9 +304,9 @@ namespace ControlUnitTests
Log::Comment(L"Check the buffer after the clear");
VERIFY_ARE_EQUAL(20, core->_terminal->GetViewport().Height());
VERIFY_ARE_EQUAL(21, core->ScrollOffset());
VERIFY_ARE_EQUAL(41, core->ScrollOffset());
VERIFY_ARE_EQUAL(20, core->ViewHeight());
VERIFY_ARE_EQUAL(41, core->BufferHeight());
VERIFY_ARE_EQUAL(61, core->BufferHeight());
// In this test, we can't actually check if we cleared the buffer
// contents. ConPTY will handle the actual clearing of the buffer

View File

@@ -1181,11 +1181,23 @@ void AppHost::_IsQuakeWindowChanged(const winrt::Windows::Foundation::IInspectab
// Raised from our Peasant. We handle by propagating the call to our terminal window.
void AppHost::_QuitRequested(const winrt::Windows::Foundation::IInspectable&, const winrt::Windows::Foundation::IInspectable&)
{
const auto root = _windowLogic.GetRoot();
if (!root)
{
return;
}
const auto dispatcher = root.Dispatcher();
if (!dispatcher)
{
return;
}
// We process the shutdown synchronously here, because otherwise the
// AutomaticShutdownRequested() logic wouldn't run synchronously either.
til::latch latch{ 1 };
_windowLogic.GetRoot().Dispatcher().RunAsync(winrt::Windows::UI::Core::CoreDispatcherPriority::Normal, [&latch, weakThis = weak_from_this()]() {
dispatcher.RunAsync(winrt::Windows::UI::Core::CoreDispatcherPriority::Normal, [&latch, weakThis = weak_from_this()]() {
const auto countDownOnExit = wil::scope_exit([&latch] {
latch.count_down();
});

View File

@@ -510,6 +510,15 @@ long IslandWindow::_calculateTotalSize(const bool isWidth, const long clientSize
_HandleCreateWindow(wparam, lparam);
return 0;
}
case WM_ENABLE:
{
if (_interopWindowHandle != nullptr)
{
// send focus to the child window
SetFocus(_interopWindowHandle);
}
break;
}
case WM_SETFOCUS:
{
if (_interopWindowHandle != nullptr)

View File

@@ -79,6 +79,7 @@
X(bool, DisablePartialInvalidation, false) \
X(bool, SoftwareRendering, false) \
X(winrt::Microsoft::Terminal::Control::TextMeasurement, TextMeasurement) \
X(winrt::Microsoft::Terminal::Control::DefaultInputScope, DefaultInputScope, winrt::Microsoft::Terminal::Control::DefaultInputScope::Default) \
X(bool, UseBackgroundImageForWindow, false) \
X(bool, ShowMarks, false) \
X(winrt::Microsoft::Terminal::Control::CopyFormat, CopyFormatting, 0) \

View File

@@ -163,6 +163,7 @@
<alwaysEnabledBrandingTokens>
<brandingToken>Dev</brandingToken>
<brandingToken>Canary</brandingToken>
<brandingToken>Preview</brandingToken>
</alwaysEnabledBrandingTokens>
</feature>
@@ -174,6 +175,7 @@
<alwaysEnabledBrandingTokens>
<brandingToken>Dev</brandingToken>
<brandingToken>Canary</brandingToken>
<brandingToken>Preview</brandingToken>
</alwaysEnabledBrandingTokens>
</feature>

View File

@@ -7,6 +7,7 @@
#include "output.h"
#include "handle.h"
#include "_stream.h"
#include "../interactivity/inc/ServiceLocator.hpp"
using namespace Microsoft::Console;
@@ -197,7 +198,9 @@ void PtySignalInputThread::_DoClearBuffer() const
}
auto& gci = ServiceLocator::LocateGlobals().getConsoleInformation();
THROW_IF_FAILED(gci.GetActiveOutputBuffer().ClearBuffer());
auto& screenInfo = gci.GetActiveOutputBuffer();
auto& stateMachine = screenInfo.GetStateMachine();
stateMachine.ProcessString(L"\x1b[H\x1b[2J");
}
void PtySignalInputThread::_DoShowHide(const ShowHideData& data)

View File

@@ -6,6 +6,7 @@
#include <til/unicode.h>
#include "directio.h"
#include "handle.h" // LockConsole
#include "output.h" // CloseConsoleProcessState
#include "../interactivity/inc/ServiceLocator.hpp"
@@ -790,3 +791,51 @@ void VtIo::Writer::WriteInfos(til::point target, std::span<const CHAR_INFO> info
} while (--repeat);
}
}
void VtIo::Writer::WriteScreenInfo(SCREEN_INFORMATION& newContext, til::size oldSize) const
{
const auto area = static_cast<size_t>(oldSize.width * oldSize.height);
auto& main = newContext.GetMainBuffer();
auto& alt = newContext.GetActiveBuffer();
const auto hasAltBuffer = &alt != &main;
// TODO GH#5094: This could use xterm's XTWINOPS "\e[8;<height>;<width>t" escape sequence here.
if (oldSize != main.GetBufferSize().Dimensions())
{
THROW_IF_NTSTATUS_FAILED(main.ResizeTraditional(oldSize));
main.SetViewportSize(&oldSize);
}
if (hasAltBuffer && oldSize != alt.GetBufferSize().Dimensions())
{
THROW_IF_NTSTATUS_FAILED(alt.ResizeTraditional(oldSize));
alt.SetViewportSize(&oldSize);
}
const auto request = Viewport::FromDimensions({}, oldSize);
Viewport read;
til::small_vector<CHAR_INFO, 1024> infos;
infos.resize(area, CHAR_INFO{ L' ', FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED });
const auto dumpScreenInfo = [&](SCREEN_INFORMATION& screenInfo) {
THROW_IF_FAILED(ReadConsoleOutputWImplHelper(screenInfo, infos, request, read));
for (til::CoordType i = 0; i < oldSize.height; i++)
{
WriteInfos({ 0, i }, { infos.begin() + i * oldSize.width, static_cast<size_t>(oldSize.width) });
}
WriteCUP(screenInfo.GetTextBuffer().GetCursor().GetPosition());
WriteAttributes(screenInfo.GetAttributes());
WriteDECTCEM(screenInfo.GetTextBuffer().GetCursor().IsVisible());
WriteDECAWM(WI_IsFlagSet(screenInfo.OutputMode, ENABLE_WRAP_AT_EOL_OUTPUT));
};
WriteASB(false);
dumpScreenInfo(main);
if (hasAltBuffer)
{
WriteASB(true);
dumpScreenInfo(alt);
}
}

View File

@@ -44,6 +44,7 @@ namespace Microsoft::Console::VirtualTerminal
void WriteWindowTitle(std::wstring_view title) const;
void WriteAttributes(const TextAttribute& attributes) const;
void WriteInfos(til::point target, std::span<const CHAR_INFO> infos) const;
void WriteScreenInfo(SCREEN_INFORMATION& newContext, til::size oldSize) const;
private:
VtIo* _io = nullptr;

View File

@@ -487,49 +487,8 @@ void ApiRoutines::SetConsoleActiveScreenBufferImpl(SCREEN_INFORMATION& newContex
if (auto writer = gci.GetVtWriter())
{
const auto viewport = gci.GetActiveOutputBuffer().GetBufferSize();
const auto size = viewport.Dimensions();
const auto area = static_cast<size_t>(viewport.Width() * viewport.Height());
auto& main = newContext.GetMainBuffer();
auto& alt = newContext.GetActiveBuffer();
const auto hasAltBuffer = &alt != &main;
// TODO GH#5094: This could use xterm's XTWINOPS "\e[8;<height>;<width>t" escape sequence here.
THROW_IF_NTSTATUS_FAILED(main.ResizeTraditional(size));
main.SetViewportSize(&size);
if (hasAltBuffer)
{
THROW_IF_NTSTATUS_FAILED(alt.ResizeTraditional(size));
alt.SetViewportSize(&size);
}
Viewport read;
til::small_vector<CHAR_INFO, 1024> infos;
infos.resize(area, CHAR_INFO{ L' ', FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED });
const auto dumpScreenInfo = [&](SCREEN_INFORMATION& screenInfo) {
THROW_IF_FAILED(ReadConsoleOutputWImpl(screenInfo, infos, viewport, read));
for (til::CoordType i = 0; i < size.height; i++)
{
writer.WriteInfos({ 0, i }, { infos.begin() + i * size.width, static_cast<size_t>(size.width) });
}
writer.WriteCUP(screenInfo.GetTextBuffer().GetCursor().GetPosition());
writer.WriteAttributes(screenInfo.GetAttributes());
writer.WriteDECTCEM(screenInfo.GetTextBuffer().GetCursor().IsVisible());
writer.WriteDECAWM(WI_IsFlagSet(screenInfo.OutputMode, ENABLE_WRAP_AT_EOL_OUTPUT));
};
writer.WriteASB(false);
dumpScreenInfo(main);
if (hasAltBuffer)
{
writer.WriteASB(true);
dumpScreenInfo(alt);
}
const auto oldSize = gci.GetActiveOutputBuffer().GetBufferSize().Dimensions();
writer.WriteScreenInfo(newContext, oldSize);
writer.Submit();
}
@@ -995,7 +954,9 @@ void ApiRoutines::GetLargestConsoleWindowSizeImpl(const SCREEN_INFORMATION& cont
try
{
// Just in case if the client application didn't check if this request is useless.
if (source.left == target.x && source.top == target.y)
// Checking if the source is empty also prevents bugs where we use the size of calculations.
if ((source.left == target.x && source.top == target.y) ||
source.left > source.right || source.top > source.bottom)
{
return S_OK;
}
@@ -1044,23 +1005,23 @@ void ApiRoutines::GetLargestConsoleWindowSizeImpl(const SCREEN_INFORMATION& cont
if (gci.GetVtIo()->GetDeviceAttributes().test(Microsoft::Console::VirtualTerminal::DeviceAttribute::RectangularAreaOperations))
{
// This calculates just the positive offsets caused by out-of-bounds (OOB) source and target coordinates.
//
// If the source rectangle is OOB to the bottom-right, then the size of the rectangle that can
// be copied shrinks, but its origin stays the same. However, if the rectangle is OOB to the
// top-left then the origin of the to-be-copied rectangle will be offset by an inverse amount.
// Similarly, if the *target* rectangle is OOB to the bottom-right, its size shrinks while
// the origin stays the same, and if it's OOB to the top-left, then the origin is offset.
//
// In other words, this calculates the total offset that needs to be applied to the to-be-copied rectangle.
// Later down below we'll then clamp that rectangle which will cause its size to shrink as needed.
const til::point offset{
std::max(0, -source.left) + std::max(0, clipViewport.Left() - target.x),
std::max(0, -source.top) + std::max(0, clipViewport.Top() - target.y),
};
const til::point targetSourceDistance{ target - sourceViewport.Origin() };
const til::point sourceTargetDistance{ -targetSourceDistance.x, -targetSourceDistance.y };
const auto copyTargetViewport = Viewport::FromDimensions(target + offset, sourceViewport.Dimensions()).Clamp(clipViewport);
const auto copySourceViewport = Viewport::FromDimensions(sourceViewport.Origin() + offset, copyTargetViewport.Dimensions()).Clamp(bufferSize);
// To figure out what part of "source" we can copy to "target" without
// * reading outside the bufferSize
// * writing outside the clipViewport
// we move the clipViewport into a coordinate system relative to the source rectangle (= clipAtSource).
// Then we can intersect the source rectangle with both the valid bufferSize and clipAtSource at once.
const auto clipAtSource = Viewport::Offset(clipViewport, sourceTargetDistance);
auto copySourceViewport = sourceViewport.Clamp(bufferSize).Clamp(clipAtSource);
if (!copySourceViewport.IsValid())
{
copySourceViewport = Viewport::Empty();
}
// Afterward we can undo the translation of clipAtSource to get the target rectangle.
const auto copyTargetViewport = Viewport::Offset(copySourceViewport, targetSourceDistance);
const auto fills = Viewport::Subtract(fillViewport, copyTargetViewport);
std::wstring buf;
@@ -1069,7 +1030,7 @@ void ApiRoutines::GetLargestConsoleWindowSizeImpl(const SCREEN_INFORMATION& cont
Microsoft::Console::VirtualTerminal::VtIo::FormatAttributes(buf, TextAttribute{ fillAttribute });
}
if (copySourceViewport.IsValid() && copyTargetViewport.IsValid())
if (copyTargetViewport.IsValid())
{
// DECCRA: Copy Rectangular Area
fmt::format_to(

View File

@@ -1267,17 +1267,30 @@ COOKED_READ_DATA::LayoutResult COOKED_READ_DATA::_layoutLine(std::wstring& outpu
output.append(text, 0, len);
column += cols;
it += len;
if (it != nextControlChar)
{
// The only reason that not all text could be fit into the line is if the last character was a wide glyph.
// In that case we want to return the columnLimit, to indicate that the row is full and a line wrap is required,
// BUT DON'T want to pad the line with a whitespace to actually fill the line to the columnLimit.
// This is because copying the prompt contents (Ctrl-A, Ctrl-C) should not copy any trailing padding whitespace.
//
// Thanks to this lie, the _redisplay() code will not use a CRLF sequence or similar to move to the next line,
// as it thinks that this row has naturally wrapped. This causes it to print the wide glyph on the preceding line
// which causes the terminal to insert the padding whitespace for us.
column = columnLimit;
break;
}
if (column >= columnLimit)
{
break;
}
}
const auto nextPlainChar = std::find_if(it, end, [](const auto& wch) { return wch >= L' '; });
for (; it != nextPlainChar; ++it)
{
if (column >= columnLimit)
{
column = columnLimit;
goto outerLoopExit;
}
const auto wch = *it;
wchar_t buf[8];
til::CoordType len = 0;
@@ -1297,11 +1310,20 @@ COOKED_READ_DATA::LayoutResult COOKED_READ_DATA::_layoutLine(std::wstring& outpu
if (column + len > columnLimit)
{
// Unlike above with regular text we can't avoid padding the line with whitespace, because a string
// like "^A" is not a wide glyph, and so we cannot trick the terminal to insert the padding for us.
output.append(columnLimit - column, L' ');
column = columnLimit;
goto outerLoopExit;
}
output.append(buf, len);
column += len;
if (column >= columnLimit)
{
goto outerLoopExit;
}
}
}

View File

@@ -2129,38 +2129,6 @@ void SCREEN_INFORMATION::SetViewport(const Viewport& newViewport,
Tracing::s_TraceWindowViewport(_viewport);
}
// Method Description:
// - Clear the entire contents of the viewport, except for the cursor's row,
// which is moved to the top line of the viewport.
// - This is used exclusively by ConPTY to support GH#1193, GH#1882. This allows
// a terminal to clear the contents of the ConPTY buffer, which is important
// if the user would like to be able to clear the terminal-side buffer.
// Arguments:
// - <none>
// Return Value:
// - S_OK
[[nodiscard]] HRESULT SCREEN_INFORMATION::ClearBuffer()
{
// Rotate the buffer to bring the cursor row to the top of the viewport.
const auto cursorPos = _textBuffer->GetCursor().GetPosition();
for (auto i = 0; i < cursorPos.y; i++)
{
_textBuffer->IncrementCircularBuffer();
}
// Erase everything below that point.
RETURN_IF_FAILED(SetCursorPosition({ 0, 1 }, false));
auto& engine = reinterpret_cast<OutputStateMachineEngine&>(_stateMachine->Engine());
engine.Dispatch().EraseInDisplay(DispatchTypes::EraseType::ToEnd);
// Restore the original cursor x offset, but now on the first row.
RETURN_IF_FAILED(SetCursorPosition({ cursorPos.x, 0 }, false));
_textBuffer->TriggerRedrawAll();
return S_OK;
}
// Routine Description:
// - Writes cells to the output buffer at the cursor position.
// Arguments:

View File

@@ -203,8 +203,6 @@ public:
void SetDefaultAttributes(const TextAttribute& attributes,
const TextAttribute& popupAttributes);
[[nodiscard]] HRESULT ClearBuffer();
void UpdateBottom();
FontInfo& GetCurrentFont() noexcept;

View File

@@ -36,7 +36,7 @@ Settings::Settings() :
_bAutoPosition(true),
_uHistoryBufferSize(DEFAULT_NUMBER_OF_COMMANDS),
_uNumberOfHistoryBuffers(DEFAULT_NUMBER_OF_BUFFERS),
_bHistoryNoDup(false),
_bHistoryNoDup(true),
// ColorTable initialized below
_uCodePage(ServiceLocator::LocateGlobals().uiOEMCP),
_uScrollScale(1),
@@ -110,7 +110,7 @@ void Settings::ApplyDesktopSpecificDefaults()
_bQuickEdit = TRUE;
_uHistoryBufferSize = 50;
_uNumberOfHistoryBuffers = 4;
_bHistoryNoDup = FALSE;
_bHistoryNoDup = true;
_renderSettings.ResetColorTable();
@@ -349,6 +349,8 @@ void Settings::Validate()
TextAttribute::SetLegacyDefaultAttributes(_wFillAttribute);
// And calculate the position of the default colors in the color table.
CalculateDefaultColorIndices();
// We can also then save these values as the default render settings.
SaveDefaultRenderSettings();
FAIL_FAST_IF(!(_dwWindowSize.X > 0));
FAIL_FAST_IF(!(_dwWindowSize.Y > 0));
@@ -755,6 +757,11 @@ void Settings::CalculateDefaultColorIndices() noexcept
_renderSettings.SetColorAliasIndex(ColorAlias::DefaultBackground, backgroundAlias);
}
void Settings::SaveDefaultRenderSettings() noexcept
{
_renderSettings.SaveDefaultSettings();
}
bool Settings::IsTerminalScrolling() const noexcept
{
return _TerminalScrolling;

View File

@@ -172,6 +172,7 @@ public:
void SetInterceptCopyPaste(const bool interceptCopyPaste) noexcept;
void CalculateDefaultColorIndices() noexcept;
void SaveDefaultRenderSettings() noexcept;
bool IsTerminalScrolling() const noexcept;
void SetTerminalScrolling(const bool terminalScrollingEnabled) noexcept;

View File

@@ -16,6 +16,7 @@
#include "../interactivity/inc/ServiceLocator.hpp"
#include "../../inc/conattrs.hpp"
#include "../../types/inc/colorTable.hpp"
#include "../../types/inc/Viewport.hpp"
#include "../../inc/TestUtils.h"
@@ -2070,6 +2071,15 @@ void ScreenBufferTests::VtRestoreColorTableReport()
// Blue component is clamped at 100%, so 150% interpreted as 100%
stateMachine.ProcessString(L"\033P2$p14;2;0;0;150\033\\");
VERIFY_ARE_EQUAL(RGB(0, 0, 255), gci.GetColorTableEntry(14));
Log::Comment(L"RIS restores initial Campbell color scheme");
stateMachine.ProcessString(L"\033c");
for (auto i = 0; i < 16; i++)
{
const COLORREF expectedColor = Microsoft::Console::Utils::CampbellColorTable()[i];
VERIFY_ARE_EQUAL(expectedColor, gci.GetColorTableEntry(i));
}
}
void ScreenBufferTests::ResizeTraditionalDoesNotDoubleFreeAttrRows()
@@ -3352,6 +3362,13 @@ void ScreenBufferTests::AssignColorAliases()
stateMachine.ProcessString(L"\033[2;34;56,|");
VERIFY_ARE_EQUAL(34u, renderSettings.GetColorAliasIndex(ColorAlias::FrameForeground));
VERIFY_ARE_EQUAL(56u, renderSettings.GetColorAliasIndex(ColorAlias::FrameBackground));
Log::Comment(L"Test RIS restores initial color assignments");
stateMachine.ProcessString(L"\033c");
VERIFY_ARE_EQUAL(defaultFg, renderSettings.GetColorAliasIndex(ColorAlias::DefaultForeground));
VERIFY_ARE_EQUAL(defaultBg, renderSettings.GetColorAliasIndex(ColorAlias::DefaultBackground));
VERIFY_ARE_EQUAL(frameFg, renderSettings.GetColorAliasIndex(ColorAlias::FrameForeground));
VERIFY_ARE_EQUAL(frameBg, renderSettings.GetColorAliasIndex(ColorAlias::FrameBackground));
}
void ScreenBufferTests::DeleteCharsNearEndOfLine()

View File

@@ -463,6 +463,7 @@ using namespace Microsoft::Console::Interactivity;
{
_WritePseudoWindowCallback((bool)wParam);
}
return 0;
}
case WM_GETOBJECT:
{
@@ -476,6 +477,15 @@ using namespace Microsoft::Console::Interactivity;
}
return 0;
}
case WM_ACTIVATE:
{
if (const auto ownerHwnd{ ::GetAncestor(hWnd, GA_ROOTOWNER) })
{
SetFocus(ownerHwnd);
return 0;
}
break;
}
}
// If we get this far, call the default window proc
return DefWindowProcW(hWnd, Message, wParam, lParam);

View File

@@ -57,7 +57,6 @@ INT_PTR CALLBACK FindDialogProc(HWND hWnd, UINT Message, WPARAM wParam, LPARAM l
if (searcher.IsStale(gci.renderData, lastFindString, flags))
{
searcher.Reset(gci.renderData, lastFindString, flags, reverse);
searcher.MoveToCurrentSelection();
}
else
{

View File

@@ -576,6 +576,8 @@ void Menu::s_PropertiesUpdate(PCONSOLE_STATE_INFO pStateInfo)
TextAttribute::SetLegacyDefaultAttributes(pStateInfo->ScreenAttributes);
// And recalculate the position of the default colors in the color table.
gci.CalculateDefaultColorIndices();
// Then save these values as the new default render settings.
gci.SaveDefaultRenderSettings();
// Set the screen info's default text attributes to defaults -
ScreenInfo.SetDefaultAttributes({}, TextAttribute{ gci.GetPopupFillAttribute() });

View File

@@ -79,7 +79,7 @@ VOID InitRegistryValues(
pStateInfo->CursorSize = 25;
pStateInfo->HistoryBufferSize = 25;
pStateInfo->NumberOfHistoryBuffers = 4;
pStateInfo->HistoryNoDup = 0;
pStateInfo->HistoryNoDup = 1;
// clang-format off
if (pStateInfo->fIsV2Console)

View File

@@ -26,6 +26,29 @@ RenderSettings::RenderSettings() noexcept
SetColorAliasIndex(ColorAlias::DefaultBackground, TextColor::DARK_BLACK);
SetColorAliasIndex(ColorAlias::FrameForeground, TextColor::FRAME_FOREGROUND);
SetColorAliasIndex(ColorAlias::FrameBackground, TextColor::FRAME_BACKGROUND);
SaveDefaultSettings();
}
// Routine Description:
// - Saves the current color table and color aliases as the default values, so
// we can later restore them when a hard reset (RIS) is requested.
void RenderSettings::SaveDefaultSettings() noexcept
{
_defaultColorTable = _colorTable;
_defaultColorAliasIndices = _colorAliasIndices;
}
// Routine Description:
// - Resets the render settings to their default values. which is typically
// what they were set to at startup.
void RenderSettings::RestoreDefaultSettings() noexcept
{
_colorTable = _defaultColorTable;
_colorAliasIndices = _defaultColorAliasIndices;
// For now, DECSCNM is the only render mode we need to reset. The others are
// all user preferences that can't be changed programmatically.
_renderMode.reset(Mode::ScreenReversed);
}
// Routine Description:

View File

@@ -29,6 +29,8 @@ namespace Microsoft::Console::Render
};
RenderSettings() noexcept;
void SaveDefaultSettings() noexcept;
void RestoreDefaultSettings() noexcept;
void SetRenderMode(const Mode mode, const bool enabled) noexcept;
bool GetRenderMode(const Mode mode) const noexcept;
const std::array<COLORREF, TextColor::TABLE_SIZE>& GetColorTable() const noexcept;
@@ -48,6 +50,8 @@ namespace Microsoft::Console::Render
til::enumset<Mode> _renderMode{ Mode::BlinkAllowed, Mode::IntenseIsBright };
std::array<COLORREF, TextColor::TABLE_SIZE> _colorTable;
std::array<size_t, static_cast<size_t>(ColorAlias::ENUM_COUNT)> _colorAliasIndices;
std::array<COLORREF, TextColor::TABLE_SIZE> _defaultColorTable;
std::array<size_t, static_cast<size_t>(ColorAlias::ENUM_COUNT)> _defaultColorAliasIndices;
size_t _blinkCycle = 0;
mutable bool _blinkIsInUse = false;
bool _blinkShouldBeFaint = false;

View File

@@ -273,7 +273,18 @@ INPUT_READ_HANDLE_DATA* ConsoleHandleData::GetClientInput() const
LOG_IF_FAILED(pScreenInfo->FreeIoHandle(this));
if (!pScreenInfo->HasAnyOpenHandles())
{
auto& gci = Microsoft::Console::Interactivity::ServiceLocator::LocateGlobals().getConsoleInformation();
const auto oldSize = gci.GetActiveOutputBuffer().GetBufferSize().Dimensions();
auto writer = gci.GetVtWriter();
SCREEN_INFORMATION::s_RemoveScreenBuffer(pScreenInfo);
if (writer && gci.HasActiveOutputBuffer())
{
auto& newContext = gci.GetActiveOutputBuffer();
writer.WriteScreenInfo(newContext, oldSize);
writer.Submit();
}
}
return S_OK;

View File

@@ -33,6 +33,7 @@ namespace Microsoft::Console::VirtualTerminal
virtual void WriteInput(const std::span<const INPUT_RECORD>& inputEvents) = 0;
virtual void WriteCtrlKey(const INPUT_RECORD& event) = 0;
virtual void WriteString(std::wstring_view string) = 0;
virtual void WriteStringRaw(std::wstring_view string) = 0;
virtual void WindowManipulation(DispatchTypes::WindowManipulationType function, VTParameter parameter1, VTParameter parameter2) = 0;
virtual void MoveCursor(VTInt row, VTInt col) = 0;
virtual void FocusChanged(bool focused) = 0;

View File

@@ -53,10 +53,11 @@ void InteractDispatch::WriteCtrlKey(const INPUT_RECORD& event)
HandleGenericKeyEvent(event, false);
}
// Method Description:
// - Writes a string of input to the host.
// Arguments:
// - string : a string to write to the console.
// Call this method to write some plain text to the InputBuffer.
//
// Since the hosting terminal for ConPTY may not support win32-input-mode,
// it may send an "A" key as an "A", for which we need to generate up/down events.
// Because of this, we cannot simply call InputBuffer::WriteString directly.
void InteractDispatch::WriteString(const std::wstring_view string)
{
if (!string.empty())
@@ -73,6 +74,12 @@ void InteractDispatch::WriteString(const std::wstring_view string)
}
}
void InteractDispatch::WriteStringRaw(std::wstring_view string)
{
const auto& gci = ServiceLocator::LocateGlobals().getConsoleInformation();
gci.GetActiveInputBuffer()->WriteString(string);
}
//Method Description:
// Window Manipulation - Performs a variety of actions relating to the window,
// such as moving the window position, resizing the window, querying

View File

@@ -30,6 +30,7 @@ namespace Microsoft::Console::VirtualTerminal
void WriteInput(const std::span<const INPUT_RECORD>& inputEvents) override;
void WriteCtrlKey(const INPUT_RECORD& event) override;
void WriteString(std::wstring_view string) override;
void WriteStringRaw(std::wstring_view string) override;
void WindowManipulation(DispatchTypes::WindowManipulationType function, VTParameter parameter1, VTParameter parameter2) override;
void MoveCursor(VTInt row, VTInt col) override;
void FocusChanged(bool focused) override;

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