From 03bb1db8d0a5f9e84e3a431153dda837354c3057 Mon Sep 17 00:00:00 2001 From: xdavidwu Date: Fri, 18 Feb 2022 20:08:10 +0800 Subject: [PATCH] bash: imgcat: fix when IFS does not contain space --- .bashrc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.bashrc b/.bashrc index 6348e87..3c89fa8 100644 --- a/.bashrc +++ b/.bashrc @@ -105,11 +105,13 @@ imgcat_max_pixels() { } imgcat() { - EXTRA= MAX=$(imgcat_max_pixels 2>/dev/null) - [ -n "$MAX" ] && EXTRA="-resize ${MAX}>" for i; do - convert "$i" $EXTRA sixel:- + if [ -n "$MAX" ]; then + convert "$i" -resize "${MAX}>" sixel:- + else + convert "$i" sixel:- + fi done } -- 2.43.0