about summary refs log tree commit diff stats
path: root/baremetal/rpn.mu
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2021-01-23 08:45:51 -0800
committerKartik Agaram <vc@akkartik.com>2021-01-23 08:45:51 -0800
commit63be7b7d0d5bb6e728d9afbb68e238fcd3bda3a7 (patch)
tree7f26c1430c53e0aec3cbe889bf80e70078db8506 /baremetal/rpn.mu
parent0f73127ef1eba0a8ea814c26115523da3590ffe2 (diff)
downloadmu-63be7b7d0d5bb6e728d9afbb68e238fcd3bda3a7.tar.gz
7548 - baremetal: better cursor management
Diffstat (limited to 'baremetal/rpn.mu')
-rw-r--r--baremetal/rpn.mu5
1 files changed, 4 insertions, 1 deletions
diff --git a/baremetal/rpn.mu b/baremetal/rpn.mu
index df894cbc..0944b42b 100644
--- a/baremetal/rpn.mu
+++ b/baremetal/rpn.mu
@@ -26,10 +26,11 @@ fn main -> _/ebx: int {
   {
     # print prompt
     var x/eax: int <- draw-text-rightward 0, "> ", 0, 0x80, y, 3
-    set-cursor-position 0, x, y, space
+    set-cursor-position 0, x, y
     # read line from keyboard
     clear-stream in
     {
+      show-cursor 0, space
       var key/eax: byte <- read-key 0
       compare key, 0xa  # newline
       break-if-=
@@ -42,6 +43,8 @@ fn main -> _/ebx: int {
       cursor-right 0
       loop
     }
+    # clear cursor
+    draw-grapheme-at-cursor 0, space, 3  # 3=foreground color, which is never used
     # parse and eval
     var out/eax: int <- simplify in
     # print