hackerb9 / lsix Goto Github PK
View Code? Open in Web Editor NEWLike "ls", but for images. Shows thumbnails in terminal using sixel graphics.
License: GNU General Public License v3.0
Like "ls", but for images. Shows thumbnails in terminal using sixel graphics.
License: GNU General Public License v3.0
There is no output at all when I try to use lsix. This was tested with bash and sh (pictured), on xfce4-terminal 0.8.7.4 on arch linux. There is no output with xterm either.
Using Gentoo Linux. installed lsix by placing in file: /tmp/lsix.
I'm in a Gnome desktop. I installed xterm
`jlpoole@taurus ~/Pictures $ eix -I xterm
[I] x11-terms/xterm
Available versions: 327{tbz2} ~333 ~337 {Xaw3d +openpty toolbar truetype unicode xinerama}
Installed versions: 327{tbz2}(02:26:05 PM 12/27/2018)(openpty truetype unicode -Xaw3d -toolbar -xinerama)
Homepage: https://invisible-island.net/xterm/
Description: Terminal Emulator for X Windows
jlpoole@taurus ~/Pictures $
`
I then launch an xterm:
xterm -ti vt340 &
And then within the displayed Xterm:
My /home/jlpoole/.Xresources file:
#
# per
# https://github.com/hackerb9/lsix/blob/master/lsix
#
# xterm -ti vt340
#
xterm*decTerminalID : vt340
xterm*allowWindowOps : False
xterm*disallowedWindowOps : 1,2,3,4,5,6,7,8,9,11,13,18,19,20,21,GetSelection,SetSelection,SetWinLines,SetXprop
First of all: thanks for lsix
! It's really great.
For packaging and releasing lsix
-- e.g. with package managers (like pacman
and apt-get
) -- a release is a must, sources can not be pulled from master, as the packagers have no control over how the master branch changes.
Luckily GitHub has their release system, for how to create releases see instructions here
Thanks, and have a great day!
Hi
I'm using st-sixel (https://github.com/galatolofederico/st-sixel) which lsix doesn't realise has sixel capabilities. I got lsix working on it by brute force (setting hassixel=yup) but I don't the clever (correct) way to do this.
Hope you're able to help
Ta
On certain files, running lsix
will still display the image but with an error message:
montage: delegate library support not built-in 'glasses.png' (XML) @ warning/profile.c/ValidateXMPProfile/1945.
How can I get rid of this error message, or at least suppress it?
Hi, I put the file in /usr/local/bin, and it show the error that permission denied. I used this in Mac.
Using xterm on NetBSD 9.0_STABLE. I've set .Xresources to read XTerm*decTerminalID: vt340
lsix was placed in /usr/bin as there is no /usr/local on this system. ImageMagick is also installed.
xterm recognized the script and outputs the error Error: Your terminal does not report having sixel graphics support
Hi,
First of all, I'm aware there already was a (now closed) issue about vim support previously, I am relatively new to github, so I was unsure if I should comment on the closed issue or open a new one.
Closed issue: issues/21
Neovim currently has some plugins which allow images to be displayed, like hologram.nvim.
hologram.nvim mentions potential support for sixel graphics down the road.
Does the existence of such plugins make it possible for lsix to work inside neovims terminal in the future?
yaft is a framebuffer terminal with sixel support: https://github.com/uobikiemukot/yaft
"convert foo.jpg -geometry 800x480 sixel:-" does work in yaft.
But lsix says "Error: Your terminal does not report having sixel graphics support."
Hello,
I have a problem since formatting my PC, lsix no longer works whereas before, it worked fine (with the Guake terminal)
I have this message displayed:
Error: Your terminal does not report having sixel graphics support.
Please use a sixel capable terminal, such as xterm -ti vt340, or
ask your terminal manufacturer to add sixel support.
You may test your terminal by viewing a single image, like so:
convert foo.jpg -geometry 800x480 sixel:-
If your terminal actually does support sixel, please file a bug
report at http://github.com/hackerb9/lsix/issues
Please mention device attribute codes: ^[[?65;1;9c
I did the test with xtem, the images are displayed. For convert, in guake, no return. In xterm my image is displayed.
thank you for helping me
Hi! this looks great but I'm running native Wayland using Sway. Do you have any plans to support Wayland? If I wanted to implement that myself, where would I look?
When i run this i get an error saying that the commands mapfile
, montage
, convert
.
hope it is possible to fix this
There is a check for gif images to only draw the first frame if no filename is given. Other animated formats such as webp fall through the cracks.
The attribute code seems to have changed for alacritty-sixel from #55's ^[[?4;6c
to simply ^[[?6c
or I might be doing something funny..
Following is debug info:
╰─ $ lsix *.png
+ numcolors=16
+ background=white
+ foreground=black
+ width=800
+ tilesize=120
+ tilewidth=120
+ tileheight=120
+ fontsize=12
+ [[ 4 -gt 3 ]]
+ timeout=0.25
+ command -v montage
+ trap cleanup SIGINT SIGHUP SIGABRT EXIT
+ main DeepinScreenshot_select-area_20181013011712.png DeepinScreenshot_select-area_20181014150216.png DeepinScreenshot_select-area_20181014150620.png DeepinScreenshot_select-area_20181025221736.png
+ autodetect
+ stty -echo
+ IFS=';'
+ read -a REPLY -s -t 0.25 -d S -p ''
+ [[ '' == \0 ]]
+ [[ xterm-256color =~ mlterm ]]
+ [[ 16 -lt 256 ]]
+ IFS=';'
+ read -a REPLY -s -t 0.25 -d S -p ''
+ [[ '' == \0 ]]
+ IFS=';:/'
+ read -a REPLY -r -s -t 0.25 -d '\' -p '\'
\+ [[ rgb =~ ^rgb ]]
+ background='#000000000000'
+ IFS=';:/'
+ read -a REPLY -r -s -t 0.25 -d '\' -p '\'
\+ [[ '' =~ ^rgb ]]
+ IFS=';'
+ read -a REPLY -s -t 0.25 -d t -p ''
+ [[ 142 == 0 ]]
+ [[ xterm-256color =~ xterm ]]
+ [[ 800 -ge 1000 ]]
+ tilexspace=3
+ tileyspace=1
+ numtiles=6
+ [[ 4 == 0 ]]
+ resize='[120x120]'
+ imoptions='-tile 6x1'
+ imoptions+=' -geometry 120x120>+3+1'
+ imoptions+=' -background #000000000000 -fill black'
+ imoptions+=' -auto-orient '
+ [[ 16 -gt 16 ]]
+ [[ -n '' ]]
+ [[ -n 12 ]]
+ imoptions+=' -pointsize 12 '
+ '[' 4 -gt 0 ']'
+ onerow=()
+ goal=-2
+ '[' 4 -gt 0 -a 4 -gt -2 ']'
+ len=0
+ onerow[len++]=-label
++ processlabel DeepinScreenshot_select-area_20181013011712.png
++ span=15
++ echo -n DeepinScreenshot_select-area_20181013011712.png
++ sed 's|\[0]$||;'
++ tr '[:cntrl:]' '?'
++ awk -v span=15 -v ORS= '
function halve(s, l,h) { # l and h are locals
l=length(s); h=int(l/2);
if (l <= span) { return s; }
return halve(substr(s, 1, h)) "\n" halve(substr(s, h+1));
}
{
if ( length($0) > span ) gsub(/\..?.?.?.?$/, "");
print halve($0);
}
++ sed 's|%|%%|g; s|\\|\\\\|g; s|@|\\@|g;'
'
+ onerow[len++]='DeepinScre
enshot_sele
ct-area_201
81013011712'
+ onerow[len++]=DeepinScreenshot_select-area_20181013011712.png
+ shift
+ '[' 3 -gt 0 -a 3 -gt -2 ']'
+ len=3
+ onerow[len++]=-label
++ processlabel DeepinScreenshot_select-area_20181014150216.png
++ span=15
++ echo -n DeepinScreenshot_select-area_20181014150216.png
++ sed 's|\[0]$||;'
++ tr '[:cntrl:]' '?'
++ awk -v span=15 -v ORS= '
function halve(s, l,h) { # l and h are locals
l=length(s); h=int(l/2);
if (l <= span) { return s; }
return halve(substr(s, 1, h)) "\n" halve(substr(s, h+1));
}
{
if ( length($0) > span ) gsub(/\..?.?.?.?$/, "");
print halve($0);
}
++ sed 's|%|%%|g; s|\\|\\\\|g; s|@|\\@|g;'
'
+ onerow[len++]='DeepinScre
enshot_sele
ct-area_201
81014150216'
+ onerow[len++]=DeepinScreenshot_select-area_20181014150216.png
+ shift
+ '[' 2 -gt 0 -a 2 -gt -2 ']'
+ len=6
+ onerow[len++]=-label
++ processlabel DeepinScreenshot_select-area_20181014150620.png
++ span=15
++ echo -n DeepinScreenshot_select-area_20181014150620.png
++ sed 's|\[0]$||;'
++ tr '[:cntrl:]' '?'
++ awk -v span=15 -v ORS= '
function halve(s, l,h) { # l and h are locals
l=length(s); h=int(l/2);
if (l <= span) { return s; }
return halve(substr(s, 1, h)) "\n" halve(substr(s, h+1));
}
{
if ( length($0) > span ) gsub(/\..?.?.?.?$/, "");
print halve($0);
}
'
++ sed 's|%|%%|g; s|\\|\\\\|g; s|@|\\@|g;'
+ onerow[len++]='DeepinScre
enshot_sele
ct-area_201
81014150620'
+ onerow[len++]=DeepinScreenshot_select-area_20181014150620.png
+ shift
+ '[' 1 -gt 0 -a 1 -gt -2 ']'
+ len=9
+ onerow[len++]=-label
++ processlabel DeepinScreenshot_select-area_20181025221736.png
++ span=15
++ echo -n DeepinScreenshot_select-area_20181025221736.png
++ sed 's|\[0]$||;'
++ tr '[:cntrl:]' '?'
++ awk -v span=15 -v ORS= '
function halve(s, l,h) { # l and h are locals
l=length(s); h=int(l/2);
if (l <= span) { return s; }
return halve(substr(s, 1, h)) "\n" halve(substr(s, h+1));
}
{
if ( length($0) > span ) gsub(/\..?.?.?.?$/, "");
print halve($0);
}
'
++ sed 's|%|%%|g; s|\\|\\\\|g; s|@|\\@|g;'
+ onerow[len++]='DeepinScre
enshot_sele
ct-area_201
81025221736'
+ onerow[len++]=DeepinScreenshot_select-area_20181025221736.png
+ shift
+ '[' 0 -gt 0 -a 0 -gt -2 ']'
+ convert - -colors 16 sixel:-
+ montage -label 'DeepinScre
enshot_sele
ct-area_201
81013011712' DeepinScreenshot_select-area_20181013011712.png -label 'DeepinScre
enshot_sele
ct-area_201
81014150216' DeepinScreenshot_select-area_20181014150216.png -label 'DeepinScre
enshot_sele
ct-area_201
81014150620' DeepinScreenshot_select-area_20181014150620.png -label 'DeepinScre
enshot_sele
ct-area_201
81025221736' DeepinScreenshot_select-area_20181025221736.png -tile 6x1 -geometry '120x120>+3+1' -background '#000000000000' -fill black -auto-orient -pointsize 12 gif:-
+ '[' 0 -gt 0 ']'
+ read -s -t 60 -d c -p ''
+ cleanup
+ echo -n ''
+ stty echo
+ exit 0
Thanks
Arch linux + Gnome 3 + Xorg
Can you please tag this with a version number so Homebrew can pull it?
Currently lsix displays labels if I don't want to. Would be nice to add a flag like --no-labels
to remove them so I'll see images only
Hi,
I really like your little tool, and I'm surprised that a shell script is sufficient for that (with help of ImageMagick).
I'd like you to consider adding hyperlink (OSC 8) support so the generated previews are clickable. This would be a great addition, what do you think?
The script doesn't deal well with filenames that have spaces in them.
eg, I have a file named Bitbucket errors.png
in the current directory...
$ lsix *.png
montage: unable to open image 'Bitbucket': No such file or directory @ error/blob.c/OpenBlob/3537.
montage: no decode delegate for this image format `' @ error/constitute.c/ReadImage/572.
montage: unable to open image 'errors.png': No such file or directory @ error/blob.c/OpenBlob/3537.
montage: unable to open image 'errors.png': No such file or directory @ error/blob.c/OpenBlob/3537.
montage: unable to open image 'climbing': No such file or directory @ error/blob.c/OpenBlob/3537.
montage: unable to open image 'climbing': No such file or directory @ error/blob.c/OpenBlob/3537.
montage: no decode delegate for this image format `' @ error/constitute.c/ReadImage/572.
montage: unable to open image 'cynefin': No such file or directory @ error/blob.c/OpenBlob/3537.
montage: unable to open image 'cynefin': No such file or directory @ error/blob.c/OpenBlob/3537.
montage: no decode delegate for this image format `' @ error/constitute.c/ReadImage/572.
montage: unable to open image '7.png': No such file or directory @ error/blob.c/OpenBlob/3537.
montage: unable to open image '7.png': No such file or directory @ error/blob.c/OpenBlob/3537.
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.
Alacritty is getting support soon it seems, and there is already work available for installation.
For example https://github.com/microo8/alacritty-sixel
I tested it out and the convert example works as expected. lsix however still displays an error.
Attribute code in error message: ^[[?4;6c
.
I had to install webp, but imagemagic needs to be there, of course, and I had that. It still doesn't work on the default terminal on Linux Mint Cinnamon, showing some escape sequences and errors. I'm entering this because I think it would be a good idea to check for the binaries this depends on.
While this is likely true, it would be great to see WSL support and maybe someone has figured it out. Thanks
Error: Your terminal does not appear to support sixel graphics.
Please use a sixel capable terminal, such as xterm -ti vt340, or
ask your terminal manufacturer to add sixel support.
If your terminal actually does support sixel, please file a bug
report at http://github.com/hackerb9/lsix/issues
Thank you for making this project.
I am on Ubuntu 20.04 platform. When I run ./lsix
in sixel
supported terminal, I get the following errors:
montage-im6.q16: unable to open image `file://contents.png': No such file or directory @ error/blob.c/OpenBlob/2874.
montage-im6.q16: unable to open image `file://test.png': No such file or directory @ error/blob.c/OpenBlob/2874.
montage-im6.q16: unable to open image `file://test.png': No such file or directory @ error/blob.c/OpenBlob/2874.
montage-im6.q16: missing an image filename `gif:-' @ error/montage.c/MontageImageCommand/1795.
convert-im6.q16: no decode delegate for this image format `' @ error/constitute.c/ReadImage/560.
convert-im6.q16: no images defined `sixel:-' @ error/convert.c/ConvertImageCommand/3258.
I use this patch rxvt-unicode-sixel.patch which adds sixel support for rxvt-unicode.
But when I try to use lsix
it will silently crash. I do not get a warning or anything. With unpatched rxvt-unicode it will give me a warning that the terminal emulator is not supported but now when it is patched it just silently die.
When I use lsix
, I would expect the images to display after my current line, and for that display to be persistent. That's not what happens. The images show up at the top of my terminal, one line at a time, "over" the text that exists there, and then disappears, leaving the terminal intact (i.e. it does not replace the text, it just displays the images like an overlay above the text).
Is this due to lsix
, or is it due to my terminal?
I'm using wsltty 1.8.4 on Windows 10.
iterm2 does not detect terminal size, tiles are too small and too few per row.
On Ubuntu 21.1, st (Siduck76's version sixel branch), I have used the example command to test my terminal, and it shows the image! After trying to use sixel, the command fails. Any ideas as to why this happens?
After installed xterm and ImageMagick, lsix shows nothing about thumnail images. Anything I can do about this?
Thanks!
please package your code as a homebrew cask and provide installation instructions.
Is there any way to scroll thumbnails one page at a time? If I try to pipe lsix output through more
or less
there is just garbage, not too surprising I guess.
If you run :terminal
in vim, you get what seems to be a fully-functional terminal, though lsix
claims it won't work. echo $TERM
reports xterm-256color
. I've tested this in xterm
where lsix
otherwise works.
I get the same issue in guake
directly, though that's likely a separate issue.
As described in title
What's the fastest sixel viewer?
Impossible?
hello and thanks for the project.
is it possible to set the montaged gallery background to transparent color? I tried setting montage "${onerow[@]}" $imoptions -background none gif:- | convert - -background 'rgba(0,0,0,0)' sixel:-
but it doesn't seem to work. Does sixel not support viewing transparent background or what could be wrong?
Since KDE is widely used and therefore also konsole
, maybe it's worth adding it in the docs to the supported terminals.
When used with foot, window dimensions in lsix
can be set as following:
window_width=$(swaymsg -t get_tree | jq -r '.. | (.nodes? // empty)[] | select(.'focused' and .pid) | "\(.rect.width)"')
window_height=$(swaymsg -t get_tree | jq -r '.. | (.nodes? // empty)[] | select(.'focused' and .pid) | "\(.rect.height)"')
width=$window_width
iTerm2 has now sixel support gnachman/iTerm2@0d0003d.
This script should be checked if it supports this terminal too.
I personally don't have access to an Apple system.
Lsix still not working for me on Fedora, even using xterm -ti vt340
command.
Originally posted by @bkdwt in #27 (comment)
Testing with 'brew install lsix' and 'brew install iterm2' on latest MacOS (Darwin 20.5.0) shows that it works, but with errors.
'''
/opt/homebrew/bin/lsix: line 205: realpath: command not found
Unable to revert mtime: /Library/Fonts
'''
Also font errors?
montage: unable to read font `helvetica' @ error/annotate.c/RenderFreetype/1383. Y\xM]Y\UYXuiCWG@I?C#1!6?G?CG??C!4?g??O?G_#2!13?o!5?GOCBwUXq?ISHG?G?AoOcGA?iU?R_AoLa?G?OAG@@A???@C??gFpcOcIb???KNGvzvA_A?z]~sCg_~L~Kx_??ZdyHQPGogS@?o~PuFk
Imagemagick version: 7.0.8
Fish version: 3.0.1
OS: Android 6.0 armv7l (Termux)
Kernel: 3.18.19
I'm fairly certain that you've got the DECSDM
mode backwards. I think it is XTerm that has implemented it incorrectly, and MLterm that has it the right way around. CSI ?80l
should enable sixel scrolling, and CSI ?80h
should disable it.
Other terminals that match MLterm's behaviour include RLogin (you can see the source here), Tanasinn (see here), and WRQ Reflection (it's a commercial app, but you can see the documentation describing the behaviour of DECSDM
here).
I suspect the misunderstanding came about because the VT330/340 manual documented DECSDM
the way XTerm has currently implemented it, but I believe that was a mistake. The various VT382 manuals have it the other way around. See here, and here.
The author of Tera Term, who has a collection of DEC terminals, actually tested this on a VT330 and VT382 and reported the results here: https://twitter.com/ttdoda/status/479053314412126208
According to Google translate:
The actual machine and manual of VT382 and the actual machine of VT330 are DECSDM reset and sixel scrolling mode is enabled.
Which I understand to mean that sixel scrolling mode is enabled when DECSDM
is reset.
Now I guess it's possible that everyone else is wrong about this, and XTerm is right, but all the evidence appears to point in the other direction.
I downloaded lsix to my /usr/local/bin folder and I'm able to run the command but it returns with gibberish.
What could I be doing wrong?
(Newbie to lsix/ tmux: I tried searching for tmux and screen before filing this - Please, let me know if this is already discussed)
When I ssh into my box, the terminal identifies itself as xterm and I can run lsix.
However, when I start tmux, lsix seems to stop working. Is it because tmux actually runs a different terminal which does not support sixel or is it just some identification issue? I keep having to step out of tmux to view the image, and then back again. Am I missing something?
And thanks for the program!
GNOME Terminal
Version 3.51.0 for GNOME 46
Using VTE version 0.75.0 +BIDI +GNUTLS +ICU +SIXEL +SYSTEMD
But lsix still not working despite vte provides sixel support as you can see above.
Error: Your terminal does not report having sixel graphics support.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.