File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change 55
66# Requirements: just ImageMagick (and a Sixel terminal, of course)
77
8- # Version 1.6.1
8+ # Version 1.6.2
99# B9 December 2018
1010
1111# See end of file for USAGE.
@@ -61,12 +61,27 @@ autodetect() {
6161 # Don't show escape sequences the terminal doesn't understand.
6262 stty -echo # Hush-a Mandara Ni Pari
6363
64+ # IS TERMINAL SIXEL CAPABLE?
65+ read -s -t 1 -d " c" -p $' \e [c' >&2 # Send Device Attributes
66+ if ! [[ $REPLY =~ " ;4;" ]]; then
67+ cat << -EOF >&2
68+ Error: Your terminal does not appear to support sixel graphics.
69+
70+ Please use a sixel capable terminal, such as xterm -ti vt340, or
71+ ask your terminal manufacturer to add sixel support.
72+
73+ If your terminal actually does support sixel, please file a bug
74+ report at http://github.com/hackerb9/lsix/issues
75+ EOF
76+ exit 1
77+ fi
78+
6479 # TERMINAL COLOR AUTODETECTION.
6580 # Find out how many color registers the terminal has
6681 IFS=" ;" read -a REPLY -s -t ${timeout} -d " S" -p $' \e [?1;1;0S' >&2
6782 [[ ${REPLY[1]} == " 0" ]] && numcolors=${REPLY[2]}
6883
69- # BUG WORKAROUND : mlterm does not report number of colors.
84+ # Bug workaround : mlterm does not report number of colors.
7085 if [[ $TERM =~ mlterm ]]; then numcolors=1024; fi
7186
7287 # Increase colors, if needed
You can’t perform that action at this time.
0 commit comments