mirror of
https://github.com/notwa/rc
synced 2024-11-05 06:39:02 -08:00
17 lines
437 B
Bash
Executable file
17 lines
437 B
Bash
Executable file
#!/usr/bin/env zsh
|
|
# YES_ZSH
|
|
# NO_BASH
|
|
# NO_DASH
|
|
|
|
unscreen() { ### @-
|
|
### handle closing of screens — this works alongside [`screeny`](#screeny).
|
|
### these days, i typically use tmux instead.
|
|
local pids="$(screen -ls | fgrep "$1" | cut -d. -f1)"
|
|
for pid in $=pids; do
|
|
local ppid="$(ps h --ppid "$pid" -o pid)"
|
|
kill $=ppid || return 1
|
|
done
|
|
return 0
|
|
}
|
|
|
|
[ "${SOURCING:-0}" -gt 0 ] || unscreen "$@"
|