ConPTY swallows SGR 3 and 23, so terminals like Alacritty are prevented from supporting italics #3579

Closed
opened 2026-01-30 23:24:50 +00:00 by claunia · 6 comments
Owner

Originally created by @chris-morgan on GitHub (Aug 27, 2019).

Originally assigned to: @zadjii-msft on GitHub.

Windows 10 version 1903, build 10.0.18362.295. Alacritty master.

Using Alacritty as the terminal (since it supports bold and italic text rendering), italic doesn’t work, because it seems to gets swallowed by ConPTY. https://github.com/jwilm/alacritty/issues/2745 has some discussion.

Steps to reproduce

Run the following in Bash or similar under Alacritty, with the enable_experimental_conpty_backend setting enabled:

echo -e 'Normal, \x1b[1mbold\x1b[22m, \x1b[3mitalic\x1b[23m, \x1b[1;3mbold italic\x1b[22;23m'

(If you don’t have that setting enabled, it’ll use WinPTY which also doesn’t pass italics through, but that’s irrelevant here.)

Expected behavior

Output like this:

Normal, bold, italic, bold italic

Actual behavior

Italics don’t occur:

Normal, bold, italic, bold italic

Further, when I insert logging into Alacritty’s csi_dispatch method, to observe what SGR codes it’s actually hearing about and applying, I see that the 3 (italic) and 23 (stop italic) have been swallowed, presumably by ConPTY, and Alacritty never saw them.

(ConPTY also modifies the CSI [ 1 m bold code to add another SGR code to change to the high-intensity colour. I still haven’t decided how I feel about that!)

I don’t know much about how these things work, so I don’t know if this is normal, but I was caught by surprise that ConPTY was apparently rendering things before they ever got to Alacritty, so that terminals are limited in what they can implement by what ConPTY implements. I expected it to pass everything through untouched, or at least to pass unknown things through rather than swallowing them.

Originally created by @chris-morgan on GitHub (Aug 27, 2019). Originally assigned to: @zadjii-msft on GitHub. Windows 10 version 1903, build 10.0.18362.295. Alacritty master. Using Alacritty as the terminal (since it supports bold and italic text rendering), italic doesn’t work, because it seems to gets swallowed by ConPTY. https://github.com/jwilm/alacritty/issues/2745 has some discussion. # Steps to reproduce Run the following in Bash or similar under Alacritty, with the `enable_experimental_conpty_backend` setting enabled: ```sh echo -e 'Normal, \x1b[1mbold\x1b[22m, \x1b[3mitalic\x1b[23m, \x1b[1;3mbold italic\x1b[22;23m' ``` (If you don’t have that setting enabled, it’ll use WinPTY which also doesn’t pass italics through, but that’s irrelevant here.) # Expected behavior Output like this: > Normal, **bold**, *italic*, ***bold italic*** # Actual behavior Italics don’t occur: > Normal, **bold**, italic, **bold italic** Further, when I insert logging into Alacritty’s `csi_dispatch` method, to observe what SGR codes it’s actually hearing about and applying, I see that the 3 (italic) and 23 (stop italic) have been swallowed, presumably by ConPTY, and Alacritty never saw them. (ConPTY also modifies the `CSI [ 1 m` bold code to add another SGR code to change to the high-intensity colour. I still haven’t decided how I feel about that!) I don’t know much about how these things work, so I don’t know if this is normal, but I was caught by surprise that ConPTY was apparently rendering things before they ever got to Alacritty, so that terminals are limited in what they can implement by what ConPTY implements. I expected it to pass everything through untouched, or at least to pass unknown things through rather than swallowing them.
Author
Owner

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

Alright, so we've got serious progress here. Here are some before, after screenshots:

image

(imagine the "Blinking" on the right blinking).

I need to add some tests, but not we'll render italics, blinking, invisible, crossed-out all through conpty. Unfortunately, double-underline and faint are a bit more complicated, so they aren't going to make the 20H1 cut, but I'll circle back with follow-up issues for them.

@zadjii-msft commented on GitHub (Sep 26, 2019): Alright, so we've got serious progress here. Here are some before, after screenshots: ![image](https://user-images.githubusercontent.com/18356694/65696440-d6ed9780-e03e-11e9-89b1-e4a4506262f5.png) (imagine the "Blinking" on the right <blink>blinking</blink>). I need to add some tests, but not we'll render italics, blinking, invisible, crossed-out all through conpty. Unfortunately, double-underline and faint are a _bit_ more complicated, so they aren't going to make the 20H1 cut, but I'll circle back with follow-up issues for them.
Author
Owner

@chris-morgan commented on GitHub (Sep 26, 2019):

Thanks, sounds good! I presume these things all combine properly with bold, which isn’t depicted, as well.

Is it possible to pass unimplemented things through, even if they’re not rendered by Command Prompt or Windows Terminal? Not that I actually have any use for double-underline and faint.

@chris-morgan commented on GitHub (Sep 26, 2019): Thanks, sounds good! I presume these things all combine properly with bold, which isn’t depicted, as well. Is it possible to pass unimplemented things through, even if they’re not rendered by Command Prompt or Windows Terminal? Not that I actually have any use for double-underline and faint.
Author
Owner

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

Unfortunately double-underline and faint have some implementations that would run closer to some other areas. I might be able to pass them through, but implementing them (in the buffer) is more complicated than the others in this set.

Bold does work fortunately:
image

@zadjii-msft commented on GitHub (Sep 26, 2019): Unfortunately double-underline and faint have some implementations that would run closer to some other areas. I might be able to pass them through, but implementing them (in the buffer) is more complicated than the others in this set. Bold _does_ work fortunately: ![image](https://user-images.githubusercontent.com/18356694/65699297-7d3b9c00-e043-11e9-921b-0200cf6aed77.png)
Author
Owner

@chris-morgan commented on GitHub (Sep 26, 2019):

Great, thanks! I’m looking forward to receiving this. 🙂

@chris-morgan commented on GitHub (Sep 26, 2019): Great, thanks! I’m looking forward to receiving this. 🙂
Author
Owner

@ghost commented on GitHub (Oct 23, 2019):

:tada:This issue was addressed in #2917, which has now been successfully released as Windows Terminal Preview v0.6.2951.0.🎉

Handy links:

@ghost commented on GitHub (Oct 23, 2019): :tada:This issue was addressed in #2917, which has now been successfully released as `Windows Terminal Preview v0.6.2951.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v0.6.2951.0) * [Store Download](https://www.microsoft.com/store/apps/9n0dx20hk701?cid=storebadge&ocid=badge)
Author
Owner

@DHowett-MSFT commented on GitHub (Oct 30, 2019):

Hey! The fix for this went out in Windows in the Insider channel's Fast Ring with build 19013.
There's a minor followup issue where each ext. attribute will only turn on once -- it's understood and fixed, awaiting a newer build.

@DHowett-MSFT commented on GitHub (Oct 30, 2019): Hey! The fix for this went out in Windows in the Insider channel's Fast Ring with build 19013. There's a minor followup issue where each ext. attribute will only turn on once -- it's understood and fixed, awaiting a newer build.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#3579