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: 93531228
Service-Version: 1.20
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: 93498659
Service-Version: 1.20
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: 93522523
Service-Version: 1.20
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: 92972719
Service-Version: 1.20
Sometimes subsequent WT windows open in the background behind other
applications. This PR tries to fix it.
Refs #15895
Refs #15479
Mysterious bug (and annoying). There are even some discussions about
happening to the first startup, not just subsequent ones. Sometimes the
window may show up without animation too. So I don't think this is the
final solution, but it did get solved on my computer, for now.
## Validation Steps Performed
0. Quit all WT windows if some.
1. Open File Explorer, click "Open in Terminal" in context menu.
2. Move the newly opened window and minimize it.
3. Back to step 1 and repeat several times.
4. All the windows should open in the foreground correctly (yet possibly
without animation).
---------
Co-authored-by: Mike Griese <migrie@microsoft.com>
(cherry picked from commit c52ba7dec6386e11befb62e81e4c0c970a9c5e3e)
Service-Card-Id: 92715121
Service-Version: 1.20
This adds a check for whether MacType is injected and whether it's
a known bad version (pre-2023). In that case we avoid calling the
known faulty `ID2D1Device4` interface. We could avoid it in general to
fix the issue without a warning (it's only a very mild optimization),
but on the other hand, the bug that MacType has is a very serious one
and it's probably better overall to suggest users to update.
See: https://github.com/snowie2000/mactype/pull/938
* MacType 2021.1-RC1 results in a warning and no crash ✅
* MacType 2023.5.31 results in no warning ✅
---------
Co-authored-by: Dustin L. Howett <duhowett@microsoft.com>
(cherry picked from commit 9317d42045dbf44e3c8f5991acf9dd30a8fc5987)
Service-Card-Id: 92687128
Service-Version: 1.20
`utextAccess` apparently doesn't actually need to clamp the
`chunkOffset` to be in range of the current chunk. Also, I missed to
implement the part of the spec that says to leave the iterator on the
first/last chunk of the `UText` in case of an out-of-bounds index.
This PR fixes the issue by simply not returning early, doing a more
liberal clamp of the offset, and then checking whether it was in range.
As an aside, this also fixes a one-off bug when hovering URLs that
end on the very last cell of the viewport (or are cut off).
Closes#17343
## Validation Steps Performed
* Write an URL that wraps across the last 2 lines in the buffer
* Scroll 1 line up
* No assert ✅
* Hovering the URL shows the full, still visible parts of the URL ✅
(cherry picked from commit 261a3fec7a7a9b6bd14a1c46ce4bd0a9bb2ebc7e)
Service-Card-Id: 92678595
Service-Version: 1.20
This centralized all our ESRP calls in one file, which will make it
easier in the future when we are invariable required to change how we
call it again.
(cherry picked from commit 5ce7fb74036726c33eb5e565be2ae759aacd72a8)
Service-Card-Id: 92577954
Service-Version: 1.20
This required me to push a bunch more parameters through the build
pipeline, but it gave me the opportunity to define them as variables
that can be set at queue time.
(cherry picked from commit 2f52f27197731a91d202fe101239091338860427)
Service-Card-Id: 92577964
Service-Version: 1.20
This clamps the font sizes between 1 and 100. Additionally, it fixes
a warning that I randomly noticed when reproducing the issue: D2D
complained that `EndDraw` must be called before releasing resources.
Finally, this fixes a crash when the terminal size is exactly (1,1)
cells, which happened because the initial (invalid) size was (1,1) too.
This doesn't fully fix all font-size related issues, but that's
currently difficult to achieve, as for instance the swap chain size
isn't actually based on the window size, nay, it's based on the cell
size multiplied by the cell count. So if the cell size is egregiously
large then we get a swap chain size that's larger than the display and
potentially larger than what the GPU supports which results in errors.
Closes#17227
(cherry picked from commit f62d2d5d2c7b4188daf1d46f48faacf5ee2c717d)
Service-Card-Id: 92546859
Service-Version: 1.20
This prevents me from making dumb mistakes, really.
(cherry picked from commit bf55c444601117dfb09b405752f4ea105e078997)
Service-Card-Id: 92546837
Service-Version: 1.20
As the title says, this backports the changes in #17211 and #17268:
* `PersistState` being called when the window is closed
(as opposed to closing the tab). The settings check was missing.
* Avoid persisting windows with 0 tabs (= last tab gets closed).
We need to lock the buffer when getting the viewport/cursor position.
This caused the UIA overlay to randomly fail to update.
## Validation Steps Performed
* Open a cmd tab and hold any key immediately
* Repeat until you're somewhat confident it's gone ✅
(cherry picked from commit e1b102a3540d7cc5aa24c2e3357e778357a679be)
Service-Card-Id: 92546851
Service-Version: 1.20
## Validation Steps Performed
- Opened multi-tab terminal window with Narrator. Narrator can read
characters from the tabs.
- Started a drag and drop (tear-off) of a tab, and it didn't crash. This
was repeated multiple times.
(cherry picked from commit 30ef1f461d778429898542a1da5b799361b169bb)
Service-Card-Id: 92546868
Service-Version: 1.20
We use `if (auto self = weakSelf.get())` in a lot of places.
That assigns the value to `self` and then checks if it's truthy.
Sometimes we need to add a "is (app) closing" check because XAML,
so we wrote something akin to `if (self = ...; !closing)`.
But that's wrong because the correct `if (foo)` is the same as
`if (void; foo)` and not `if (foo; void)` and that meant that
we didn't check for `self`'s truthiness anymore.
This issue became apparent now, because we added a new kind of
delayed callback invocation (which is a lot cheaper).
This made the lack of a `nullptr` check finally obvious.
(cherry picked from commit 6d0342f0bb31bf245843411c6781d6d5399ff651)
Service-Card-Id: 92509287
Service-Version: 1.20
This PR achieves two things:
* When encountering rows with newlines (`WasForceWrapped` = `false`)
we'll now copy the contents out of the row and append a `\n`.
To make `utext_clone` cheap, it adds a reference counted buffer.
* Text extraction in `Terminal::GetHyperlinkAtBufferPosition`
was fixed by using a higher level `TextBuffer::GetPlainText`
instead of iterating through each cell.
Closes#16676Closes#17065
## Validation Steps Performed
* In pwsh execute the following:
``"`e[999C`e[22Dhttps://example.com/foo`nbar"``
* Hovering over the URL only underlines `.../foo` and not `bar` ✅
* The tooltip ends in `.../foo` and not `.../fo` ✅
(cherry picked from commit 5b8eadb2ea16206bac2bb1c0b06f35bd4d0aae15)
Service-Card-Id: 92509615
Service-Version: 1.20
This fixes:
* `HRESULT`s not being shown as unsigned hex
* `D2DERR_RECREATE_TARGET` not being handled
* 4 calls not checking their `HRESULT` return
Out of the 4 only `CreateCompatibleRenderTarget` will throw in
practice, however it throws `D2DERR_RECREATE_TARGET` which is common.
Without this error handling, AtlasEngine may crash.
* Set Graphics API to Direct2D
* Use `DXGIAdapterRemovalSupportTest.exe` to trigger
`D2DERR_RECREATE_TARGET`
* No error message is shown ✅
* If the `D2DERR_RECREATE_TARGET` handling is removed, the application
never crashes due to `cursorRenderTarget` being `nullptr` ✅
(cherry picked from commit b31059e53e23f4d7dabe466cf4c46c08cafb6fba)
Service-Card-Id: 92500372
Service-Version: 1.20
## Summary of the Pull Request
When the conpty renderer determines that it needs to hide the cursor,
it does so by inserting a `DECTCEM` reset sequence at the start of the
output buffer, assuming that is the start of the frame. But when the
`_noFlushOnEnd` flag is set, you can have multiple frames pending in the
buffer, and the `DECTCEM` sequence will then end up in the wrong place.
This PR fixes the issue by saving the buffer size at the start of the
frame, and using that saved offset as the insert position for the
`DECTCEM` sequence.
## Validation Steps Performed
I have a game that was frequently affected by this issue (the cursor
would be visible when it was meant to be hidden). With this PR applied,
it now works perfectly.
## PR Checklist
- [x] Closes#15449
(cherry picked from commit ef318a14502ee933e4034d7b4bf5739d7d394ad1)
Service-Card-Id: 92457090
Service-Version: 1.20
This shouldn't have ever worked...? This looks like it was a typo and
should have been `mark.end`.
Thanks @joadoumie for asking about the moving the cursor in the prompt,
that convo lead to me finding this.
(cherry picked from commit d14ff939dc418fa04401304fdef539424dbb5bd5)
Service-Card-Id: 92441646
Service-Version: 1.20
This update adds support for:
- Unicode 16 Large Type Pieces (they are really cool, you *have* to see
them)
- Unicode 13 Sextants (U+1FB00 - U+1FB3B)
- Octants, sedecimants, eights, miscellanrous blocks, separated
quadrants and sextants, and diagonals
- Segmented digits (think LED numbers)
- Checkerboards
It also fixes the coordinate system used in all of the blocks,
half-blocks, quadrants and eights for consistency.
This update does **not** include the new "Nerd Fonts" variant of
Cascadia Code or Cascadia Mono.
With big thanks to @PhMajerus for contributing all of the new symbols
for legacy computing.
See microsoft/cascadia-code#723, microsoft/cascadia-code#708 and
microsoft/cascadia-code#727 for more details.
(cherry picked from commit 41bb28c46d0e03d4b652cc340bb63790e0868ece)
Service-Card-Id: 92434845
Service-Version: 1.20
While I was fixing the initial position thing, I figured I'd fix this
too. We were mistakenly accounting for the size of the titlebar when we
should launch into focus mode (without one)
Closes#10730
(cherry picked from commit f36d589a8eb60fe9ff4c8efaad8eac088647e8a8)
Service-Card-Id: 92410732
Service-Version: 1.20
OneBranch no likey. A test build is running now.
(cherry picked from commit 19f43f70bdbf6ea3d3c575b6a532cae2ee5ca6a2)
Service-Card-Id: 92421264
Service-Version: 1.20
This is required for us to move off Entra ID Application identity.
(cherry picked from commit 2e7c3fa3132fa3bff23255480c593cbd3432eee5)
This was approved in #16957, so I will merge with one signoff.
(cherry picked from commit 3a63832c31c3e4ef7b22169216a5a14607efe3eb)
Service-Card-Id: 92421061
Service-Version: 1.20
Updates the `api-version` to `2023-02-01-preview` when requesting for
CloudShell settings and shell
## Validation Steps Performed
Can still use Azure Cloud Shell through Windows Terminal
(cherry picked from commit ce4e0df7b0da5549a69219cd3e866b1bda1c2fbd)
Service-Card-Id: 92411552
Service-Version: 1.20
Since floats are imprecise we need to constrain the time value into a
range that can be accurately represented. Assuming a monitor refresh
rate of 1000 Hz, we can still easily represent 1000 seconds accurately
(roughly 16 minutes). So to solve this, we'll simply treat the shader
time modulo 1000s. This may lead to some unexpected jank every 16min
but it keeps any ongoing animation smooth otherwise.
(cherry picked from commit daffb2dbbffaeb78a5d9763f0c222927cf3af109)
Service-Card-Id: 92409332
Service-Version: 1.20
Because this holds onto the root element, `TerminalPage` gets "leaked"
on Windows 10 when a window is closed until another is opened.
## Validation Steps Performed
* Set a breakpoint in `Renderer::~Renderer`
* Open and close a window
* Breakpoint used to not get hit and now it does ✅
(cherry picked from commit a590a1bff076317a1f0d1fd7565af4b6f0f0acf3)
Service-Card-Id: 92407667
Service-Version: 1.20
This contains all the changes of 5dda507, c4c5206, 9f08ee7, and
5f10159 (#16598 and all related PRs), but without the buffer restore
feature. The hope is that these changes fix some rarer issues
we've been hearing about, where persistence doesn't work correctly.
## Validation Steps Performed
This changeset was tested on Windows 11 with 2 windows and 4 tabs
where 1 tab had 2 mixed split panes. All windows and tabs got
restored properly. It didn't crash on Windows 10.
In the spirit of #15360 this implements the copy part.
The problem is that we have an issue accessing the clipboard while
other applications continue to work just fine. The major difference
between us and the others is that we use the WinRT clipboard APIs.
So, the idea is that we just use the Win32 APIs instead.
The feel-good side-effect is that this is (no joke) 200-1000x faster,
but I suspect no one will notice the -3ms difference down to <0.01ms.
The objective effect however is that it just works.
This may resolve#16982.
* Cycle through Text/HTML/RTF-only in the Interaction settings
* Paste the contents into Word each time
* Text is plain and HTML/RTF are colored ✅
(cherry picked from commit 5f3a857192b2fa6f4e5ae87eb3ee59a1571515a2)
Service-Card-Id: 92308708
Service-Version: 1.20
More TraceLogging = More better?
I made this change as I noticed that most calls are not being logged.
Even after this change some crucial information won't be logged
(for instance arrays of `INPUT_RECORD`), because I couldn't come up
with a clever way to do so, but I think this is better than nothing.
(cherry picked from commit f49cf44b799b4a4017ab7dce5c29694cda0fe725)
Service-Card-Id: 92374415
Service-Version: 1.20
Closes: #13961
This PR changes the window styling we use under the minimized state. We
now retain the active window styling so the content's height doesn't
change when switching between minimized and maximized states.
## Validation Steps Performed
- Open Terminal and go into Maximized mode.
- Click on the Minimize button.
- No `SizeChanged` event in `ControlCore`.
- Click on the WT icon in the taskbar to restore it.
- No `SizeChanged` event in `ControlCore`.
(cherry picked from commit 11c4aa459d846f3ea9cd68cf5555cbe83cfef4ab)
Service-Card-Id: 92350319
Service-Version: 1.20
Basically, title.
It'd be a neat idea for portable installs of the Terminal to reference
files that are right there in the portable install.
This PR adds a `WT_SETTINGS_DIR` var to Terminal's own env block. This
allows us to resolve profiles relative to our own settings folder.
Closes#16295
(cherry picked from commit 36c81f24fbbc3473a3b1bbb214b8234a52740a1a)
Service-Card-Id: 92352620
Service-Version: 1.20
I changed the improper capitalization and misuse of ellipses mark (...)
in the context menu and various other places.
Fixes issues #16819 and #16846
## PR Checklist
- [ ] Closes#16846
- [x] Tests added/passed - NA
- [x] Documentation updated - NA
- If checked, please file a pull request on [our docs
repo](https://github.com/MicrosoftDocs/terminal) and link it here: #xxx
- [x] Schema updated (if necessary) - NA
(cherry picked from commit 8bd9578b3ca9d18ba362ce1fff9b396d426b39e9)
Service-Card-Id: 92350387
Service-Version: 1.20
Work is ongoing to remove individually-authenticated service accounts
from some pipelines. This moves us closer to that goal.
Tested in Nightly 2403.28002.
(cherry picked from commit 2bcbe6b49208cb2040091b1cd2c9b3df8e69f5bd)
Service-Card-Id: 92239368
Service-Version: 1.20