Terminal: Disable terminal detection if device is connected over SSH
This commit is contained in:
parent
56fa0a566e
commit
6762381a82
1 changed files with 13 additions and 9 deletions
22
neofetch
22
neofetch
|
@ -1648,15 +1648,19 @@ get_term() {
|
|||
|
||||
# Check $PPID for terminal emulator.
|
||||
while [[ -z "$term" ]]; do
|
||||
parent="$(get_ppid "$parent")"
|
||||
name="$(get_process_name "$parent")"
|
||||
case "${name// }" in
|
||||
"${SHELL/*\/}" | *"sh" | "tmux"* | "screen" | "su"*) ;;
|
||||
"login"* | *"Login"* | "init" | "(init)") term="$(tty)" ;;
|
||||
"ruby" | "1" | "systemd" | "sshd"* | "python"* | "USER"*"PID"*) break ;;
|
||||
"gnome-terminal-") term="gnome-terminal" ;;
|
||||
*) term="${name##*/}" ;;
|
||||
esac
|
||||
if [[ "$SSH_CONNECTION" ]]; then
|
||||
term="$SSH_TTY"
|
||||
else
|
||||
parent="$(get_ppid "$parent")"
|
||||
name="$(get_process_name "$parent")"
|
||||
case "${name// }" in
|
||||
"${SHELL/*\/}" | *"sh" | "tmux"* | "screen" | "su"*) ;;
|
||||
"login"* | *"Login"* | "init" | "(init)") term="$(tty)" ;;
|
||||
"ruby" | "1" | "systemd" | "sshd"* | "python"* | "USER"*"PID"*) break ;;
|
||||
"gnome-terminal-") term="gnome-terminal" ;;
|
||||
*) term="${name##*/}" ;;
|
||||
esac
|
||||
fi
|
||||
done
|
||||
|
||||
# Log that the function was run.
|
||||
|
|
Loading…
Reference in a new issue