input: encode keyboard events and send them to the shell

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6ee2acd5f74575f4bcc2f41417207c626a6a6964
This commit is contained in:
raf 2026-06-24 12:42:17 +03:00
commit b2d656e7bd
No known key found for this signature in database
GPG key ID: 29D95B64378DB4BF
5 changed files with 322 additions and 8 deletions

View file

@ -124,6 +124,8 @@ pub struct Grid {
alt_saved: Option<Vec<Vec<Cell>>>,
cursor_shape: CursorShape,
cursor_visible: bool,
/// Application cursor-keys mode (DECCKM): arrows send SS3 instead of CSI.
app_cursor: bool,
/// Cursor colour from OSC 12; `None` follows the cell under the cursor.
cursor_color: Option<(u8, u8, u8)>,
}
@ -154,6 +156,7 @@ impl Grid {
cursor_shape: CursorShape::default(),
cursor_visible: true,
cursor_color: None,
app_cursor: false,
}
}
@ -250,6 +253,14 @@ impl Grid {
self.cursor_color
}
pub fn set_app_cursor(&mut self, on: bool) {
self.app_cursor = on;
}
pub fn app_cursor(&self) -> bool {
self.app_cursor
}
// --- printing ---
/// Place a printable character at the cursor, honouring width and autowrap.