summaryrefslogtreecommitdiffstats
path: root/rsnix/src/tty.rs
diff options
context:
space:
mode:
Diffstat (limited to 'rsnix/src/tty.rs')
-rw-r--r--rsnix/src/tty.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/rsnix/src/tty.rs b/rsnix/src/tty.rs
index 8d745b3..b6b6cc8 100644
--- a/rsnix/src/tty.rs
+++ b/rsnix/src/tty.rs
@@ -37,6 +37,9 @@ static mut RAW_LEN: usize = 0;
37/// Read one line in canonical mode: echo every key, ^C cancels the line, 37/// Read one line in canonical mode: echo every key, ^C cancels the line,
38/// ^D on an empty line is EOF. Echo goes to the terminal (GOP) and serial. 38/// ^D on an empty line is EOF. Echo goes to the terminal (GOP) and serial.
39pub fn read_line() -> LineInput { 39pub fn read_line() -> LineInput {
40 // Interactive input: make sure deferred scrolls are pushed first so
41 // the screen shows the current state (no-op when nothing is pending).
42 crate::vt::sync_scroll();
40 let mut buf = strbuf::String::<LINE_BUF_SIZE>::new(); 43 let mut buf = strbuf::String::<LINE_BUF_SIZE>::new();
41 loop { 44 loop {
42 match ps2::poll_key() { 45 match ps2::poll_key() {
@@ -112,6 +115,9 @@ pub fn interrupt_pressed() -> bool {
112/// Blocking read of the next raw-mode byte. Keys arrive translated to the 115/// Blocking read of the next raw-mode byte. Keys arrive translated to the
113/// terminal byte protocol; multi-byte sequences are delivered in order. 116/// terminal byte protocol; multi-byte sequences are delivered in order.
114pub fn read_byte() -> u8 { 117pub fn read_byte() -> u8 {
118 // Interactive (raw) input: push deferred scrolls so the full-screen
119 // app draws over a current framebuffer.
120 crate::vt::sync_scroll();
115 loop { 121 loop {
116 if let Some(b) = pop_raw() { 122 if let Some(b) = pop_raw() {
117 return b; 123 return b;