Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove raw mode
  • Loading branch information
jackpot51 committed Aug 2, 2017
1 parent 73c8735 commit 9f3e7f1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 55 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Expand Up @@ -2,7 +2,7 @@
name = "ransid"
description = "Rust ANSI Driver"
repository = "https://github.com/jackpot51/ransid"
version = "0.2.9"
version = "0.2.10"
license-file = "LICENSE"
readme = "README.md"
keywords = ["redox", "ansi"]
Expand Down
54 changes: 0 additions & 54 deletions src/lib.rs
Expand Up @@ -60,7 +60,6 @@ pub struct Console {
pub escape_os: bool,
pub escape_extra: bool,
pub sequence: Vec<String>,
pub raw_mode: bool,
pub mouse_vt200: bool,
pub mouse_btn: bool,
pub mouse_sgr: bool,
Expand Down Expand Up @@ -90,25 +89,6 @@ impl Console {
escape_os: false,
escape_extra: false,
sequence: Vec::new(),

/*
@MANSTART{terminal-raw-mode}
INTRODUCTION
Since Redox has no ioctl syscall, it uses escape codes for switching to raw mode.
ENTERING AND EXITING RAW MODE
Entering raw mode is done using CSI-r (^[?82h). Unsetting raw mode is done by CSI-R (^[?82l).
RAW MODE
Raw mode means that the stdin must be handled solely by the program itself. It will not automatically be printed nor will it be modified in any way (modulo escape codes).
This means that:
- stdin is not printed.
- newlines are interpreted as carriage returns in stdin.
- stdin is not buffered, meaning that the stream of bytes goes directly to the program, without the user having to press enter.
@MANEND
*/
raw_mode: false,
mouse_vt200: false,
mouse_btn: false,
mouse_sgr: false,
Expand Down Expand Up @@ -314,10 +294,6 @@ impl Console {
h: self.h - self.y,
color: self.background
});

if ! self.raw_mode {
self.redraw = true;
}
},
1 => {
// Clear previous rows
Expand All @@ -337,10 +313,6 @@ impl Console {
h: 1,
color: self.background
});

if ! self.raw_mode {
self.redraw = true;
}
},
2 => {
// Erase all
Expand All @@ -355,10 +327,6 @@ impl Console {
h: self.h,
color: self.background
});

if ! self.raw_mode {
self.redraw = true;
}
},
_ => {}
}
Expand All @@ -378,10 +346,6 @@ impl Console {
h: 1,
color: self.background
});

if ! self.raw_mode {
self.redraw = true;
}
},
1 => {
// Clear current row to cursor
Expand All @@ -392,10 +356,6 @@ impl Console {
h: 1,
color: self.background
});

if ! self.raw_mode {
self.redraw = true;
}
},
2 => {
// Erase row
Expand All @@ -406,10 +366,6 @@ impl Console {
h: 1,
color: self.background
});

if ! self.raw_mode {
self.redraw = true;
}
},
_ => {}
}
Expand All @@ -424,7 +380,6 @@ impl Console {
alternate: true,
clear: false,
}),
82 => self.raw_mode = true,
1000 => self.mouse_vt200 = true,
1002 => self.mouse_btn = true,
1006 => self.mouse_sgr = true,
Expand Down Expand Up @@ -458,7 +413,6 @@ impl Console {
alternate: false,
clear: false,
}),
82 => self.raw_mode = false,
1000 => self.mouse_vt200 = false,
1002 => self.mouse_btn = false,
1006 => self.mouse_sgr = false,
Expand Down Expand Up @@ -566,7 +520,6 @@ impl Console {
self.save_x = 0;
self.save_y = 0;
self.cursor = true;
self.raw_mode = false;
self.foreground = Color::ansi(7);
self.background = Color::ansi(0);
self.bold = false;
Expand Down Expand Up @@ -602,10 +555,6 @@ impl Console {
'\x08' => { // Backspace
if self.x >= 1 {
self.x -= 1;

if ! self.raw_mode {
self.block(' ', callback);
}
}
},
'\x09' => { // Tab
Expand All @@ -614,9 +563,6 @@ impl Console {
'\x0A' => { // Newline
self.x = 0;
self.y += 1;
if ! self.raw_mode {
self.redraw = true;
}
},
'\x0B' ... '\x0C' => {} // Ignore
'\x0D' => { // Carriage Return
Expand Down

0 comments on commit 9f3e7f1

Please sign in to comment.