ClangBuiltLinux / boot-utils

Collection of files for booting Linux kernels
26 stars 7 forks source link

`Re-rerun QEMU + gdb` y^M #88

Open nickdesaulniers opened 1 year ago

nickdesaulniers commented 1 year ago

super low priority, but sometimes my prompt gets corrupted when asked to rerun qemu.

I can enter y, but inserts ^M for some reason.

stty icrnl seems to fix this once I quit. Not sure if the below would help, since output from the terminal gets further corrupted it seems...

diff --git a/boot-qemu.py b/boot-qemu.py
index a2efc2481900..4c32598ab3c3 100755
--- a/boot-qemu.py
+++ b/boot-qemu.py
@@ -781,6 +781,9 @@ def launch_qemu(cfg):
                 utils.red("Killing QEMU...")
                 qemu_process.kill()

+            # Sometimes gdb disables icrnl so that at the prompt below, hitting
+            # enter inserts ^M
+            subprocess.run(["stty", "icrnl"])
             answer = input("Re-run QEMU + gdb? [y/n] ")
             if answer.lower() == "n":
                 break