Skip to content

Commit bd8e6b1

Browse files
committed
Added kludge for mlterm which can display SIXEL, but does not report
back the number of colors supported in the same way as xterm. For now, just presuming max numcolors=1024.
1 parent ff88168 commit bd8e6b1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lsix

+4-1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ autodetect() {
6262
IFS=";" read -a REPLY -s -t ${timeout} -d "S" -p $'\e[?1;1;0S' >&2
6363
[[ ${REPLY[1]} == "0" ]] && numcolors=${REPLY[2]}
6464

65+
# BUG WORKAROUND: mlterm does not report number of colors.
66+
if [[ $TERM =~ mlterm ]]; then numcolors=1024; fi
67+
6568
# Increase colors, if needed
6669
if [[ $numcolors -lt 256 ]]; then
6770
# Attempt to set the number of colors to 256.
@@ -97,7 +100,7 @@ autodetect() {
97100

98101
# BUG WORKAROUND: XTerm cannot show images wider than 1000px.
99102
# Remove this hack once XTerm gets fixed. Last checked: XTerm(327)
100-
if [[ $width -ge 1000 ]]; then width=1000; fi
103+
if [[ $TERM =~ xterm && $width -ge 1000 ]]; then width=1000; fi
101104

102105
# Space on either side of each tile is less than 0.5% of total screen width
103106
tilexspace=$((width/201))

0 commit comments

Comments
 (0)