4249 Commits

Author SHA1 Message Date
Leonard Hecker
cba3d71378 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

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

(cherry picked from commit fc606d2bae8a99b7dc7a42dd205b0faafff0e7d8)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmszgTTKAE
Service-Version: 1.21
v1.21.2701.0
2024-09-26 15:05:39 -05:00
Windows Console Service Bot
49e96f22be Localization Updates - main - 09/26/2024 19:14:21 (#17958)
Closes #17752
Closes #17764
Closes #17830

(cherry picked from commit 59dc5eff42bb7191789008060e90d8940df8dd06)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmszgTX8OQ
Service-Version: 1.21
2024-09-26 14:22:44 -05:00
Leonard Hecker
b690855cf5 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 bcac9993cb84a7736e3db00c9d7262defd0f85a1)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmszgTW9-g
Service-Version: 1.21
2024-09-26 14:22:43 -05:00
Carlos Zamora
117eb9b8fb 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 0bd19e9cfc31383f17e453e18df6649bdd6cf64a)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmszgTTb0s
Service-Version: 1.21
2024-09-26 14:22:42 -05:00
James Holderness
0982abe762 Fix input sequences split across the buffer boundary (#17738)
## Summary of the Pull Request

When conhost receives input from a conpty connection, and that input
arrives in a block larger than our 4K buffer, we can end up with a VT
sequence that's split at the buffer boundary. Previously that could
result in the start of the sequence being dropped, and the remaining
characters being interpreted as individual key presses.

This PR attempts to fix the issue by caching the unprocessed characters
from the start of the sequence, and then combining them with the second
half of the sequence when it's later received.

## Validation Steps Performed

I've confirmed that pasting into vim now works correctly with the sample
data from issue #16655. I've also tested with a `DECCTR` report larger
than 4K which would previously have been corrupted, and which now works
as expected.

## PR Checklist
- [x] Closes #16655

(cherry picked from commit 131728b17d50a81d0ecc0686589a2742b7742149)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmszgSCpCk
Service-Version: 1.21
2024-09-26 14:22:42 -05:00
Windows Console Service Bot
78c36ca25d Localization Updates - main - regex search (#17349)
(cherry picked from commit 13568e6b7399e63502a33fce0d0ff9461a0e0de4)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmszgTTOd4
Service-Version: 1.21
2024-09-24 14:54:59 -05:00
Dustin Howett
df9df3d4ee Remove the regex search button (as part of backporting regex fundamentals) 2024-09-24 14:54:59 -05:00
Leonard Hecker
99df9e9444 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 d9131c68893fe114a6091d262c23a5a26199d023)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmszgS3elk PVTI_lADOAF3p4s4AmhmszgTEciI
Service-Version: 1.21
2024-09-24 14:38:26 -05:00
e82eric
d1ac37599c Avoid covering current search highlight with search box (#17516)
Adds a scroll offset to avoid hiding the current search highlight with
the search box.
- Offset is based on the number of rows that the search box takes up.
  (I am not totally sure I am calculating this right)
- This won't help when the current highlight is in the first couple
  rows of the buffer.

Fixes: #4407
(cherry picked from commit 0bafab9a0ff881548bb1356dcaeed21aba1f6474)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmszgTTNTE
Service-Version: 1.21
2024-09-24 14:38:24 -05:00
Dustin L. Howett
87c87b51fc Add support for regex search to conhost and Terminal (#17316)
This is broken down into individual reviewable commits.

[Here
is](https://github.com/microsoft/terminal/assets/189190/3b2ffd50-1350-4f3c-86b0-75abbd846969)
a video of it in action!

Part of #3920

(cherry picked from commit ecb56314762dcb9b41e177d05d669b28bbbe1490)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmszgTTM0g
Service-Version: 1.21
2024-09-24 14:36:23 -05:00
Mike Griese
dc8a830fea 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 17a55da0f9889aafd84df024299982e7b94f5482)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmszgSwIkA
Service-Version: 1.21
2024-09-24 14:28:49 -05:00
Leonard Hecker
41bb31f5dc 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 b520da26d46269c5af0c8c001f107d4ccd3fb2cb)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmszgTQsd8
Service-Version: 1.21
2024-09-24 14:07:04 -05:00
Leonard Hecker
6b380cb7e0 ConPTY: Raise the MAX_PATH limit (#17768)
Swapped the `swprintf_s` with no failure checks against a
`str_printf_nothrow` with checks. I also deduplicated the
`CreateProcess` calls since they're mostly identical.

Closes #16860

(cherry picked from commit b3f41626b4d212da8ca7c08077b12c289f918c86)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmszgS25_o
Service-Version: 1.21
2024-09-17 16:10:25 -05:00
Carlos Zamora
84a33afb8c 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 a7e47b711a2adc7b9e80eddea8168089f7d3b11e)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmszgTEfj0
Service-Version: 1.21
2024-09-17 16:05:06 -05:00
Dustin L. Howett
ef586f6bf5 build: fix the TSA configuration (#17929)
We are, quite literally, shipping the org chart.

(cherry picked from commit 2c97c0555da11b795e12c8820eca3a4a7c3882be)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmszgTGRAk
Service-Version: 1.21
2024-09-17 16:05:05 -05:00
Leonard Hecker
bdb67a382a 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 bc6f3e22757415e42e658597c60b40c003941289)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmszgTEJYE
Service-Version: 1.21
2024-09-16 15:59:32 -05:00
Dustin L. Howett
b6326cf23e 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 4aa1624cd2cfd5cdd4106feb26a2aa0f089a0e3d)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmszgTD8ik
Service-Version: 1.21
2024-09-16 15:59:30 -05:00
Leonard Hecker
e27ebe7681 Fix crash in AppHost::_QuitRequested (#17848)
(cherry picked from commit 00f46e400a896fe3e9c758b7b816bd780bcb030c)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmszgSwXpU
Service-Version: 1.21
2024-09-06 18:36:49 -05:00
Leonard Hecker
c47d9e1ad9 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 5fdfd51209fc681e66657d6697ce031bc4319619)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmszgSN1FM
Service-Version: 1.21
2024-09-04 15:00:54 -05:00
Leonard Hecker
b95cc19e87 Fix typing multiple emojis on Windows 10 (#17213)
On Windows 10 Emojis don't finish composition until the Emoji picker
panel is closed. Each emoji is thus its own composition range.
`firstRange` thus caused only the first emoji to finish composition.
The end result was that all remaining emojis would stay around
forever, with the user entirely unable to clear them.

## Validation Steps Performed
* Windows 10 VM
* Open Emoji picker (Win+.)
* Press and hold Enter on any Emoji
* Press Esc to finish the composition
* All of the Emoji can be backspaced / deleted

(cherry picked from commit 49e4eea60f737b46b8aeda505f4693df8a9d44a6)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmszgSLR0g
Service-Version: 1.21
2024-09-04 15:00:54 -05:00
Dustin L. Howett
e8c15683a7 Reapply "nuget: move to shine-oss tenant rather than ms tenant (#17451)"
This reverts commit 67d2636c816ce86cfeab43a59813762eb4bd7d3d.

(cherry picked from commit 955b1d26834a8dc3c1c52166808b26245b6d5345)
v1.21.2361.0
2024-08-23 15:11:49 -05:00
Windows Console Service Bot
6d4ff2e5a7 Localization Updates - main - 08/22/2024 03:06:16 (#17767)
(cherry picked from commit 0a91023df85ed37b838a661cc229be49f1fa0839)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmszgSK_vc
Service-Version: 1.21
2024-08-23 14:35:09 -05:00
Leonard Hecker
e60afb6f4e Improve reliability of VT responses (#17786)
* Repurposes `_sendInputToConnection` to send output to the connection
  no matter whether the terminal is read-only or not.
  Now `SendInput` is the function responsible for the UI handling.
* Buffers responses in a VT string into a single string
  before sending it as a response all at once.

This reduces the chances for the UI thread to insert cursor positions
and similar into the input pipe, because we're not constantly unlocking
the terminal lock anymore for every response. The only way now that
unrelated inputs are inserted into the input pipe is because the VT
requests (e.g. DA1, DSR, etc.) are broken up across >1 reads.

This also fixes VT responses in read-only panes.

Closes #17775

* Repeatedly run `echo ^[[c` in cmd.
  DA1 responses don't stack & always stay the same 
* Run nvim in WSL. Doesn't deadlock when pasting 1MB. 
* Run the repro from #17775, which requests a ton of OSC 4
  (color palette) responses. Jiggle the cursor on top of the window.
  Responses never get split up. 

(cherry picked from commit b07589e7a87e1d7a2f6144744a59c866c672a78e)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmszgSK_Dw
Service-Version: 1.21
2024-08-23 14:35:08 -05:00
Dustin L. Howett
1519b6feb2 During Alt+Numpad composition, stash keys in case we bail out (#17774)
We were erroneously eating Alt followed by VK_ADD. This change makes
sure we cache key presses and releases that happen once a numpad
composition is active so that we can send them when you release Alt.

Right now, we only send them when you release Alt after composing Alt
and VK_ADD (entering hex mode) and only if you haven't inserted an
actual hex numpad code. This does mean that `Alt VK_ADD 0 0 H I` will
result in an input of "+hi". That... seems like a small price to pay for
Alt VK_ADD working again.

Closes #17762

(cherry picked from commit e006f75f6c175542760ee4d338ee894b82acff5f)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmszgSF50M
Service-Version: 1.21
2024-08-23 14:31:20 -05:00
Leonard Hecker
6d9fb78bfc Implement Alt-Numpad handling (#17637)
This adds an indirection for `_KeyHandler` so that `OnDirectKeyEvent`
can call `_KeyHandler`. This allows us to consistently handle
Alt-key-up events. Then I added custom handling for Alt+ddd (OEM),
Alt+0ddd (ANSI), and Alt+'+'+xxxx (Unicode) sequences, due to the
absence of Alt-key events with xaml islands and our TSF control.

Closes #17327

## Validation Steps Performed
* Tested it according to https://conemu.github.io/en/AltNumpad.html
* Unbind Alt+Space
* Run `showkey -a`
* Alt+Space generates `^[ `
* F7 generates `^[[18~`

(cherry picked from commit 2fab9866b2bf09229886184052cd623b6581eaef)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmszgSCpCg
Service-Version: 1.21
2024-08-23 14:31:18 -05:00
Dustin L. Howett
102181f109 build: switch back to the "latest" OneBranch build image (#17630)
Thanks to a string of compiler bugs, we had to use an older container
image that shipped with VS 17.9.

Unfortunately, that container image is falling further and further out
of date. The build agents don't cache it any longer, so they spend 30-45
minutes of every build pulling it from the registry.

With the changes to ConPTY in #17510 removing the need for til::bitmap,
we no longer need to work around the compiler bugs it exposed.

Furthermore, 17.10.6+ has a much more robust and presumably "working"
compiler.

(cherry picked from commit 39108a7a1b4328d88ce4fcbaf71b8b3894ecd704)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmszgSI7RU
Service-Version: 1.21
2024-08-22 20:21:11 -05:00
Dustin L. Howett
b028a5764b onebranch: allow publish/package to run in :latest container (#17514)
We have to run in an older OneBranch Windows container image due to
compiler bugs.

This change prevents us from having to wait for the container image to
download for build legs that _aren't_ using the compiler.

(cherry picked from commit bc20225b089815db77e5c5f6a4de62881eea30aa)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmszgSI7Rw
Service-Version: 1.21
2024-08-22 20:21:10 -05:00
Dustin L. Howett
cf7a6617ab Guard Control UpdateAppearance/Settings against UAF (#17770)
When you close a window, it naturally loses focus.

We were trying to use members of the control to update its appearance on
focus loss after it got torn down.

Closes #17520

(cherry picked from commit eabebc4cb227293df4839f75bd195b04992ba506)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmszgSIM6I
Service-Version: 1.21
2024-08-22 18:00:25 -05:00
Carlos Zamora
f2e9041aa0 Log action dispatch occurrence (#17718)
Some simple logic to report whenever an action has successfully occurred
(and what ShortcutAction was used).

Note, there will be some false positives here from startup. I noticed we
get a `newTab` on launch. This is probably a result of restoring the
window layout of the previous session since we're using ActionAndArgs
for that.

(cherry picked from commit 56cfb77c6d2aeaa408310756ed711531a037c021)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmszgSCpCo
Service-Version: 1.21
2024-08-22 11:33:18 -05:00
Dustin L. Howett
8e7137dbde Disable PGO for Release builds (#17765)
Same justification as #17749.

We will revert this when either OneBranch Custom Pools become
fit-for-purpose or they upgrade to VS 17.11. Or the heat death of the
universe.

(cherry picked from commit 628e99f5d2c3572217ecd4c77e9d00bffe254282)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmszgSGCaA
Service-Version: 1.21
2024-08-21 18:21:23 -05:00
Leonard Hecker
0cbe706f48 Fix pane event handlers being unbound (#17750)
I don't know what has changed between #17450 and now, but that fix
doesn't seem necessary anymore. If you add this action:
```json
{
    "keys": "ctrl+a",
    "command":
    {
        "action": "splitPane",
        "commandline": "cmd /c exit"
    }
}
```

and repeatedly spam Ctrl-A it used to lead to crashes. That doesn't
happen anymore, because some other PR must've fixed that.

Reverting #17450 fixes the issue found in #17578: Because the content
pointer didn't get reset to null anymore it meant that the root
pane retained the pointer after a split. After closing the split off
pane, it would assign the remaining one back to the root, which would
cause the still existing content pointer to be closed. That pointer
is potentially the same as the remaining pane and so no close events
would get received anymore.

Closes #17578

## Validation Steps Performed
* Add the above action and spam it 
* Start with an empty window, split pane, type `exit` in the new pane
  then type it in the original pane. It closes the window 

(cherry picked from commit 056af839940495989409d69e72e89311b1a7f209)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmszgSGCfE
Service-Version: 1.21
2024-08-21 18:21:22 -05:00
Leonard Hecker
8c2c88e44f Fix session persistence when the session ends (#17714)
Once all applications that have received a `WM_ENDSESSION` message
have returned from processing said message, windows will terminate
all processes. This forces us to process the message synchronously.
This meant that this issue was timing dependent. If Windows Terminal
was quick at persisting buffers and you had some other application that
was slow to shut down (e.g. Steam), you would never see this issue.

Closes #17179
Closes #17250

## Validation Steps Performed
* Set up a lean Hyper-V VM for fast reboots
* `Set-VMComPort <vm> 1 \\.pipe\\<pipe>`
* Hook up WIL to write to COM1
* Add a ton of debug prints all over the place
* Read COM output with Putty for hours
* RTFM, and notice that the `WM_ENDSESSION` documentation states
  "the session can end any time after all applications
  have returned from processing this message"
* Be very very sad 
* Fix it
* Rebooting now shows on COM1 that persistence runs 
* Windows get restored after reboot 

(cherry picked from commit b439925acc1f6c51180b2fa33775395b595d1c60)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmszgSGCik
Service-Version: 1.21
2024-08-21 18:21:20 -05:00
Leonard Hecker
1742dc03ff Align the OSS ConPTY API with Windows 11 24H2 (#17704)
(cherry picked from commit 7fd9c5c789dc2eae46f74fdd68093da8a97507d8)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmszgSGCkE
Service-Version: 1.21
2024-08-21 18:21:16 -05:00
Leonard Hecker
42ab9bbd69 Fix a crash during settings update (#17751)
* Adds a check whether the thread dispatcher is already null.
  (See code comments.)
* Moves the `_settings` to only happen on the UI thread.
  Anything else wouldn't be thread safe.

Closes #17620

## Validation Steps Performed
Not reproducible. 🚫

(cherry picked from commit e0dae59f38373f5d198833eeca1b933935b25c6f)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmszgSGBis
Service-Version: 1.21
2024-08-21 18:17:50 -05:00
PankajBhojwani
cb8a3f6ef1 Fix overwrite key binding warning in the SUI (#17763)
Fixes a regression from the actions MVVM change in #14292 - attempting
to overwrite a keybinding was displaying a warning but propagating the
change before the user acknowledged it.

The overwrite key binding warning in the SUI works like before

Closes #17754

(cherry picked from commit ce92b18507247a97e22948d456b1ec8a34aa4e63)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmszgSF01Y
Service-Version: 1.21
2024-08-21 18:12:26 -05:00
Dustin L. Howett
ed08108e32 Port ServicingPipeline.ps1 to ProjectsV2 (#17756)
(cherry picked from commit 516ade54cb59607f35b3e4a0bae6fc58e85095e3)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmszgSF-7E
Service-Version: 1.21
2024-08-21 18:12:25 -05:00
Carlos Zamora
8aa56c25f4 Add ellipses back in to some command names (#17715)
In #16886, the key for the nested action got renamed from `Split
Pane...` to `Split pane`. This accidentally caused a collision because
now there's two actions with the same name! The settings model then
prefers the user's action over the one defined in defaults.json, thus
completely hiding the nested version.

I tried to balance the stylistic recommendations from #16846 (mainly
[this
comment](https://github.com/microsoft/terminal/issues/16846#issuecomment-2005007519)
since it gave some excellent examples) while trying to maintain muscle
memory as much as possible (with similar substring sequences). There was
also one case where we still used "the tab" so I removed the "the" for
consistency.

Side effect of #16886 which closed #16846
Closes #17294
Closes #17684

(cherry picked from commit 0a7c2585a24fe93b47ece780a107052c88fce76a)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmszgSFdXc
Service-Version: 1.21
2024-08-21 13:17:57 -05:00
Carlos Zamora
e866a6c66f Fix UIA RangeFromPoint API (#17695)
## Summary of the Pull Request
Fixes the `RangeFromPoint` API such that we're now properly locking when
we attempt to retrieve the viewport data. This also corrects the
conversion from `UiaPoint` (screen position) to buffer coordinates
(buffer cell).

Closes #17579

## Detailed Description of the Pull Request / Additional comments
- `UiaTextRangeBase::Initialize(UiaPoint)`:
- reordered logic to clamp to client area first, then begin conversion
to buffer coordinates
   - properly lock when retrieving the viewport data
- updated `_TranslatePointToScreen` and `_TranslatePointFromScreen` to
use `&` instead of `*`
   - we weren't properly updating the parameter before
- `TermControlUiaTextRange::_TranslatePointFromScreen()`
- `includeOffsets` was basically copied over from
`_TranslatePointToScreen`. The math itself was straight up wrong since
we had to do it backwards.

## Validation Steps Performed
 Moved WT to top-left of monitor, then used inspect.exe to call
`RangeFromPoint` API when mouse cursor is on top-left buffer cell (also
meticulously stepped through the two functions ensuring everything was
correct).

(cherry picked from commit 7b39d24913ec9a6b9fd7026bfd47dc4c7363ccdf)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmszgSC930 PVTI_lADOAF3p4s4AmhmszgSCpCs
Service-Version: 1.21
2024-08-20 21:13:55 -05:00
Mike Griese
2890e8a3d4 Log when WindowsTerminal.exe starts (#17745)
as discussed in team sync

(cherry picked from commit 60ac45c2398e3d8f04680559188526b75b29fde8)
Service-Card-Id: 93750273
Service-Version: 1.21
2024-08-20 11:44:32 -05:00
Dustin L. Howett
6b6167ec2b Restore the ability to disable checking for URLs (#17731)
Fixes #17727

(cherry picked from commit 735ef2823ed72d80ce91df0176646979e4568831)
Service-Card-Id: 93736213
Service-Version: 1.21
2024-08-20 11:44:31 -05:00
Carlos Zamora
5d1638f187 schema: add reloadEnvironmentVariables to newTerminalArgs (#17696)
(cherry picked from commit 1511d2c2ad4220721afb3f4689d9f1d2895c0bd7)
Service-Card-Id: 93522519
Service-Version: 1.21
2024-08-20 11:44:29 -05:00
Dustin L. Howett
2befaa1669 Switch to the new and beautiful VS Dev Shell icons (#17706)
We got some new icons for Developer Command Prompt and Developer
PowerShell from our friends over on Visual Studio!

This pull request includes them in the package, and fixes up the VS
dynamic profiles to reset any icons that matched the old paths.

This may be a minor breaking change for user settings, but we're making
the assumption that if they didn't change their VS profile icons from
the defaults, they probably want to follow us to the new defaults.

To prevent anything like this from happening again, we're going to stop
serializing icons for stub profiles.

I've also included a VS version of the PowerShell "black" icon which is
currently unused, but can be used in the future for PS7+-based VS Dev
Shell.

Closes #17627

(cherry picked from commit 06c07ab50dd75af3e1a1afc51cb4c688190fda92)
Service-Card-Id: 93531229
Service-Version: 1.21
2024-08-20 11:44:28 -05:00
Leonard Hecker
83a9baa797 AtlasEngine: Fix a buffer overrun (#17536)
The strided `memcpy` between buffers failed to account for situations
where the destination stride is smaller than the source stride.
The solution is to only copy as many bytes as are in each row.

## Validation Steps Performed
Even with AppVerifier the issue could not be reproduced.
Adding an `assert(srcStride <= mapped.RowPitch)`, however, did trap
the bug when WARP is used while BackendD3D is force-enabled.

(cherry picked from commit ae8c868a1c3d66dcee66e4e854b5285a4cae7040)
Service-Card-Id: 92972720
Service-Version: 1.21
2024-08-13 17:26:56 -05:00
Leonard Hecker
5a99621856 AtlasEngine: Curly line redux (#17508)
See #17501.

(cherry picked from commit 7f2249c810ca7df219b3189b728c05b83649ffff)
Service-Card-Id: 92942980
Service-Version: 1.21
2024-08-13 17:26:56 -05:00
Leonard Hecker
09aa541d56 AtlasEngine: Improve appearance of curly underlines (#17501)
We'd previously subtract one underline-height from the curly line
offset, even though we already had subtracted its complete height.

Additionally, the pixel shader received some fine tuning:
* Shrink the stroke width so that the anti-aliasing can be seen
  all the way up to the horizontal edges of the bounding box.
* Add a phase shift to break apart the symmetry of the curve.

Closes #17482

Co-authored-by: Carlos Zamora <carlos.zamora@microsoft.com>
(cherry picked from commit ad3797ace9d54c63d2927253b003898661659164)
Service-Card-Id: 92942049
Service-Version: 1.21
2024-08-13 17:26:56 -05:00
Dustin L. Howett
4040e4c654 atlas,d2d: overdraw background bitmap by one cell on all sides (#17674)
BackendD2D will now draw one extra cell on all sides when rendering the
background, filled with the expected background color, starting at (-1,
-1) to ensure that cell backgrounds do not bleed over the edges of the
viewport where the is swapchain but no content.

Fixes #17672

(cherry picked from commit 9007fc2894f877175c63592ab1f7b3300a23abf8)
Service-Card-Id: 93494324
Service-Version: 1.21
2024-08-13 16:22:03 -05:00
Carlos Zamora
8f4775df96 Log number of interactive sessions (#17682)
This sends a telemetry event if a session is interacted with.
Specifically, key events are essential to have an interactive session in
Windows Terminal, so we're tracking sessions that have had a key down
event.

(cherry picked from commit ac865e6666d16e436bd3df4f62697557990ce652)
Service-Card-Id: 93498660
Service-Version: 1.21
2024-08-13 16:20:00 -05:00
Leonard Hecker
3ab8921aa7 Fix colors getting lost on reflow (#17568)
The "copy the remaining attributes" loop assumes that it has full
ownership over the rows that it copies. For that to be true,
we have to of course make sure that the current write-cursor
is at a fresh, new row in the first place.

## Validation Steps Performed
* In a new pwsh tab with 120 colums:
  ``Write-Host -NoNewline "`e[36m$('a'*120)`e[m"; sleep 10``
* Resize the window wider
* Color doesn't get lost

(cherry picked from commit 2f43886ab593ca3d7f215d2352a510c69d7aa1c8)
Service-Card-Id: 93441137
Service-Version: 1.21
2024-08-13 16:19:59 -05:00
Windows Console Service Bot
2a15717f69 Localization Updates - builtin glyphs (ONLY) (#17458)
(partially cherry picked from commit 9f7032afd82a44c5c48e24a97607573e7140f948)
Service-Card-Id: 92889853
Service-Version: 1.21
v1.21.1772.0
2024-06-24 15:05:00 -05:00
Leonard Hecker
846a8aa7a6 Fix builtin glyph corruption in the D2D renderer (#17464)
The initial contents of a texture are undefined. That's not good.
Now they are. That's good.

(cherry picked from commit 8c14a34263165bb3ab0a3689dc49840159a17820)
Service-Card-Id: 92788897
Service-Version: 1.21
2024-06-24 15:02:59 -05:00