Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions userland/apps/stlxterm/src/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,23 @@ int keymap_translate(uint16_t usage, uint8_t modifiers,
case 0x4A: return emit(out, out_size, "\x1b[H", 3);
case 0x4D: return emit(out, out_size, "\x1b[F", 3);
case 0x4C: return emit(out, out_size, "\x1b[3~", 4);
case 0x49: return emit(out, out_size, "\x1b[2~", 4); /* Insert */
case 0x4B: return emit(out, out_size, "\x1b[5~", 4); /* Page Up */
case 0x4E: return emit(out, out_size, "\x1b[6~", 4); /* Page Down */

/* Function keys F1-F12, xterm sequences */
case 0x3A: return emit(out, out_size, "\x1bOP", 3);
case 0x3B: return emit(out, out_size, "\x1bOQ", 3);
case 0x3C: return emit(out, out_size, "\x1bOR", 3);
case 0x3D: return emit(out, out_size, "\x1bOS", 3);
case 0x3E: return emit(out, out_size, "\x1b[15~", 5);
case 0x3F: return emit(out, out_size, "\x1b[17~", 5);
case 0x40: return emit(out, out_size, "\x1b[18~", 5);
case 0x41: return emit(out, out_size, "\x1b[19~", 5);
case 0x42: return emit(out, out_size, "\x1b[20~", 5);
case 0x43: return emit(out, out_size, "\x1b[21~", 5);
case 0x44: return emit(out, out_size, "\x1b[23~", 5);
case 0x45: return emit(out, out_size, "\x1b[24~", 5);
}

return 0;
Expand Down
7 changes: 6 additions & 1 deletion userland/apps/stlxterm/src/stlxterm.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ int main(void) {
ioctl(slave_fd, STLX_TCSETS_RAW, 0);
fcntl(master_fd, F_SETFL, O_NONBLOCK);

// Report the real grid so pty clients see correct geometry
struct winsize ws = { (unsigned short)term_rows, (unsigned short)term_cols, 0, 0 };
ioctl(master_fd, TIOCSWINSZ, &ws);

// Declare the escape dialect this terminal implements
setenv("TERM", "xterm", 1);

Expand Down Expand Up @@ -242,7 +246,8 @@ int main(void) {
if (buf) {
stlxgfx_ctx_t ctx;
stlxgfx_ctx_init(&ctx, buf);
render_term(&ctx, term, cell_w, cell_h, cursor_visible);
render_term(&ctx, term, cell_w, cell_h,
cursor_visible && term->cursor_visible);
stlxgfx_window_swap_buffers(win);
term->dirty = 0;
}
Expand Down
Loading
Loading