about summary refs log tree commit diff stats
path: root/color-repl.mu
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-01-28 20:54:57 -0800
committerKartik K. Agaram <vc@akkartik.com>2015-01-28 20:54:57 -0800
commitb6ea96bb07c6497b0913e7b5d87a09033d86e09a (patch)
treec6364daebe2cf54c944bdfc60ee258f221ce7d6a /color-repl.mu
parent840b56b0029c39cd184ff3ed9595b329e68070d6 (diff)
downloadmu-b6ea96bb07c6497b0913e7b5d87a09033d86e09a.tar.gz
663 - exit repl on ctrl-d
Diffstat (limited to 'color-repl.mu')
-rw-r--r--color-repl.mu7
1 files changed, 7 insertions, 0 deletions
diff --git a/color-repl.mu b/color-repl.mu
index aaa7bd58..3042c1cf 100644
--- a/color-repl.mu
+++ b/color-repl.mu
@@ -18,6 +18,12 @@
     next-key
     (c:character <- $wait-for-key-from-host)
     (check-abort c:character)
+    ; check for ctrl-d and exit
+    { begin
+      (eof?:boolean <- equal c:character ((ctrl-d literal)))
+      (break-unless eof?:boolean)
+      (reply nil:literal)
+    }
     ; check for backspace
     ;   test: 3<backspace>4<enter>
     ;   todo: backspace past newline
@@ -302,6 +308,7 @@
   { begin
     (print-primitive-to-host (("anarki> " literal)))
     (s:string-address <- read-sexp)
+    (break-unless s:string-address)
     (retro-mode)  ; print errors cleanly
       (t:string-address <- $eval s:string-address)
     (cursor-mode)