Skip to content
Browse files

Fix raw mode, cursor positioning, less, add luac, clear, and reset

  • Loading branch information...
1 parent 3c82e0a commit bffa0ad2d6a7b485b2f8e32558226003315ee675 @jackpot51 jackpot51 committed
Showing with 21 additions and 14 deletions.
  1. +3 −1 Makefile
  2. +1 −1 crates/coreutils
  3. +1 −1 crates/extrautils
  4. +1 −1 crates/orbutils
  5. +14 −9 kernel/env/console.rs
  6. +1 −1 libc
View
4 Makefile
@@ -167,6 +167,7 @@ filesystem/bin/%: crates/coreutils/src/bin/%.rs $(BUILD)/crt0.o $(BUILD)/libcore
coreutils: \
filesystem/bin/basename \
filesystem/bin/cat \
+ filesystem/bin/clear \
filesystem/bin/cp \
filesystem/bin/du \
filesystem/bin/echo \
@@ -178,6 +179,7 @@ coreutils: \
filesystem/bin/ps \
filesystem/bin/pwd \
filesystem/bin/realpath \
+ filesystem/bin/reset \
filesystem/bin/rm \
filesystem/bin/rmdir \
filesystem/bin/seq \
@@ -242,7 +244,6 @@ filesystem/bin/launcher: crates/orbutils/src/launcher/main.rs crates/orbutils/sr
mkdir -p filesystem/bin
$(RUSTC) $(RUSTCFLAGS) --crate-type bin -o $@ $<
-
bins: \
coreutils \
extrautils \
@@ -255,6 +256,7 @@ bins: \
filesystem/bin/ion \
filesystem/bin/launcher \
filesystem/bin/lua \
+ filesystem/bin/luac \
filesystem/bin/login \
filesystem/bin/orbital \
filesystem/bin/std-test \
2 crates/coreutils
@@ -1 +1 @@
-Subproject commit 19f100aa7e4b1cf7a163a6b1349d98a68afdf386
+Subproject commit 0b43f851999a316c2f78980ff101ee9fab36b992
2 crates/extrautils
@@ -1 +1 @@
-Subproject commit 422978f7a4c5d2ddf2ac3a2c4812c8835a42abd9
+Subproject commit f93cf59d3f7941b924fab36815cb37b2254e2d21
2 crates/orbutils
@@ -1 +1 @@
-Subproject commit edc26ab40c4cdfbbf07cb57279dc43e5bbfa5f8e
+Subproject commit f04ee3b4a4e28299787f0516f0dc071ec89694fe
View
23 kernel/env/console.rs
@@ -5,7 +5,7 @@ use collections::Vec;
use common::event::{self, Event, EventOption};
-use core::mem;
+use core::{cmp, mem};
use drivers::io::{Io, Pio};
@@ -128,11 +128,11 @@ impl Console {
display.rect(self.point_x, self.point_y, 8, 16, self.background);
}
- let row = self.sequence.get(0).map_or("", |p| &p).parse::<usize>().unwrap_or(0);
- self.point_y = row * 16;
+ let row = self.sequence.get(0).map_or("", |p| &p).parse::<isize>().unwrap_or(1);
+ self.point_y = cmp::max(0, row - 1) as usize * 16;
- let col = self.sequence.get(1).map_or("", |p| &p).parse::<usize>().unwrap_or(0);
- self.point_x = col * 8;
+ let col = self.sequence.get(1).map_or("", |p| &p).parse::<isize>().unwrap_or(1);
+ self.point_x = cmp::max(0, col - 1) as usize * 8;
if let Some(ref mut display) = self.display {
display.rect(self.point_x, self.point_y, 8, 16, self.foreground);
@@ -158,10 +158,15 @@ RAW MODE
- stdin is not buffered, meaning that the stream of bytes goes directly to the program, without the user having to press enter.
@MANEND
*/
- 'r' => self.raw_mode = true,
- 'R' => self.raw_mode = false,
+ 'r' => {
+ self.raw_mode = true;
+ self.escape_sequence = false;
+ },
+ 'R' => {
+ self.raw_mode = false;
+ self.escape_sequence = false;
+ },
_ => self.escape_sequence = false,
-
}
if !self.escape_sequence {
@@ -240,7 +245,7 @@ RAW MODE
if key_event.pressed {
if self.raw_mode {
match key_event.scancode {
- event::K_BKSP => self.command.push_str("\x08 \x08"),
+ event::K_BKSP => self.command.push_str("\x08"),
event::K_UP => self.command.push_str("\x1B[A"),
event::K_DOWN => self.command.push_str("\x1B[B"),
event::K_RIGHT => self.command.push_str("\x1B[C"),
2 libc
@@ -1 +1 @@
-Subproject commit 161e972b602589a0f5bf361f938d0756f32bb30b
+Subproject commit f0e8c9f2d7113632909813fd4c631fbca05bd047

0 comments on commit bffa0ad

Please sign in to comment.
Something went wrong with that request. Please try again.