Commit 01a5c7da authored by Dylan Araps's avatar Dylan Araps Committed by GitHub

Merge pull request #742 from konimex/terminal

Term: Break from loop if PPID can't be accessed/not found
parents ab1e05ad c7c84fcb
...@@ -1652,6 +1652,7 @@ get_term() { ...@@ -1652,6 +1652,7 @@ get_term() {
term="$SSH_TTY" term="$SSH_TTY"
else else
parent="$(get_ppid "$parent")" parent="$(get_ppid "$parent")"
[[ -z "$parent" ]] && break
name="$(get_process_name "$parent")" name="$(get_process_name "$parent")"
case "${name// }" in case "${name// }" in
"${SHELL/*\/}" | *"sh" | "tmux"* | "screen" | "su"*) ;; "${SHELL/*\/}" | *"sh" | "tmux"* | "screen" | "su"*) ;;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment