hackerb9 / lsix

Like "ls", but for images. Shows thumbnails in terminal using sixel graphics.
GNU General Public License v3.0
3.97k stars 129 forks source link

mlterm display nothing except for a new file output named sixel:- #34

Closed blogdaren closed 4 years ago

blogdaren commented 4 years ago

i use mlterm with versoin 3.9.0 as my VT on Centos 6.5, then i run ./lsix demo.jpg as well as i tested some other different kind of images like PNG or JPEG, then the terminal display nothing,except for a new file output named sixel:-, so what happened? tks a lot.

BTW: X Server was installed on my windows7 system, and i try the command display demo.jpg, it works very well.

hackerb9 commented 4 years ago

What version of ImageMagick are you using?

blogdaren commented 4 years ago

What version of ImageMagick are you using?

Version: ImageMagick 6.7.2-7

hackerb9 commented 4 years ago

That should work, but maybe the Windows version is defective. Does lsix work for you on Centos?

hackerb9 commented 4 years ago

Actually, I just looked it up and version 6.7 did not have sixel support. Please upgrade your ImageMagick and let me know if it works.

blogdaren commented 4 years ago

That should work, but maybe the Windows version is defective. Does lsix work for you on Centos?

Acturally, i'm not very clear how lsix works, so could you help me check whether my orderly steps right or not? 1、firstly, both xserver and Xshell are located on windows7; 【BTW: i start the xserver which is built-in MobaXterm for windows7】 2、then use xshell SSH login to remote CentOS system 3、then # yum install imagemagic and get the Version: ImageMagick 6.7.2-7 4、then compile and install mlterm from source 5、then start mlterm from CentOS 6、then download your lsix shell scripts, chmod 755 and put it into /usr/bin/lsix 7、finally execute # lsix demo.jpeg from mlterm then it display nothing, but except for a new file output named sixel:-

blogdaren commented 4 years ago

Actually, I just looked it up and version 6.7 did not have sixel support. Please upgrade your ImageMagick and let me know if it works.

@hackerb9 have upgrade ImageMagic to the latest: Version: ImageMagick 7.0.10-24, but still keep the same issue.

hackerb9 commented 4 years ago

Peculiar. I don't think they dropped sixel support in 7. Please try 6.9 and on your Centos box.

blogdaren commented 4 years ago

@hackerb9 okay, i will try 6.9, so is that right about the orderly steps listed above?

hackerb9 commented 4 years ago

Thanks for the nudge, I somehow missed your question about the steps.

The steps you gave would work, presuming mlterm is able to show graphics remotely, which it should. An X server isn't necessary for lsix, but I presume you have it installed for other reasons. If not, I believe there are sixel compatible terminals for Windows, although I don't know about Windows 7.

I'm surprised Centos is giving you such an ancient version of ImageMagick. Have you updated Centos recently?

hackerb9 commented 4 years ago

A couple side notes: /usr/bin is for programs installed by the system. Centos. Software installed by the local administrator, that's you, would go in /usr/local/bin.

Also, did you remove the old ImageMagick package when you tried the new version? I wonder if you might have accidentally been running the wrong version.

blogdaren commented 4 years ago

@hackerb9 Tks for you patient help so much.

1、My CentOS version is 6.5, it's indeed ancient and need to be used all the time for some reasons. 2、A few days ago, i learned that mlterm work as the role of xclient from some sites, which almost indicate that i also shoud have xserver installed【xserver is started by MobaXterm on windows7】, besides, bcz my centos is installed in VBOX and work as pure text mode, then i execute # yum install imagemagick and # export DISPLAY=windows7's IP:PORT and # display /path/to/demo.jpg , finally , it shows the image successfully in a ImageMagic's window. hmm...., here, i get something confused: (1)you mentioned that the xserver is not necessary for lsix, but lsix must be run from the VT like mlterm or xterm right? so i try to stop the xserver, then it will NOT show any WINDOW after executing the command # mlterm, and works well in turn. so what is going on? (2)the command # display /path/to/demo.jpg shows the image successfully by ImageMagic, but i not sure here the ImageMagic belongs to windows7 or CentOS on earth? i just guess the centos's ImageMagic handle the image stream then forward to windows7's xserver to render the image, right? (3)i thought lsix works some like the command display, now it seems not so, right?
3、I had removed the old package by # yum remove ImageMagick, then compile the latest version 7.0 from source. 4、I login as root all the time, so i think either /usr/bin/lsix or /usr/local/bin/lsix should be ok, and i moved it into /usr/local/bin/lsix already.

blogdaren commented 4 years ago

@hackerb9

1、I have a code debug but no any gain for lsix, then try to rename lsix to any other new name like llsix, it works unexpectedly, then i start a deep keysword search for lsix but nothing found, it's so weird, i don't know what happened. so anyhow it indeed works now【means ImageMagick-7.0 also supports sixel】, but there comes a new question: the image(s) is(are) always shown on TOP-LEFT corner of the terminal window in one line, then what shoud i do? 2、 I still have some pieces of things which need your guidance: (1)how lsix works in general? i pay more attention to the command montage and convert and read so on. (2)lsix absolutely has nothing to do with xserver, right ? (3)who is responsible for underlying rendering or displaying the image? i care about this very much.


well, after much thought, I seem to understand it's the converted file sixel:- which is rendered by VT terminal like mlterm, right ?


Tks so much once again.

hackerb9 commented 4 years ago

Try type lsix to see where you may have installed lsix.

Even if you are running as root, don't copy lsix into /bin or /usr/bin as those are for your OS. You can read more about that in the FHS (Filesystem Hierarchy Standard).

Top left problem is usually caused by an mlterm bug. what does echo $TERM show?

Lsix has nothing to do with the xserver. It works in general by sending escape sequences according to the sixel standard. Your terminal is responsible for rendering. Search for "sixel" to learn about that.

The file "sixel:-" was an error caused by the old version of ImageMagick. Just delete it. The current version should understand that file name to mean "convert to sixel and write the data to standard output" (which is your terminal).

blogdaren commented 4 years ago

both x11 or xserver and sixel are completely new to me, as well as xterm or mlterm:

  1. type lsix shows /usr/local/bin/lsix, it still not work unless i rename lsix to any other script name;
  2. I totally agree what you said about where lsix located;
  3. echo $TERM shows xterm 【here why not mlterm?】
  4. I got that Lsix has nothing to do with the xserver, but if i want to start mlterm, it needs first to start xserver right? I always thought mlterm doesn't need xserver, and what about other VT like xterm? have the similar works? I just intended to show images directly from the terminal【pure text mode】 without any unnecessary dependency like xserver. of course, maybe it must to be done like that and i know so little about it.