aboutsummaryrefslogtreecommitdiffstats
path: root/src/pane.c
diff options
context:
space:
mode:
authorsl0p <sl0p@sl0p.foo>2026-08-13 22:26:02 +0200
committersl0p <sl0p@sl0p.foo>2026-08-13 22:26:02 +0200
commit34fcd16e59e3087e9bf84ebce4e05d439eea9198 (patch)
treee07b9dfc235e3a0b67047d59a9c521c6e98a28ae /src/pane.c
parentsl0ptty: input decoder + per-pane re-encode (diff)
downloadslosh-34fcd16e59e3087e9bf84ebce4e05d439eea9198.tar.gz
slosh-34fcd16e59e3087e9bf84ebce4e05d439eea9198.tar.xz
slosh-34fcd16e59e3087e9bf84ebce4e05d439eea9198.zip
sl0ptty: M0.5 — the headless driver and the harness everything rests on
--script runs the whole compositor with no tty: commands in (send, raw, settle, resize, snapshot, alive), composited screen out as JSON — rows of text, style runs, cursor, and the hit list. Styles are emitted as runs rather than per-cell objects, because a test wants 'columns 0..5 of row 0 are bold red', not 1920 objects. The hit list is empty until M1 paints something clickable, but the type, the JSON, and hit_test() exist now: one geometry, established before there is anything to get wrong. Also fixes two host-policy defaults found by the cursor never appearing. lib-vt is a VT library, not a terminal, so it starts with DECTCEM (mode 25) off and grapheme clustering (2027) off. Both are now set via MODE_DEFAULT, so they survive RIS. tests/harness.py + tests/test_screen.py: 19 checks over composition, styling, wide chars/clusters, scrollback, resize and the full input round trip — including the kitty/legacy re-encoding matrix, which no longer needs a pty. make test is now 2.4s for 59 checks; make test-live keeps the four that genuinely need a tty.
Diffstat (limited to 'src/pane.c')
-rw-r--r--src/pane.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/pane.c b/src/pane.c
index f5eeac7..5850a57 100644
--- a/src/pane.c
+++ b/src/pane.c
@@ -78,6 +78,21 @@ pane_t *pane_new(const char *const argv[], uint16_t cols, uint16_t rows,
ghostty_terminal_set(p->term, GHOSTTY_TERMINAL_OPT_WRITE_PTY, &wfn);
ghostty_terminal_set(p->term, GHOSTTY_TERMINAL_OPT_TITLE_CHANGED, &tfn);
+ /* lib-vt makes no assumptions a host terminal would: it starts with DECTCEM
+ * (mode 25) off, so the cursor is invisible until someone says otherwise.
+ * MODE_DEFAULT sets the current value *and* the one restored by RIS, so a
+ * program that resets the terminal does not lose its cursor.
+ *
+ * 2027 is grapheme clustering: one cell per cluster, so flags and ZWJ emoji
+ * stay whole. We are opinionated about the outer terminal (D11) and it
+ * clusters too; under a terminal that does not, wide emoji may misalign. */
+ static const uint16_t default_on[] = {25, 2027};
+ for (size_t i = 0; i < sizeof default_on / sizeof *default_on; i++) {
+ GhosttyTerminalModeConfig mc = {.mode = ghostty_mode_new(default_on[i], false),
+ .value = true};
+ ghostty_terminal_set(p->term, GHOSTTY_TERMINAL_OPT_MODE_DEFAULT, &mc);
+ }
+
if (pty_spawn(&p->pty, argv, cols, rows, cwd) != 0) goto fail;
p->alive = true;
p->dirty = true;