diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-17 00:06:42 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-17 12:15:01 -0300 |
| commit | c742d19d4bacbd9a91627c4859ca8cb0d11bdba7 (patch) | |
| tree | 810036d05946b51dfadef508ee75f677303ba7c8 /src/Term.zig | |
| parent | e4fbb97a506ca2a4b469b6e2e13ecba6e516272c (diff) | |
| download | pardes-c742d19d4bacbd9a91627c4859ca8cb0d11bdba7.tar.gz pardes-c742d19d4bacbd9a91627c4859ca8cb0d11bdba7.zip | |
Term: the terminal as the core calls it, src/Term.zig, its lifecycle first (docs/next-terminal.md, Phase 0): Term.open makes an emulator and Term.close frees it, Term.due says when its next kitty frame is due, Term.revive resets a restored terminal's modes under its banner, Term.start and Term.stop run the PNG resize workers; the pane half of each is the core's: panes.createDoc and panes.createTerminal make the pane (the speculation guard there), emulatorGpa and emulator_gpa are the core's choice of allocator, teardownPane closes the emulator, dump.zig's revivePane resets what the old shell was and ensureKind opens an emulator straight into the pane; tape.authorityOnly is the one guard Kind.zig and the terminal both had a copy of; nothing else changes
Diffstat (limited to 'src/Term.zig')
| -rw-r--r-- | src/Term.zig | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/Term.zig b/src/Term.zig new file mode 100644 index 00000000..36315df4 --- /dev/null +++ b/src/Term.zig @@ -0,0 +1,31 @@ +//! The terminal as the core sees it (docs/next-terminal.md, Phase 0): the +//! entries the core calls and the plain records they take and give. A +//! terminal pane holds a `*State` the core never looks into: what it knows +//! of one it is told here, as numbers, bytes and text. The emulator +//! (ghostty-vt) and what it brings stay behind this file, in src/term/; +//! this is the one file outside it that names a file inside it (and so +//! the one place Phase 1 turns into the module's registration). +const std = @import("std"); +const terminal = @import("term/terminal.zig"); + +/// A terminal pane's emulator, its parse and what pardes keeps beside it. +pub const State = terminal.State; + +// ---- lifecycle ---- + +/// A new emulator, `cols` by `rows`, allocated with `gpa` (its own from +/// then on). +pub const open = terminal.open; +/// Its emulator and what it holds, freed; the kitty images' caches were +/// `gpa`'s. +pub const close = terminal.close; +/// When its next kitty animation frame is due (ms on the core's clock), as +/// its last drawn frame left it; null when nothing plays. +pub const due = terminal.due; +/// Loaded from a dump without its shell: its program's modes reset, its +/// history marked off from what the next shell prints. +pub const revive = terminal.revive; +/// The PNG resize workers kitty images are decoded with, started and +/// stopped with the host. +pub const start = terminal.TerminalImages.start; +pub const stop = terminal.TerminalImages.stop; |
