OSC sequences in prompt get front loaded #15204

Closed
opened 2026-01-31 04:31:22 +00:00 by claunia · 3 comments
Owner

Originally created by @Tyriar on GitHub (Sep 13, 2021).

Windows Terminal version (or Windows build number)

19042.1165

Other Software

VS Code
Version: 1.61.0-insider (user setup)
Commit: ec40cbe164c59f3d13b6eff5fc7b0231ec0ab7aa
Date: 2021-09-13T05:15:14.689Z
Electron: 13.1.8
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Windows_NT x64 10.0.19042

Steps to reproduce

Redefine the prompt to inject OSC sequences, for example:

pwsh:

function Prompt() {
  return "`e]133;before`u{7}middle`e]133;after`u{7}"
}

wsl.exe:

export PS1='\x1b]133;before\x07middle\x1b]133;after\x07

When this gets run through conpty all the OSC sequences seem to get front loaded, not put in the order that they are defined.

Expected Behavior

I expect the terminal to receive the following:

[?25l]133;beforemiddle]133;after
[?25h

Actual Behavior

[?25l]133;before]133;after
middle[?25h
Originally created by @Tyriar on GitHub (Sep 13, 2021). ### Windows Terminal version (or Windows build number) 19042.1165 ### Other Software VS Code Version: 1.61.0-insider (user setup) Commit: ec40cbe164c59f3d13b6eff5fc7b0231ec0ab7aa Date: 2021-09-13T05:15:14.689Z Electron: 13.1.8 Chrome: 91.0.4472.164 Node.js: 14.16.0 V8: 9.1.269.39-electron.0 OS: Windows_NT x64 10.0.19042 ### Steps to reproduce Redefine the prompt to inject OSC sequences, for example: pwsh: ```pwsh function Prompt() { return "`e]133;before`u{7}middle`e]133;after`u{7}" } ``` wsl.exe: ```sh export PS1='\x1b]133;before\x07middle\x1b]133;after\x07 ``` When this gets run through conpty all the OSC sequences seem to get front loaded, not put in the order that they are defined. ### Expected Behavior I expect the terminal to receive the following: ``` [?25l]133;beforemiddle]133;after [?25h ``` ### Actual Behavior ``` [?25l]133;before]133;after middle[?25h ```
claunia added the Resolution-Duplicate label 2026-01-31 04:31:22 +00:00
Author
Owner

@j4james commented on GitHub (Sep 14, 2021):

This sounds like a variant of #8698.

Edit: Although, now that I think about, this particular case is probably not completely fixable without a pure pass-through mode (i.e. #1173).

@j4james commented on GitHub (Sep 14, 2021): This sounds like a variant of #8698. Edit: Although, now that I think about, this particular case is probably not completely fixable without a pure pass-through mode (i.e. #1173).
Author
Owner

@zadjii-msft commented on GitHub (Sep 14, 2021):

Yea, this is /dup #8698, which should get fixed by passthrough, once we get the details all sorted out.

@zadjii-msft commented on GitHub (Sep 14, 2021): Yea, this is /dup #8698, which should get fixed by passthrough, once we get the details all sorted out.
Author
Owner

@ghost commented on GitHub (Sep 14, 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 (Sep 14, 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#15204