Skip to content

PyREPL does not recognize OSC sequences #157928

Description

@edvilme

PyREPL’s ANSI_ESCAPE_SEQUENCE regex currently recognizes CSI sequences but not Operating System Command (OSC) sequences. As a result, OSC sequences embedded in sys.ps1, such as VS Code’s OSC 633 terminal integration markers, are treated as visible characters and can cause incorrect prompt width calculation and cursor positioning. PyREPL should recognize OSC sequences as zero-width terminal controls.

This is especially evident when pressing tab to autocomplete

Default sys.ps1 with no OSC sequence

Image

Overwritten sys.ps1 with OSC sequence

Notice the difference in tab length, and after deleting, it is impossible to remove the remaining text (second picture)

Image Image

Linked PRs

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytopic-replRelated to the interactive shelltype-featureA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions