Automatic gift character #14937

Closed
opened 2026-01-31 04:23:43 +00:00 by claunia · 6 comments
Owner

Originally created by @he852100 on GitHub (Aug 23, 2021).

Windows Terminal version (or Windows build number)

10.0.19043.0

Other Software

Platform ServicePack Version VersionString


Win32NT 10.0.19043.0 Microsoft Windows NT 10.0.19043.0

Steps to reproduce

$d=iwr https://camtasia-help.netlify.app/feed.xml
$d.RawContent

Expected Behavior

ps >

Actual Behavior

PS > [?1;0c

Originally created by @he852100 on GitHub (Aug 23, 2021). ### Windows Terminal version (or Windows build number) 10.0.19043.0 ### Other Software Platform ServicePack Version VersionString -------- ----------- ------- ------------- Win32NT 10.0.19043.0 Microsoft Windows NT 10.0.19043.0 ### Steps to reproduce $d=iwr https://camtasia-help.netlify.app/feed.xml $d.RawContent ### Expected Behavior ps > ### Actual Behavior PS > [?1;0c
claunia added the Resolution-Duplicate label 2026-01-31 04:23:43 +00:00
Author
Owner

@he852100 commented on GitHub (Aug 23, 2021):

Windows Terminal
版本: 1.9.1942.0

@he852100 commented on GitHub (Aug 23, 2021): Windows Terminal 版本: 1.9.1942.0
Author
Owner

@zadjii-msft commented on GitHub (Aug 23, 2021):

Does this repro in the vintage console host window (i.e. cmd.exe), or only in the Windows Terminal? Does this repro after running Remove-module PsReadline?

@zadjii-msft commented on GitHub (Aug 23, 2021): Does this repro in the vintage console host window (i.e. `cmd.exe`), or only in the Windows Terminal? Does this repro after running `Remove-module PsReadline`?
Author
Owner

@j4james commented on GitHub (Aug 24, 2021):

I believe this is a variant of #10310 and #10069. The content of the feed is encoded as UTF-8, but it looks like PowerShell is interpreting it as an 8-byte charset, so any bytes in the range 0x80 to 0x9F are going to be interpreted as C1 control characters. Code point 0x9A in particular is the equivalent of the DECID command, and thus triggers the primary device attributes response.

Changing the code page to 65001 didn't seem to make any difference, but maybe that's the way RawContent is meant to work.

@j4james commented on GitHub (Aug 24, 2021): I believe this is a variant of #10310 and #10069. The content of the feed is encoded as UTF-8, but it looks like PowerShell is interpreting it as an 8-byte charset, so any bytes in the range 0x80 to 0x9F are going to be interpreted as C1 control characters. Code point 0x9A in particular is the equivalent of the `DECID` command, and thus triggers the _primary device attributes_ response. Changing the code page to 65001 didn't seem to make any difference, but maybe that's the way `RawContent` is meant to work.
Author
Owner

@j4james commented on GitHub (Aug 24, 2021):

Note that this probably won't show in the vintage console, because we didn't support all C1 control characters until PR #7340, and I don't think that would have been included in build 19043 of Windows.

Also note that it's not necessarily dependent on PowerShell. You can reproduce the same think in a WSL shell by switching to 8-bit first (with something like printf "\e%%@"), and then using curl to fetch the feed content.

@j4james commented on GitHub (Aug 24, 2021): Note that this probably won't show in the vintage console, because we didn't support all C1 control characters until PR #7340, and I don't think that would have been included in build 19043 of Windows. Also note that it's not necessarily dependent on PowerShell. You can reproduce the same think in a WSL shell by switching to 8-bit first (with something like `printf "\e%%@"`), and then using `curl` to fetch the feed content.
Author
Owner

@zadjii-msft commented on GitHub (Aug 24, 2021):

Ah good catch! This does look a lot like those, so let's just keep the conversation in those threads.

/dup #10310
/dup #10069

@zadjii-msft commented on GitHub (Aug 24, 2021): Ah good catch! This does look a lot like those, so let's just keep the conversation in those threads. /dup #10310 /dup #10069
Author
Owner

@ghost commented on GitHub (Aug 24, 2021):

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@ghost commented on GitHub (Aug 24, 2021): Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#14937