diff --git a/neofetch b/neofetch index 4f29f239..9042bcba 100755 --- a/neofetch +++ b/neofetch @@ -1640,14 +1640,14 @@ get_term() { esac # Check $PPID for terminal emulator. - while [[ -z "$term" ]]; do + while [[ -z "$term" ]] || ((parent>1)); do parent="$(get_ppid "$parent")" name="$(get_process_name "$parent")" case "${name// }" in "${SHELL/*\/}" | *"sh" | "tmux"* | "screen" | "su"*) ;; - "login"* | *"Login"* | "init" | "(init)") term="$(tty)" ;; + "login"* | *"Login"* | "init" | "(init)") term="$(tty)";break ;; "ruby" | "1" | "systemd" | "sshd"* | "python"* | "USER"*"PID"*) break ;; - "gnome-terminal-") term="gnome-terminal" ;; + "gnome-terminal-") term="gnome-terminal";break ;; *) term="${name##*/}" ;; esac done