~xdavidwu/dotfiles

03bb1db8d0a5f9e84e3a431153dda837354c3057 — xdavidwu 2 years ago 3b18813
bash: imgcat: fix when IFS does not contain space
1 files changed, 5 insertions(+), 3 deletions(-)

M .bashrc
M .bashrc => .bashrc +5 -3
@@ 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
}