[1.19] Shell integration marks are totally in the wrong place #20551

Closed
opened 2026-01-31 07:17:17 +00:00 by claunia · 7 comments
Owner

Originally created by @zadjii-msft on GitHub (Sep 26, 2023).

Originally assigned to: @lhecker on GitHub.

This was on
Windows Terminal Canary
Version: 1.19.2643.0

shell-integration-crazy-wrong

Looks like the marks are like... off by one?

Possible culprits:

Originally created by @zadjii-msft on GitHub (Sep 26, 2023). Originally assigned to: @lhecker on GitHub. This was on Windows Terminal Canary Version: 1.19.2643.0 ![shell-integration-crazy-wrong](https://github.com/microsoft/terminal/assets/18356694/ad3c6d94-784c-4f9e-8f63-f28b60db776b) Looks like the marks are like... off by one? Possible culprits: * #16006 * #15991 - 41f7ed73c - Nope, just reverting that didn't work. * #15935 - 741633e - Nope, not this one either * #15701 - 74748394c not this one
Author
Owner

@zadjii-msft commented on GitHub (Sep 26, 2023):

Looks like this is also busted in v1.19.2652.0

@zadjii-msft commented on GitHub (Sep 26, 2023): Looks like this is also busted in v1.19.2652.0
Author
Owner

@zadjii-msft commented on GitHub (Sep 28, 2023):

oh no, scrolling is really badly messed up

image
image
image

@zadjii-msft commented on GitHub (Sep 28, 2023): oh no, scrolling is really badly messed up ![image](https://github.com/microsoft/terminal/assets/18356694/3b5ba58f-4323-4ec0-9e1a-8d94df7966b5) ![image](https://github.com/microsoft/terminal/assets/18356694/bcd689e1-1302-470b-8dfd-6635b642a44d) ![image](https://github.com/microsoft/terminal/assets/18356694/91d963fa-ebf2-4b2c-8c61-8b536a2e959c)
Author
Owner

@zadjii-msft commented on GitHub (Sep 28, 2023):

Bisecting. Starting by looking for a good commit around

@zadjii-msft commented on GitHub (Sep 28, 2023): Bisecting. Starting by looking for a good commit around ❔ ✅ ❌ * [x] ❌ 198c11f36 main * [ ] ... * [x] ❔ 2e91e9c6d Display connection state in tab and add context menu entry for restarting connection (#15760) * [ ] ... * [x] ✅ c5e0908b9 Update cmd.exe FAQ (#15918)
Author
Owner

@zadjii-msft commented on GitHub (Sep 28, 2023):

4ddfc3eaf3 is the first bad commit
commit 4ddfc3eaf3

COOKED_READ_DATA: Fix scrolling under ConPTY (#15930)

@zadjii-msft commented on GitHub (Sep 28, 2023): 4ddfc3eaf387b770530da8bb985bac9613063327 is the first bad commit commit 4ddfc3eaf387b770530da8bb985bac9613063327 COOKED_READ_DATA: Fix scrolling under ConPTY (#15930)
Author
Owner

@zadjii-msft commented on GitHub (Sep 28, 2023):

Okay this is 100% due to:

cc2ba5350d/src/host/_stream.cpp (L79-L93)

@lhecker how load bearing is that? I know that comment sounds super scary above it, but manually setting needsConPTYWorkaround to false definitely fixes the scrolling and marks issue.

@zadjii-msft commented on GitHub (Sep 28, 2023): Okay this is 100% due to: https://github.com/microsoft/terminal/blob/cc2ba5350d115b6898ac8b92482d0af7b8c4d365/src/host/_stream.cpp#L79-L93 @lhecker how load bearing is that? I know that comment sounds super scary above it, but manually setting `needsConPTYWorkaround` to `false` definitely fixes the scrolling and marks issue.
Author
Owner

@lhecker commented on GitHub (Sep 28, 2023):

I'll fix #16044 and this issue in a single PR.
For #16044 I'll make it so that appending text only reprints the minimum amount of text that's necessary and for this issue I'll revert the above code entirely.

After all that, I'll reopen #15899 and leave it unfixed for the foreseeable future, because as much of a significant bug it is, I feel like fixing it is too difficult for the impact it has. To properly fix it, it always either required us to sacrifice on our i18n or to implement a pager, both of which are a pain to do. We have other issues that are much easier to fix and are hit much more often, right?
And if we don't reprint the entire prompt when appending text, I don't think it'll be hit very often. After all, cmd.exe always reprinted the entire prompt when inserting in the middle...

@lhecker commented on GitHub (Sep 28, 2023): I'll fix #16044 and this issue in a single PR. For #16044 I'll make it so that appending text only reprints the minimum amount of text that's necessary and for this issue I'll revert the above code entirely. After all that, I'll reopen #15899 and leave it unfixed for the foreseeable future, because as much of a significant bug it is, I feel like fixing it is too difficult for the impact it has. To properly fix it, it always either required us to sacrifice on our i18n or to implement a pager, both of which are a pain to do. We have other issues that are much easier to fix and are hit much more often, right? And if we don't reprint the entire prompt when appending text, I don't think it'll be hit very often. After all, cmd.exe always reprinted the entire prompt when inserting in the middle...
Author
Owner

@zadjii-msft commented on GitHub (Sep 28, 2023):

Totally cool with that. Tossing this one over to you then ☺️

@zadjii-msft commented on GitHub (Sep 28, 2023): Totally cool with that. Tossing this one over to you then ☺️
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#20551