Skip to content

Add a way to plugin a custom control sequence handler #1176

@ztmr

Description

@ztmr

Story:

  • I want to implement a DEC VT420+ sequence that is not implemented in the original xterm (= we don't want it to be a part of xterm.js by default) -- in theory, any of the sequences mentioned here
  • I want to implement a custom sequence that is supported only by the application displayed on the terminal: links Support hyperlink ansi escapes #1134, displaying pictures, custom svg graphics, maybe some kind of buttons (a [styled?] link that sends something back to the terminal, rather than opening in a new tab) and eventually being able to execute some code (being careful about security, so probably doing so in a sandbox and having to explicitly enable this and only for whitelisted functions)

Notes:

  • it is possible to do these things by hacking Parser and InputProcessor but I think most of it should be pluggable from outside
  • I am not sure if the parser is implemented correctly as it is missing some prefixes and suffixes (*, %, at minimum) and it is somehow expecting that these can be only prefix or only suffix, never both (should we check this? Not sure how this is related to broken escape sequence parser states #145.
  • some of these handlers would need to access the internals (terminal, canvas, etc.) -- although i can imagine some kind of abstraction (renderSvg(...), renderWhatever(...), setStateProp(prop, value), ensureBuffer(id), ...) the question is if these would be enough (not sure how to cleanly handle Implement double-height/width sequences (DECSWL/DECDWL/DECDHL) #1175 for example)
  • for example, there are things like DECSASD/DECSCPP/DECSNLS that can be implemented by using Terminal.resize or DECSSDT to set a new terminal "state" property (status line in this case) that can be displayed outside of terminal below the canvas if enabled in terminal properties

I can do some work on this eventually but need to agree on the approach to take.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions