hyper icon indicating copy to clipboard operation
hyper copied to clipboard

Feature: display image files in the teminal

Open webxl opened this issue 9 years ago • 20 comments

aka imgcat: https://www.iterm2.com/documentation-images.html

webxl avatar Jul 15 '16 19:07 webxl

I would like to specify request for inline images. Thus ls *.jpg would render a list of thumbnails in current directory.

nirfse avatar Jul 29 '16 04:07 nirfse

I would like to attempt this. Any advice on where/how to start?

jorgegonzalez avatar Mar 23 '17 18:03 jorgegonzalez

Well 3 months now and still no word, are you @jorgegonzalez still on this? I would like to help if possible, does anyone have any advice on how to start tackling this feature?

samuelhnrq avatar Jun 07 '17 03:06 samuelhnrq

Sorry for never updating. I believe the problem lies in hterm's inability to render images.

https://github.com/zeit/hyper/blob/ca849425acef23c9e28b34c8946e89e323e597bd/lib/hterm.js

See these discussions:

https://groups.google.com/a/chromium.org/forum/#!searchin/chromium-hterm/images/chromium-hterm/Rd6eUIiof9M/5Au_82-FAQAJ

https://groups.google.com/a/chromium.org/forum/#!searchin/chromium-hterm/images/chromium-hterm/wWC-u-U9AR8/hCr2MmT_uGcJ

jorgegonzalez avatar Jun 08 '17 03:06 jorgegonzalez

Well seeing as they now seem to be planning to migrate to xterm.js you might want to hold off on this for now. #1275

DuIslingr avatar Jun 11 '17 18:06 DuIslingr

Those rumors may be overstated. According to the most recent conversations I have had on slack, the decision was ultimately to stick with hterm.

On Sun, Jun 11, 2017, 12:47 PM DuIslingr [email protected] wrote:

Well seeing as they now seem to be planning to migrate to xterm.js you might want to hold off on this for now. #1275 https://github.com/zeit/hyper/issues/1275

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/zeit/hyper/issues/101#issuecomment-307648590, or mute the thread https://github.com/notifications/unsubscribe-auth/ABQBZuZNsI_-6wGkyl5PsyPiZ83YBQwmks5sDDZEgaJpZM4JNupz .

MartyGentillon avatar Jun 11 '17 19:06 MartyGentillon

And apparently, I may be out of date.... On Sun, Jun 11, 2017, 1:02 PM Marty Gentillon [email protected] wrote:

Those rumors may be overstated. According to the most recent conversations I have had on slack, the decision was ultimately to stick with hterm.

On Sun, Jun 11, 2017, 12:47 PM DuIslingr [email protected] wrote:

Well seeing as they now seem to be planning to migrate to xterm.js you might want to hold off on this for now. #1275 https://github.com/zeit/hyper/issues/1275

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/zeit/hyper/issues/101#issuecomment-307648590, or mute the thread https://github.com/notifications/unsubscribe-auth/ABQBZuZNsI_-6wGkyl5PsyPiZ83YBQwmks5sDDZEgaJpZM4JNupz .

MartyGentillon avatar Jun 11 '17 19:06 MartyGentillon

The issue still happens on v2 with xterm. Using imgcat, the image is not displayed in my terminal.

lucasqueiroz avatar Sep 29 '17 16:09 lucasqueiroz

The issue still happens.

blahsd avatar Jan 23 '18 19:01 blahsd

almost 2 years after initial request?

Moelf avatar Jul 03 '18 07:07 Moelf

Thanks for the effort on this but I don't think we'll be moving forward with this any time soon. I'd say we should hold off on supporting this until we get more of the current stories finished up, have a good plan on how to handle varying height rows and we're sure we want to commit to supporting this (is it a security issue for apps being able to add tracking images?). https://github.com/xtermjs/xterm.js/pull/1577#issuecomment-439737128

Damn - was imagining all the weird things I could potentially do with this... a on-server try-catch-stackoverflow solution using a terminal based QR code would be funny af.

joshgarde avatar Jan 23 '19 04:01 joshgarde

I'm guessing we still don't have images in hyper?

nrgapple avatar Oct 30 '19 18:10 nrgapple

it's 2020... still no images... no water... no hope... james took the last of the supplies... i can hear them getting closer at night, becoming unafraid of the campfire... how much longer can we last without images...

rockyFierro avatar Feb 13 '20 06:02 rockyFierro

Sticking a oar in...

Would it not better for hyper to recognise and render html rather than images? It should then be trivial to write a hyper-cat script that could encapsulate any particular file type supported by html that can be inlined.

Use case: I ssh to a remote server, and I still want to read html files, view svml graphics and jpegs, without a seperate utility for each.

MartynF avatar Jun 11 '20 09:06 MartynF

That'd likely lead to a remote code execution vulnerability. It'd be a lot more work to render full HTML than to render just images because of the context isolation that would need to be added in.

joshgarde avatar Jun 11 '20 17:06 joshgarde

Surely its pretty simple to not run embedded code.... ?

MartynF avatar Jun 16 '20 14:06 MartynF

Perhaps just a little bit more complex than just displaying images. We'd have to create a new BrowserWindow instance and disable javascript. Then we'd probably use offscreen rendering to grab a bitmap of the rendered HTML to display in the main Hyper instance. So at the end of the day we're back to the "displaying images in Hyper" again lol

joshgarde avatar Jun 16 '20 17:06 joshgarde

iterm2 is doing it by adding a set of proprietary escape sequences for identifying and displaying images. Since we don't really handle the parsing and rendering ourselves, it might be better to request this on https://github.com/xtermjs/xterm.js

LabhanshAgrawal avatar Jun 16 '20 18:06 LabhanshAgrawal

It might be a bit better to build this out as a xterm addon since there's not really an open standard for supporting images in the terminal. Since iTerm2 is GPL licensed, would supporting its escape sequence require the code to be GPL licensed as well?

joshgarde avatar Jun 16 '20 18:06 joshgarde

Sorry if I don't know enough about this, but they could display the HTML in a sandboxed iframe.

mooocow123 avatar Dec 18 '22 15:12 mooocow123

Image support added in #6987 , will be in the next canary release soon.

LabhanshAgrawal avatar Jun 17 '23 04:06 LabhanshAgrawal