From 6888571eea216186b02de6ef216f027965170a54 Mon Sep 17 00:00:00 2001 From: Martinez Date: Sun, 1 Oct 2017 01:19:07 +0200 Subject: [PATCH] voids do not collapse until all processes leave --- dotfiles/system/etc/zsh/zshrc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/dotfiles/system/etc/zsh/zshrc b/dotfiles/system/etc/zsh/zshrc index 4f9b234..ac7ff27 100644 --- a/dotfiles/system/etc/zsh/zshrc +++ b/dotfiles/system/etc/zsh/zshrc @@ -132,6 +132,17 @@ function mkvoid () { pushd "${__MKVOID_PATH}" > /dev/null || die "pushd" OVER_PROMPT_VOIDS="$OVER_PROMPT_VOIDS:$__MKVOID_NAME" zsh popd > /dev/null + + while true; do + fuser -s "${__MKVOID_PATH}" + if [[ $? == 1 ]]; then + break + else + echo -n ">>> Waiting for other processes to abandon this void.\r" + fi + sleep 5 + done + rm -f "${__MKVOID_PATH}" || die "rm link" rm -rf "${__MKVOID_ID}" || die "rm void" }