Skip to content

OSC 133: Support semantic prompt regions #5932

@jparise

Description

@jparise

Our support for semantic prompts (OSC 133) is currently row-based. It should be region-based, allowing semantic prompts to span multiple rows and allowing a row to contain multiple semantic prompts.

Row-based support is too limiting and has led to problems like #3003, where we needed to change the way we emit prompt markers to work around the implicit "last prompt marker on a row wins" behavior of the current implementation.

Region-based support would also let us reliably support more advanced prompt behavior, such as styling different prompt regions, collapsing prompts and their output, and implementing more advanced selections and click-based movements. Here are some examples from DomTerm:

Prompt region styling

Image

Command output collapsing

Image

Prompt-aware selection

Image

Notes

  • Wezterm has a SemanticZone type that is created by semantic prompt markers. This could be a nice generalization to adopt.
  • We only support a minimal subset of the OSC 133 commands. We should support most/all of those commands and their behaviors.
  • Similar to how we manage hyperlinks, we should optimize for sparse page-based prompt storage.
  • We could add an Inspector mode to visualize semantic prompt regions.
  • Support OSC 133's cl (click-move) option #1966 exists to specifically track the click-based movement part of the specification. This would be a nice-to-have, but it's not important as the other fundamentals described here.

Metadata

Metadata

Assignees

Labels

vtControl sequence related

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions