Skip to content

Commit

Permalink
Only fall back to TERMUX_VERSION if ppid doesn't match
Browse files Browse the repository at this point in the history
Catches something like running xfce4-terminal in an X server
  • Loading branch information
easyaspi314 committed Sep 29, 2021
1 parent da1970e commit c4630ee
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion neofetch
Original file line number Diff line number Diff line change
Expand Up @@ -3292,7 +3292,6 @@ get_term() {
[[ "$TERM" == "tw52" || "$TERM" == "tw100" ]] && term="TosWin2"
[[ "$SSH_CONNECTION" ]] && term="$SSH_TTY"
[[ "$WT_SESSION" ]] && term="Windows Terminal"
[[ "$TERMUX_VERSION" ]] && term="Termux ${TERMUX_VERSION}"

# Check $PPID for terminal emulator.
while [[ -z "$term" ]]; do
Expand Down Expand Up @@ -3332,6 +3331,10 @@ get_term() {
esac
done

# Termux sets TERMUX_VERSION. Put this after the PPID check because this is
# also set if using a terminal on an X server.
[[ -z "$term" && "$TERMUX_VERSION" ]] && term="Termux ${TERMUX_VERSION}"

# Log that the function was run.
term_run=1
}
Expand Down

0 comments on commit c4630ee

Please sign in to comment.