Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the ConPTY extended attributes optimization #13661

Merged
10 commits merged into from
Aug 5, 2022

Conversation

zadjii-msft
Copy link
Member

@zadjii-msft zadjii-msft commented Aug 2, 2022

... which should have never worked in the first place

Quick filing a PR for review. This is the bulk of the actual code changes. Figured it was best to review the conpty changes sooner than later and I can add tests in the morning.

Test cases:

printf "\e[7m         test         \e[m\n"
printf "\e[7m"; printf ' %.0s' $(seq 1 $COLUMNS); printf "\e[m\n"

After:
image

Closes #13229

Definitely fixes:

@ghost ghost added Area-Rendering Text rendering, emoji, complex glyph & font-fallback issues Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-0 Bugs that we consider release-blocking/recall-class (P0) Product-Conpty For console issues specifically related to conpty Severity-Blocking We won't ship a release like this! No-siree. labels Aug 2, 2022
@zadjii-msft
Copy link
Member Author

Whoops, I might want to revert e476682. I started from there, but that might not actually be relevant to this bug.

@github-actions

This comment has been minimized.

@zadjii-msft zadjii-msft added this to the Terminal v1.16 milestone Aug 3, 2022
Comment on lines 170 to 172
!IsAnyGridLineEnabled() ||
GetHyperlinkId() != 0 ||
IsReverseVideo();
Copy link
Member

@lhecker lhecker Aug 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW !IsAnyGridLineEnabled() || IsReverseVideo() is the same as _wAttrLegacy != 0. The wLegacyAttr & META_ATTRS in the constructor strips away legacy color attributes and the following WI_ClearAllFlags(_wAttrLegacy, COMMON_LVB_SBCSDBCS); strips DBCS attributes. All attributes that are left are all those that you're testing here.

@@ -161,6 +164,13 @@ class TextAttribute final
{
return WI_IsAnyFlagSet(_wAttrLegacy, COMMON_LVB_GRID_HORIZONTAL | COMMON_LVB_GRID_LVERTICAL | COMMON_LVB_GRID_RVERTICAL | COMMON_LVB_UNDERSCORE);
}
constexpr bool HasAnyExtendedAttributes() const noexcept
{
return GetExtendedAttributes() != ExtendedAttributes::Normal ||
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(fwiw: since GetExtendedAttributes doesn't do any translation or synthesis on its own, why should we use it instead of just using _extendedAttrs directly?)

@@ -424,10 +424,15 @@ using namespace Microsoft::Console::Types;
// the inbox telnet client doesn't understand the Erase Character sequence,
// and it uses xterm-ascii. This ensures that xterm and -256color consumers
// get the enhancements, and telnet isn't broken.
//
// GH#13229: ECH and EL don't fill the space with "meta" attributes like
Copy link
Member

@DHowett DHowett Aug 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, don't we still have the "background" version of this problem? \e[40m x theres a lot of spaces here, github deleted them \e[m doesn't require any extended attributes.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

more tests you got it

@zadjii-msft zadjii-msft added the AutoMerge Marked for automatic merge by the bot when requirements are met label Aug 5, 2022
@ghost
Copy link

ghost commented Aug 5, 2022

Hello @zadjii-msft!

Because this pull request has the AutoMerge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@ghost ghost merged commit ffe9a0f into main Aug 5, 2022
@ghost ghost deleted the dev/migrie/b/8341-but-also-maybe-13229 branch August 5, 2022 19:31
DHowett pushed a commit that referenced this pull request Aug 8, 2022
... which should have never worked in the first place

Quick filing a PR for review. This is the bulk of the actual code changes. Figured it was best to review the conpty changes sooner than later and I can add tests in the morning.

Test cases:
```
printf "\e[7m         test         \e[m\n"
```

```
printf "\e[7m"; printf ' %.0s' $(seq 1 $COLUMNS); printf "\e[m\n"
```

After:
![image](https://user-images.githubusercontent.com/18356694/182478185-6e65ab99-5c27-4772-af3b-2baa22387ec1.png)

Closes #13229

Definitely fixes:
* [x] #13643
* [x] PowerShell/PowerShell#17812

(cherry picked from commit ffe9a0f)
Service-Card-Id: 84736231
Service-Version: 1.15
@ghost
Copy link

ghost commented Aug 17, 2022

🎉Windows Terminal v1.14.228 has been released which incorporates this pull request.:tada:

Handy links:

@ghost
Copy link

ghost commented Aug 17, 2022

🎉Windows Terminal Preview v1.15.228 has been released which incorporates this pull request.:tada:

Handy links:

PKRoma pushed a commit to PKRoma/Terminal that referenced this pull request Oct 15, 2022
... which should have never worked in the first place

Quick filing a PR for review. This is the bulk of the actual code changes. Figured it was best to review the conpty changes sooner than later and I can add tests in the morning.

Test cases:
```
printf "\e[7m         test         \e[m\n"
```

```
printf "\e[7m"; printf ' %.0s' $(seq 1 $COLUMNS); printf "\e[m\n"
```

After:
![image](https://user-images.githubusercontent.com/18356694/182478185-6e65ab99-5c27-4772-af3b-2baa22387ec1.png)

Closes microsoft#13229

Definitely fixes:
* [x] microsoft#13643
* [x] PowerShell/PowerShell#17812

(cherry picked from commit ffe9a0f)
Service-Card-Id: 84736231
Service-Version: 1.15
(cherry picked from commit fff3372)
Service-Card-Id: 84736230
Service-Version: 1.14
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Rendering Text rendering, emoji, complex glyph & font-fallback issues AutoMerge Marked for automatic merge by the bot when requirements are met Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-0 Bugs that we consider release-blocking/recall-class (P0) Product-Conpty For console issues specifically related to conpty Severity-Blocking We won't ship a release like this! No-siree.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Terminal can omit backgrounds, links and underlines on empty cells
4 participants