about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-11-01 22:07:40 -0800
committerKartik Agaram <vc@akkartik.com>2020-11-01 22:07:40 -0800
commit34063288c90329f50950806c540fdbfd6f9540f3 (patch)
tree7074c10d6dcc5372023df9c9994c8cda13e2611e
parent10adec2f2112fd6f1a07afefb2248b490b1d5e21 (diff)
downloadmu-34063288c90329f50950806c540fdbfd6f9540f3.tar.gz
7156
-rw-r--r--apps/arith.mu5
-rw-r--r--apps/tile/main.mu4
2 files changed, 6 insertions, 3 deletions
diff --git a/apps/arith.mu b/apps/arith.mu
index b7a7c81d..551753de 100644
--- a/apps/arith.mu
+++ b/apps/arith.mu
@@ -32,6 +32,7 @@
 # Error handling is non-existent. This is just a prototype.
 
 fn main -> exit-status/ebx: int {
+  enable-keyboard-immediate-mode
   var look/esi: grapheme <- copy 0  # lookahead
   var n/eax: int <- copy 0  # result of each expression
   print-string 0, "press ctrl-c or ctrl-d to exit\n"
@@ -50,6 +51,7 @@ fn main -> exit-status/ebx: int {
     #
     loop
   }
+  enable-keyboard-type-mode
   exit-status <- copy 0
 }
 
@@ -244,8 +246,9 @@ fn skip-spaces _look: grapheme -> look/esi: grapheme {
 
 fn get-char -> look/esi: grapheme {
   var tmp/eax: grapheme <- read-key-from-real-keyboard
+  print-grapheme-to-real-screen tmp
   look <- copy tmp
-  compare look, 0
+  compare look, 4
   {
     break-if-!=
     print-string 0, "^D\n"
diff --git a/apps/tile/main.mu b/apps/tile/main.mu
index b02dc386..2e51eba1 100644
--- a/apps/tile/main.mu
+++ b/apps/tile/main.mu
@@ -87,10 +87,10 @@ fn test {
 fn repl {
   {
     # prompt
-    var line-storage: (stream byte 0x100)
-    var line/ecx: (addr stream byte) <- address line-storage
     print-string-to-real-screen "> "
     # read
+    var line-storage: (stream byte 0x100)
+    var line/ecx: (addr stream byte) <- address line-storage
     clear-stream line
     read-line-from-real-keyboard line
     var done?/eax: boolean <- stream-empty? line