Skip to content

Commit

Permalink
Added kludge for mlterm which can display SIXEL, but does not report
Browse files Browse the repository at this point in the history
back the number of colors supported in the same way as xterm.
For now, just presuming max numcolors=1024.
  • Loading branch information
hackerb9 committed Dec 24, 2018
1 parent ff88168 commit bd8e6b1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lsix
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ autodetect() {
IFS=";" read -a REPLY -s -t ${timeout} -d "S" -p $'\e[?1;1;0S' >&2
[[ ${REPLY[1]} == "0" ]] && numcolors=${REPLY[2]}

# BUG WORKAROUND: mlterm does not report number of colors.
if [[ $TERM =~ mlterm ]]; then numcolors=1024; fi

# Increase colors, if needed
if [[ $numcolors -lt 256 ]]; then
# Attempt to set the number of colors to 256.
Expand Down Expand Up @@ -97,7 +100,7 @@ autodetect() {

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

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

0 comments on commit bd8e6b1

Please sign in to comment.