osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-dev/+/27037 )
Change subject: net: run.sh: fix infinite "q Enter to close" msgs ......................................................................
net: run.sh: fix infinite "q Enter to close" msgs
Fix the logic that is supposed to display a "q Enter to close" message once and wait for user input, in case one of the Osmocom programs crashed.
Explicitly read from /dev/tty, as it may not be connected as default stdin anymore at this point. This happens when using the new code paths with tmux as terminal, but also happened before recent refactorings for me with all terminals.
Related: https://media.ccc.de/v/osmodevcall-20211210-osmith-osmo-dev-ttcn3#t=801 Change-Id: Iebb799493f76fd57f24b15c998ded2bd8e284e6b --- M net/templates/run.sh 1 file changed, 1 insertion(+), 1 deletion(-)
Approvals: osmith: Looks good to me, approved; Verified
diff --git a/net/templates/run.sh b/net/templates/run.sh index 1d78db5..64419a6 100755 --- a/net/templates/run.sh +++ b/net/templates/run.sh @@ -118,7 +118,7 @@
while true; do echo 'q Enter to close' - read q_to_close + read q_to_close < /dev/tty if [ "x$q_to_close" = xq ]; then break fi