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
}
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
while :; do
read cmd
@ -101,17 +114,11 @@ while :; do
echo "${length}"
;;
w)
oldlength="${length}"
while :; do
length="$(get_message 1)"
if [ "${oldlength}" -ne "${length}" ]; then
break
fi
echo -n .
sleep 1
done
echo
wait_for_messages
print_messages "${length}"
if [ -n "${DOBROHO_VECHORA_ON_WAIT}" ]; then
${DOBROHO_VECHORA_ON_WAIT}
fi
;;
p)
length="$(get_message 1)"