Browse files

catimg: fix exit without using source

supresses errors from convert whilen converting, as they
are usually just warnings
  • Loading branch information...
1 parent 349fa15 commit 44b23ae194a1580a6af6d692e4ba268d61828929 @posva committed Dec 9, 2013
Showing with 2 additions and 2 deletions.
  1. +1 −1 plugins/catimg/catimg.plugin.zsh
  2. +1 −1 plugins/catimg/
@@ -9,7 +9,7 @@
if [[ -x `which convert` ]]; then

bric3 Feb 23, 2014

At the time this test is executed by ZSH, my PATH is not yet completely set, hence it doesn't see the convert binary from ImageMagick. Which means each time a new shell is created, I get the warning about missing ImageMagick.

Ideally this check could be embedded in the function, and echo the warning at use time.


posva Feb 23, 2014


@bric3 You're totally right, I'll fix this. Thank You
I still don't know if the fact that there are 3-4 commits makes a difference

function catimg() {
- source $ZSH/plugins/catimg/ $@
+ zsh $ZSH/plugins/catimg/ $@
echo "catimg need convert (ImageMagick) to work)"
@@ -59,7 +59,7 @@ fi
# Display the image
-convert "$IMG" -resize $COLS\> +dither `echo $REMAP` txt:- |
+convert "$IMG" -resize $COLS\> +dither `echo $REMAP` txt:- 2>/dev/null |
sed -e 's/.*none.*/NO NO NO/g' -e '1d;s/^.*(\(.*\)[,)].*$/\1/g;y/,/ /' |
while read R G B f; do
if [ ! "$R" = "NO" ]; then

0 comments on commit 44b23ae

Please sign in to comment.