Allow doing actions on "w" end.

This commit is contained in:
bʰedoh₂ swé 2025-01-12 04:11:53 +05:00
parent 66eb152cfc
commit b9b47c7741

View File

@ -73,6 +73,19 @@ print_messages() {
close_socket close_socket
} }
wait_for_messages() {
oldlength="${length}"
while :; do
length="$(get_message 1)"
if [ "${oldlength}" -ne "${length}" ]; then
break
fi
echo -n .
sleep 1
done
echo
}
length=0 length=0
while :; do while :; do
read cmd read cmd
@ -101,17 +114,11 @@ while :; do
echo "${length}" echo "${length}"
;; ;;
w) w)
oldlength="${length}" wait_for_messages
while :; do
length="$(get_message 1)"
if [ "${oldlength}" -ne "${length}" ]; then
break
fi
echo -n .
sleep 1
done
echo
print_messages "${length}" print_messages "${length}"
if [ -n "${DOBROHO_VECHORA_ON_WAIT}" ]; then
${DOBROHO_VECHORA_ON_WAIT}
fi
;; ;;
p) p)
length="$(get_message 1)" length="$(get_message 1)"