From 093c4b6b2681951a277c71453598a9e0e2a82f52 Mon Sep 17 00:00:00 2001 From: David Lechner Date: Thu, 10 Feb 2022 13:15:14 -0600 Subject: [PATCH] unix/main: Restore tty settings on nlr_jump_fail(). Since nlr_jump_fail() exits the process, it can leave the terminal in raw mode which means characters are not echoed. Fix this by restoring the original terminal mode. Signed-off-by: David Lechner --- ports/unix/main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ports/unix/main.c b/ports/unix/main.c index 0e00db7fa2..e7048dd712 100644 --- a/ports/unix/main.c +++ b/ports/unix/main.c @@ -737,6 +737,9 @@ MP_NOINLINE int main_(int argc, char **argv) { } void nlr_jump_fail(void *val) { + #if MICROPY_USE_READLINE == 1 + mp_hal_stdio_mode_orig(); + #endif fprintf(stderr, "FATAL: uncaught NLR %p\n", val); exit(1); }