about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2017-05-18 10:09:17 -0700
committerKartik K. Agaram <vc@akkartik.com>2017-05-18 10:14:49 -0700
commitb6fa632e2f46467c76c7fb39c731cb17e8558ee0 (patch)
treef821a84d0143eec4c1c8f53cdad1807800b90365
parentee1a18f050a5458ade460720091e20ce6b335011 (diff)
downloadmu-b6fa632e2f46467c76c7fb39c731cb17e8558ee0.tar.gz
3861 - screen untouched when entering console mode
-rw-r--r--chessboard.mu1
-rw-r--r--console.mu1
-rw-r--r--display.mu3
-rw-r--r--edit/001-editor.mu1
-rw-r--r--edit/002-typing.mu1
-rw-r--r--edit/004-programming-environment.mu1
-rw-r--r--edit/005-sandbox.mu1
-rw-r--r--http-client.mu1
-rw-r--r--sandbox/001-editor.mu1
-rw-r--r--sandbox/002-typing.mu1
-rw-r--r--sandbox/004-programming-environment.mu1
-rw-r--r--sandbox/005-sandbox.mu1
-rw-r--r--screen.mu1
-rw-r--r--termbox/termbox.c1
14 files changed, 14 insertions, 2 deletions
diff --git a/chessboard.mu b/chessboard.mu
index 17f3f771..19accb52 100644
--- a/chessboard.mu
+++ b/chessboard.mu
@@ -4,6 +4,7 @@
 def main [
   local-scope
   open-console  # take control of screen, keyboard and mouse
+  clear-screen 0/screen  # non-scrolling app
 
   # The chessboard function takes keyboard and screen objects as 'ingredients'.
   #
diff --git a/console.mu b/console.mu
index cc81c232..062ca3b0 100644
--- a/console.mu
+++ b/console.mu
@@ -5,6 +5,7 @@
 def main [
   local-scope
   open-console
+  clear-screen 0/screen  # non-scrolling app
   {
     e:event, found?:bool <- check-for-interaction
     break-if found?
diff --git a/display.mu b/display.mu
index 864b74c3..efe7b842 100644
--- a/display.mu
+++ b/display.mu
@@ -2,10 +2,11 @@
 
 def main [
   open-console
+  clear-display
   print-character-to-display 97, 1/red, 2/green
   1:num/raw, 2:num/raw <- cursor-position-on-display
   wait-for-some-interaction
-  clear-display
+  clear-line
   move-cursor-on-display 0, 4
   print-character-to-display 98
   wait-for-some-interaction
diff --git a/edit/001-editor.mu b/edit/001-editor.mu
index a6dde85b..50ba09f5 100644
--- a/edit/001-editor.mu
+++ b/edit/001-editor.mu
@@ -6,6 +6,7 @@ def main text:text [
   local-scope
   load-ingredients
   open-console
+  clear-screen 0/screen  # non-scrolling app
   e:&:editor <- new-editor text, 0/left, 5/right
   render 0/screen, e
   wait-for-event 0/console
diff --git a/edit/002-typing.mu b/edit/002-typing.mu
index 16693429..7c385b6f 100644
--- a/edit/002-typing.mu
+++ b/edit/002-typing.mu
@@ -6,6 +6,7 @@ def! main text:text [
   local-scope
   load-ingredients
   open-console
+  clear-screen 0/screen  # non-scrolling app
   editor:&:editor <- new-editor text, 5/left, 45/right
   editor-render 0/screen, editor
   editor-event-loop 0/screen, 0/console, editor
diff --git a/edit/004-programming-environment.mu b/edit/004-programming-environment.mu
index 606cdfa2..c152f519 100644
--- a/edit/004-programming-environment.mu
+++ b/edit/004-programming-environment.mu
@@ -6,6 +6,7 @@
 def! main [
   local-scope
   open-console
+  clear-screen 0/screen  # non-scrolling app
   env:&:environment <- new-programming-environment 0/filesystem, 0/screen
   render-all 0/screen, env, render
   event-loop 0/screen, 0/console, env, 0/filesystem
diff --git a/edit/005-sandbox.mu b/edit/005-sandbox.mu
index 2e16e05b..cc751065 100644
--- a/edit/005-sandbox.mu
+++ b/edit/005-sandbox.mu
@@ -10,6 +10,7 @@
 def! main [
   local-scope
   open-console
+  clear-screen 0/screen  # non-scrolling app
   env:&:environment <- new-programming-environment 0/filesystem, 0/screen
   env <- restore-sandboxes env
   render-all 0/screen, env, render
diff --git a/http-client.mu b/http-client.mu
index 6bf1bfa6..681b4738 100644
--- a/http-client.mu
+++ b/http-client.mu
@@ -14,6 +14,7 @@ def main [
   }
   result:text <- buffer-to-array buf
   open-console
+  clear-screen 0/screen  # non-scrolling app
   len:num <- length *result
   print 0/real-screen, result
   wait-for-some-interaction
diff --git a/sandbox/001-editor.mu b/sandbox/001-editor.mu
index a6dde85b..50ba09f5 100644
--- a/sandbox/001-editor.mu
+++ b/sandbox/001-editor.mu
@@ -6,6 +6,7 @@ def main text:text [
   local-scope
   load-ingredients
   open-console
+  clear-screen 0/screen  # non-scrolling app
   e:&:editor <- new-editor text, 0/left, 5/right
   render 0/screen, e
   wait-for-event 0/console
diff --git a/sandbox/002-typing.mu b/sandbox/002-typing.mu
index 16693429..7c385b6f 100644
--- a/sandbox/002-typing.mu
+++ b/sandbox/002-typing.mu
@@ -6,6 +6,7 @@ def! main text:text [
   local-scope
   load-ingredients
   open-console
+  clear-screen 0/screen  # non-scrolling app
   editor:&:editor <- new-editor text, 5/left, 45/right
   editor-render 0/screen, editor
   editor-event-loop 0/screen, 0/console, editor
diff --git a/sandbox/004-programming-environment.mu b/sandbox/004-programming-environment.mu
index 53f9f846..4b57f5ae 100644
--- a/sandbox/004-programming-environment.mu
+++ b/sandbox/004-programming-environment.mu
@@ -3,6 +3,7 @@
 def! main [
   local-scope
   open-console
+  clear-screen 0/screen  # non-scrolling app
   env:&:environment <- new-programming-environment 0/filesystem, 0/screen
   render-all 0/screen, env, render
   event-loop 0/screen, 0/console, env, 0/filesystem
diff --git a/sandbox/005-sandbox.mu b/sandbox/005-sandbox.mu
index a7df7a54..2d1e4c2d 100644
--- a/sandbox/005-sandbox.mu
+++ b/sandbox/005-sandbox.mu
@@ -10,6 +10,7 @@
 def! main [
   local-scope
   open-console
+  clear-screen 0/screen  # non-scrolling app
   env:&:environment <- new-programming-environment 0/filesystem, 0/screen
   env <- restore-sandboxes env
   render-all 0/screen, env, render
diff --git a/screen.mu b/screen.mu
index c8e16f85..1c7a31a1 100644
--- a/screen.mu
+++ b/screen.mu
@@ -4,6 +4,7 @@
 # screens.
 def main [
   open-console
+  clear-screen 0/screen  # non-scrolling app
   10:char <- copy 97/a
   print 0/screen, 10:char/a, 1/red, 2/green
   1:num/raw, 2:num/raw <- cursor-position 0/screen
diff --git a/termbox/termbox.c b/termbox/termbox.c
index 0ee4b283..46584a19 100644
--- a/termbox/termbox.c
+++ b/termbox/termbox.c
@@ -99,7 +99,6 @@ int tb_init(void)
   bytebuffer_puts(&output_buffer, funcs[T_ENTER_KEYPAD]);
   bytebuffer_puts(&output_buffer, funcs[T_ENTER_MOUSE]);
   bytebuffer_puts(&output_buffer, funcs[T_ENTER_BRACKETED_PASTE]);
-  send_clear();
 
   update_term_size();
   return 0;