colab-xterm icon indicating copy to clipboard operation
colab-xterm copied to clipboard

Error when trying to display an image in the terminal

Open nnWhisperer opened this issue 1 year ago • 3 comments

Hello, I want to view an image in xterm, for reasons below. To display an image inside a terminal, I tried several options and none of them worked. Do you have suggestions?

  1. using fim: ioctl VT_GETSTATE: Inappropriate ioctl for device (not a linux console?) open /dev/fb0: No such file or directory
  2. using feh: feh ERROR: Can't open X display. It is running, yeah?
  3. using w3m-img: black screen saying "Hit any key to quit w3m:".

Reason I want to use xterm to display an image is, that image is updated by another process, hence I want to display image by updating it periodically, like with using the "watch $cmd" command that runs a command periodically. But first, I need to manage to display an image in terminal. Thank you

nnWhisperer avatar Jun 28 '24 13:06 nnWhisperer

Hi @nnWhisperer

  1. Put your image in the /content folder

    Example:

    curl -o img.png https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png
    
  2. Find your image in the FILES in the sidebar and open it. image

popcornylu avatar Jul 01 '24 06:07 popcornylu

It doesn't update dynamically; !curl -o img.png https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png !curl -o img.png https://www.pngall.com/wp-content/uploads/8/Sample-PNG-Image.png The displayed img.png image isn't updated.

nnWhisperer avatar Jul 01 '24 07:07 nnWhisperer

Sorry, non-terminal functionality is not something that colab-xterm is designed to handle. You may need to look for other Colab plugins that can address this issue.

popcornylu avatar Jul 02 '24 08:07 popcornylu

@popcornylu Please reconsider https://github.com/jerch/xterm-addon-image You can use sixel protocol try timg or lsix https://github.com/hzeller/timg

Kreijstal avatar Jan 21 '25 20:01 Kreijstal