Rollback without PID Check

This commit is contained in:
Takeya Yuki 2017-05-20 22:17:56 +09:00
parent 60f5009cf8
commit df6dab1721

View file

@ -1640,14 +1640,14 @@ get_term() {
esac
# Check $PPID for terminal emulator.
while [[ -z "$term" ]] || ((parent>1)); do
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)";break ;;
"login"* | *"Login"* | "init" | "(init)") term="$(tty)" ;;
"ruby" | "1" | "systemd" | "sshd"* | "python"* | "USER"*"PID"*) break ;;
"gnome-terminal-") term="gnome-terminal";break ;;
"gnome-terminal-") term="gnome-terminal" ;;
*) term="${name##*/}" ;;
esac
done