From 6762381a82ebb51667e6883ad7fc03d5f720a7ef Mon Sep 17 00:00:00 2001 From: Muhammad Herdiansyah Date: Fri, 2 Jun 2017 19:22:51 +0700 Subject: [PATCH 1/2] Terminal: Disable terminal detection if device is connected over SSH --- neofetch | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/neofetch b/neofetch index 040226fa..802e43f7 100755 --- a/neofetch +++ b/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. From b355096f4c726907d8849ccd4993885c10ffd58b Mon Sep 17 00:00:00 2001 From: Muhammad Herdiansyah Date: Sat, 3 Jun 2017 13:55:34 +0700 Subject: [PATCH 2/2] docs: changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f09204b8..f58fe482 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,7 @@ - Added font support for mate-terminal. **[@mstraube](https://github.com/mstraube)** - [Termite] Fix font mismatch. **[@MatthewCox](https://github.com/MatthewCox)** +- Use `$SSH_TTY` for terminal detection if machine is connected via SSH. **GPU**