Printing specific sequence causes device attributes sequence to appear #23435

Closed
opened 2026-01-31 08:42:08 +00:00 by claunia · 3 comments
Owner

Originally created by @andfoy on GitHub (Jul 10, 2025).

Windows Terminal version

1.22.11141.0

Windows build number

10.0.26100.0

Other Software

Python 3.13

Steps to reproduce

If the statement print('\x1b[1t\x1b[c\x1b[?1004h\x1b[?9001h\x1b[94mHi\x1b[0m\r\n') is executed in a Python interpreter, then the console outputs the sequence ^[[?61;4;6;7;14;21;22;23;24;28;32;42c, which corresponds to the device attributes escape sequence https://github.com/microsoft/terminal/blob/main/src/terminal/adapter/adaptDispatch.cpp#L1464, I don't know if this is expected

Expected Behavior

Image

Actual Behavior

Image
Originally created by @andfoy on GitHub (Jul 10, 2025). ### Windows Terminal version 1.22.11141.0 ### Windows build number 10.0.26100.0 ### Other Software Python 3.13 ### Steps to reproduce If the statement `print('\x1b[1t\x1b[c\x1b[?1004h\x1b[?9001h\x1b[94mHi\x1b[0m\r\n')` is executed in a Python interpreter, then the console outputs the sequence `^[[?61;4;6;7;14;21;22;23;24;28;32;42c`, which corresponds to the device attributes escape sequence https://github.com/microsoft/terminal/blob/main/src/terminal/adapter/adaptDispatch.cpp#L1464, I don't know if this is expected ### Expected Behavior <img width="1575" height="219" alt="Image" src="https://github.com/user-attachments/assets/8a6a3612-ef60-46f7-9353-a4a1e3065f59" /> ### Actual Behavior <img width="1532" height="223" alt="Image" src="https://github.com/user-attachments/assets/a67ada01-914b-4b01-94c6-14d2d0dceb74" />
claunia added the Needs-TriageIssue-Bug labels 2026-01-31 08:42:08 +00:00
Author
Owner

@DHowett commented on GitHub (Jul 10, 2025):

Yes, \x1b[c is exactly how an application requests a device attribute report.

If you request reports but do not read their responses, they will end up on the input line.

@DHowett commented on GitHub (Jul 10, 2025): Yes, `\x1b[c` is exactly _how an application requests a device attribute report._ If you request reports but do not read their responses, they will end up on the input line.
Author
Owner

@DHowett commented on GitHub (Jul 10, 2025):

Now that I understand the problem report a bit more--thanks for linking the winpty-rs bug!--I wrote up some thoughts over there. Sorry if it came across as a brusque dismissal!

@DHowett commented on GitHub (Jul 10, 2025): Now that I understand the problem report a bit more--thanks for linking the `winpty-rs` bug!--I wrote up some thoughts over there. Sorry if it came across as a brusque dismissal!
Author
Owner

@andfoy commented on GitHub (Jul 10, 2025):

No worries! I actually opened this issue in order to get a better understanding of what's going on underneath, which is curious, given that I develop wrappers for ConPTY

@andfoy commented on GitHub (Jul 10, 2025): No worries! I actually opened this issue in order to get a better understanding of what's going on underneath, which is curious, given that I develop wrappers for ConPTY
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#23435