small software-rendered rust tty
bendn 9 months ago
parent 7df45b3 · commit 28b4ecc
-rw-r--r--src/main.rs2
-rw-r--r--src/term.rs8
-rw-r--r--x8
3 files changed, 11 insertions, 7 deletions
diff --git a/src/main.rs b/src/main.rs
index 3a2cac6..1b5fd5d 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -124,6 +124,8 @@ fn main() -> Result<()> {
Down => b"\x1b[B",
Right => b"\x1b[C",
Left => b"\x1b[D",
+ NumPad7 | Home => b"\x1b[H",
+ NumPad1 | End => b"\x1b[F",
Apostrophe if shifting => b"\"",
Apostrophe => b"'",
Space => b" ",
diff --git a/src/term.rs b/src/term.rs
index 394e1a7..a3420a1 100644
--- a/src/term.rs
+++ b/src/term.rs
@@ -196,6 +196,14 @@ impl Terminal {
}
Control(ControlFunction {
start: b'[',
+ end: b'H',
+ ..
+ }) => {
+ //home
+ self.cursor.0 = 1
+ }
+ Control(ControlFunction {
+ start: b'[',
params,
end: b'K',
..
diff --git a/x b/x
index 97369b8..7ff190c 100644
--- a/x
+++ b/x
@@ -1,7 +1 @@
-]0;os@klunk:~/pattypan[?2004h[os@klunk pattypan]$  [os@klunk pattypan]$ tput cols
-[?2004l 106
-]0;os@klunk:~/pattypan[?2004h[os@klunk pattypan]$ tput colsrows
-[?2004l tput: unknown terminfo capability 'rows'
-]0;os@klunk:~/pattypan[?2004h[os@klunk pattypan]$ tput lines
-[?2004l 40
-]0;os@klunk:~/pattypan[?2004h[os@klunk pattypan]$ � \ No newline at end of file
+]0;os@klunk:~/pattypan[?2004h[os@klunk pattypan]$  [os@klunk pattypan]$ q�d \ No newline at end of file