-
Hello. I have a question about one case that I need to implement. Imagine having a terminal output like this:
All lines starting with <img src="[data](data:image/png;base64,[the base64]" /> I tried to take a look at image addon which is used for iTerm protocol but the code there seems to me like rocket science. Can someone please suggest to me some good points on how to implement this and where to start? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
The question is whether those images should be shown inline in the terminal, or elsewhere on the html page. For inline output with intact buffer scrolling the easiest way is prolly to replace your base64 lines with inline image protocol sequences (iTerm's image sequence) and use the image addon, it will automatically show the images inlined at the position of the sequence. For how to shape the sequence, see the protocol spec here https://iterm2.com/documentation-images.html. For elsewhere on the html page, do the following:
|
Beta Was this translation helpful? Give feedback.
The question is whether those images should be shown inline in the terminal, or elsewhere on the html page.
For inline output with intact buffer scrolling the easiest way is prolly to replace your base64 lines with inline image protocol sequences (iTerm's image sequence) and use the image addon, it will automatically show the images inlined at the position of the sequence. For how to shape the sequence, see the protocol spec here https://iterm2.com/documentation-images.html.
For elsewhere on the html page, do the following:
new Image
and setsrc
attribute to your base64 string