Merge pull request #740 from konimex/ssh

Terminal: Disable terminal detection if device is connected over SSH
This commit is contained in:
Herdiansyah 2017-06-03 14:06:24 +07:00 committed by GitHub
commit ab1e05adff
2 changed files with 14 additions and 9 deletions

View File

@ -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**

View File

@ -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.