:: commit 12d3dbf7de0a3416bad66737d4e0917ed7c7b6e5

Mintsuki <mintsuki@protonmail.com> — 2026-04-11 23:00

parents: 25ca9eebaa

lib/term: Reset ConOut when falling back from graphical terminal

diff --git a/common/lib/term.c b/common/lib/term.c
index bbc26e16..96f0e220 100644
--- a/common/lib/term.c
+++ b/common/lib/term.c
@@ -225,6 +225,10 @@ static bool dummy_handle(void) {
 }
 
 void term_fallback(void) {
+#if defined (UEFI)
+    int prev_backend = term_backend;
+#endif
+
     term_notready();
 
     terms = ext_mem_alloc(sizeof(void *));
@@ -236,6 +240,9 @@ void term_fallback(void) {
 
 #if defined (UEFI)
     if (!efi_boot_services_exited) {
+        if (prev_backend != FALLBACK && prev_backend != _NOT_READY) {
+            gST->ConOut->Reset(gST->ConOut, true);
+        }
 #endif
 
         // XXX: Ideally we clear the screen, but that gets rid of the BGRT boot logo
tab: 248 wrap: offon