about summary refs log tree commit diff stats
path: root/baremetal/shell/main.mu
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-02-20 22:45:10 -0800
committerKartik K. Agaram <vc@akkartik.com>2021-02-20 22:45:35 -0800
commitcf5c8bc6b0e880a312a304a13712dce2b206c3c7 (patch)
tree609df0a156934531d97b6929ae1f47a80959cbd2 /baremetal/shell/main.mu
parent684c09620304457825981eaaaf7af8af2dc64d15 (diff)
downloadmu-cf5c8bc6b0e880a312a304a13712dce2b206c3c7.tar.gz
7762 - baremetal/shell: backspace
The text buffer can now shrink, which means we need to be careful to erase
the old location of the cursor. Just clear screen before render each time.
Which means we need to be more efficient with our rendering.
Diffstat (limited to 'baremetal/shell/main.mu')
-rw-r--r--baremetal/shell/main.mu12
1 files changed, 7 insertions, 5 deletions
diff --git a/baremetal/shell/main.mu b/baremetal/shell/main.mu
index ee2dda60..262b9829 100644
--- a/baremetal/shell/main.mu
+++ b/baremetal/shell/main.mu
@@ -7,11 +7,13 @@ fn main {
   initialize-sandbox sandbox
   {
     render-sandbox 0/screen, sandbox, 2/x, 2/y
-    var key/eax: byte <- read-key 0/keyboard
-    compare key, 0
-    loop-if-=
-    # no way to quit right now; just reboot
-    edit-sandbox sandbox, key
+    {
+      var key/eax: byte <- read-key 0/keyboard
+      compare key, 0
+      loop-if-=
+      # no way to quit right now; just reboot
+      edit-sandbox sandbox, key
+    }
     loop
   }
 }