Fix for terminology: does not fallback on ascii when no wallpaper is found

When no image is set and there is no background image (or a `.xml` is detected) and the image option is set to `wall` (default), neofetch does not fallback on ascii mode.
The issue comes from the line 2310:

    if [ ! -f "$img" ] || [ ${#term_size} -le 5 ] && [ "$image_backend" != "tycat" ]; then

as `||` and `&&` have the same priority, bash does not evaluate `[ ${#term_size} -le 5 ] && [ "$image_backend" != "tycat" ]` first.

Solution is simply this

    if [ ! -f "$img" ] || ([ ${#term_size} -le 5 ] && [ "$image_backend" != "tycat" ]); then
This commit is contained in:
Vincent Aranega 2016-06-10 16:47:06 +02:00
parent 913321752d
commit 8334fba313
1 changed files with 1 additions and 1 deletions

View File

@ -2307,7 +2307,7 @@ getimage () {
# If $img isn't a file or the terminal doesn't support xterm escape sequences,
# fallback to ascii mode.
if [ ! -f "$img" ] || [ ${#term_size} -le 5 ] && [ "$image_backend" != "tycat" ]; then
if [ ! -f "$img" ] || ([ ${#term_size} -le 5 ] && [ "$image_backend" != "tycat" ]); then
image="ascii"
getascii