From 80299bd064f9c2873305783cb538b1b14c6d0748 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sat, 19 May 2018 08:06:05 +1000 Subject: [PATCH] macOS: Fix xquartz issue. --- neofetch | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/neofetch b/neofetch index 185d031b..ac80de38 100755 --- a/neofetch +++ b/neofetch @@ -3686,6 +3686,11 @@ 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" || "$os" == "Mac OS X" ]] && \ + { term_width=0; return; } + # Get terminal width/height if \e[14t is unsupported. if [[ -z "$term_width" ]] || (( "$term_width" < 50 )); then if type -p xdotool >/dev/null 2>&1; then