#!/usr/bin/env zsh # YES_ZSH unscreen() { 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 "$@"