OSC sequences in prompt get front loaded #15201

Open
opened 2026-01-31 04:31:20 +00:00 by claunia · 0 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:20 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#15201