Skip to content

OSC sequences in prompt get front loaded #11220

@Tyriar

Description

@Tyriar

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�[12;7H�]133;before�middle�]133;after�
�[?25h

Actual Behavior

�[?25l�[12;7H�]133;before��]133;after�
middle�[?25h

Metadata

Metadata

Assignees

No one assigned

    Labels

    Resolution-DuplicateThere's another issue on the tracker that's pretty much the same thing.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions