Skip to contentSkip to conversation

Replaced "stty sane" with saved stty settings

PATCH New Andrei Dinu 1 participant 1 message May 28, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Replaced "stty sane" with saved stty settings

stty manual says :

"sane - Resets all modes to reasonable values for interactive terminal use."

But reasonable isn't the most viable solution, because we want to keep the original stty settings before running runqemu. Saving the stty settings and setting them at the end of the runqemu script solves the terminal settings differences after the script ran.

[Yocto #4512]

---
 scripts/runqemu-internal |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
scripts/runqemu-internal +10 -1
index d4825d1..4f3ba7b 100755
@@ -104,6 +104,9 @@ fi
 
 NFSRUNNING="false"
 
+#capture original stty values
+ORIG_STTY=$(stty -g)
+
 if [ "$SLIRP_ENABLED" = "yes" ]; then
     KERNEL_NETWORK_CMD=""
     QEMU_TAP_CMD=""
@@ -221,7 +224,11 @@ else
             fi
             # If QEMU crashes or somehow tty properties are not restored
             # after qemu exits, we need to run stty sane
-            stty sane
+            #stty sane
+
+            #instead of using stty sane we set the original stty values
+            stty ${ORIG_STTY}
+
         }
 
 
@@ -589,6 +596,8 @@ if [ "$SLIRP_ENABLED" != "yes" ]; then
         cleanup
 fi
 
+#set the original stty values before exit
+stty ${ORIG_STTY}
 trap - INT TERM QUIT
 
 return $ret
Signature · 1 line
1.7.9.5