diff --git a/neofetch b/neofetch index 15eed8ac..5bd1203e 100755 --- a/neofetch +++ b/neofetch @@ -3686,13 +3686,8 @@ get_term_size() { term_width="${term_size[2]/t*}" fi - # If the sequences above don't work and the user is on a macOS system - # or a system not running an X server, return early. - [[ -z "$DISPLAY" ]] && \ - { term_width=0; return; } - # Get terminal width/height if \e[14t is unsupported. - if [[ -z "$term_width" ]] || (( "$term_width" < 50 )); then + if (( "${term_width:-0}" < 50 )) && [[ "$DISPLAY" && "$os" != "Mac OS X" ]]; then if type -p xdotool >/dev/null 2>&1; then current_window="$(xdotool getactivewindow)" source <(xdotool getwindowgeometry --shell "$current_window") @@ -3715,13 +3710,11 @@ get_term_size() { awk -F ': ' '/Width|Height/ {printf $2 " "}')" term_width="${term_size/ *}" term_height="${term_size/${term_width}}" - else - term_width=0 fi - else - term_width=0 fi fi + + term_width="${term_width:-0}" } get_image_size() {