small software-rendered rust tty
home
| -rw-r--r-- | src/main.rs | 2 | ||||
| -rw-r--r-- | src/term.rs | 8 | ||||
| -rw-r--r-- | x | 8 |
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', .. @@ -1,7 +1 @@ -]0;os@klunk:~/pattypan[?2004h[os@klunk pattypan]$
[K
[os@klunk pattypan]$ tput cols
-[?2004l
106
-]0;os@klunk:~/pattypan[?2004h[os@klunk pattypan]$ tput cols[K[K[K[Krows
-[?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]$
[K
[os@klunk pattypan]$ q�d
\ No newline at end of file |