-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: ImageMagick handling #74
Conversation
sammcj
commented
Jun 7, 2024
•
edited
Loading
edited
- Fixes Installed a fresh lsix on macOS with homebrew, got a IMv7 warning #71
- Improves comparison logic
- Linting
I tested it and this fixes #71 👍🏼 |
lsix
Outdated
@@ -133,7 +133,7 @@ autodetect() { | |||
# Attempt to set the number of colors to 256. | |||
# This will work for xterm, but fail on a real vt340. | |||
IFS=";" read -a REPLY -s -t ${timeout} -d "S" -p $'\e[?1;3;256S' >&2 | |||
[[ ${REPLY[1]} == "0" ]] && numcolors=${REPLY[2]} | |||
[[ ${REPLY[1]} == "0" && ${REPLY[2]} -gt 0 ]] && numcolors=${REPLY[2]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What terminal requires this change?
lsix
Outdated
| convert - -colors $numcolors sixel:- | ||
done | ||
# Create and display montages one row at a time. | ||
while [ $# -gt 0 ]; do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What was the purpose of changing the indentation?
lsix
Outdated
|
||
# Note: The 'montage' command is not affected by this change, so it remains the same. | ||
montage "${onerow[@]}" $imoptions gif:- \ | ||
| magick - -colors $numcolors sixel:- # Convert to magick here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would fail on a system with ImageMagick 6 which does not have a Magick command.
#fontsize=16 # (or set the point size directly, if you prefer) | ||
|
||
timeout=0.25 # How long to wait for terminal to respond | ||
# to a control sequence (in seconds). | ||
timeout=0.25 # How long to wait for terminal to respond |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not understand why you would want to reindent comments in this way.
fi | ||
|
||
# SIXEL SCROLLING (~DECSDM) is now presumed to be enabled. | ||
# See https://github.com/hackerb9/lsix/issues/41 for details. | ||
|
||
# TERMINAL COLOR AUTODETECTION. | ||
# Find out how many color registers the terminal has | ||
IFS=";" read -a REPLY -s -t ${timeout} -d "S" -p $'\e[?1;1;0S' >&2 | ||
IFS=";" read -a REPLY -s -t ${timeout} -d "S" -p $'\e[?1;1;0S' >&2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please explain to me what you were thinking when you made this change? Multiple spaces helps separate the environment from the command. Why change it?
I appreciate the work you put in to make |