Use setsid

This commit is contained in:
krisdoodle45 2021-10-14 20:47:33 +02:00 committed by GitHub
parent 6faae93d15
commit 40af3ab992
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,7 +2,4 @@
# Open a terminal window in the same directory as the currently active window.
PID=$(xprop -id "$(xprop -root | awk '/_NET_ACTIVE_WINDOW\(WINDOW\)/{print $NF}')" | grep -m 1 PID | cut -d " " -f 3)
PID="$(pstree -lpA "$PID" | tail -n 1 | awk -F'---' '{print $NF}' | sed -re 's/[^0-9]//g')"
cd "$(readlink /proc/"$PID"/cwd)" || return 1
"$TERMINAL"
setsid -f $TERMINAL >/dev/null 2>&1