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

OSC escape sequences received out-of-order in 3rd-party terminals #17314

Closed
acarl005 opened this issue May 23, 2024 · 4 comments
Closed

OSC escape sequences received out-of-order in 3rd-party terminals #17314

acarl005 opened this issue May 23, 2024 · 4 comments
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.

Comments

@acarl005
Copy link

Windows Terminal version

1.19.11213.0

Windows build number

10.0.22631.0

Other Software

No response

Steps to reproduce

ANSI compatibility has been pretty good in ConPTY. We're coming up on some niche cases.

In a 3rd-party terminal, e.g. alacritty, produce some text with an OSC escape sequence interleaved between some text.

PowerShell 7.4.2
PS> echo "hello `e]2;new title`a world"
hello  world

Visually, things look pretty OK. The correct text is echo'd and the title is changed.

Screenshot 2024-05-23 195707

But, here is the exact data that alacritty read out of ConPTY:


hello  world
PS> ESC]0;new titleBEL

Observe that when the text was produced in the shell, the OSC command to set title was between "hello" and "world". However, when the text was read out of ConPTY by the terminal, the ordering is changed.

Expected Behavior

I expect the ordering of text, including the ANSI escape sequences, to be preserved.

Actual Behavior

ANSI escape sequences are being parsed and re-serialized in a "lossy" way. While this may be necessary when a Windows Terminal is involved, it isn't when the terminal application only receives ANSI sequences. That is, there is no need to try to parse the ANSI. ConPTY does still need to convert console API calls coming from Windows command-line apps, but plain ANSI text doesn't need any conversion.

@acarl005 acarl005 added Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels May 23, 2024
Copy link

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@j4james
Copy link
Collaborator

j4james commented May 25, 2024

This is essentially a duplicate of #8698, and is probably not generically solvable without passing through the ANSI sequences directly, as you're proposing. That's tracked in #1173.

@carlos-zamora
Copy link
Member

Thanks for filing! We're going to mark this as a /dup of #8698 then 😊

Copy link
Contributor

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!

@microsoft-github-policy-service microsoft-github-policy-service bot added Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.
Projects
None yet
Development

No branches or pull requests

3 participants