The Wayback Machine - https://web.archive.org/web/20220617080103/https://github.com/GitSquared/edex-ui/discussions/1154
Skip to content
This repository has been archived by the owner. It is now read-only.

Inline media #1154

pyrocto started this conversation in Ideas
Inline media #1154
Aug 11, 2021 · 1 comments · 2 replies

Here's a FAQ on inline graphics at the command line:
https://twitter.com/thingskatedid/status/1316074032379248640
Kitty, libsixel, and iTerm2 all have protocols for inline graphics at a terminal. Would be cool to support one of them or to implement your own.

At the moment, you've got an experimental globe feature that parses IP addresses out of the console result; iTerm2 does something similar. Quoting their docs:

iTerm2 extends the xterm protocol with a set of proprietary escape sequences. In general, the pattern is:
ESC ] 1337 ; key = value ^G
Whitespace is shown here for ease of reading: in practice, no spaces should be used.
For file transfer and inline images, the code is:
ESC ] 1337 ; File = [arguments] : base-64 encoded file contents ^G

You could do something similar but pass a JSON object between ESC ] 1337 ; and ^G.

Replies

1 comment
·
2 replies

This is out of scope for edex, it should be implemented in xterm.js

2 replies
@pyrocto

Thx. For future reference, here's their bug for supporting inline images:
xtermjs/xterm.js#2503

That said, xterm.js does expose the ability to register handlers for CSI, DCS, ESC, and OSC sequences. iTerm2 uses an OSC sequence. edex-ui could similarly claim any unused OSC number and register a handler for it.

@pyrocto

Here's a list of widely supported OSC sequences to avoid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
2 participants