summaryrefslogtreecommitdiff
path: root/src/tape.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-17 00:06:42 -0300
committerGabriel Schneider <[email protected]>2026-11-17 12:15:01 -0300
commitc742d19d4bacbd9a91627c4859ca8cb0d11bdba7 (patch)
tree810036d05946b51dfadef508ee75f677303ba7c8 /src/tape.zig
parente4fbb97a506ca2a4b469b6e2e13ecba6e516272c (diff)
downloadpardes-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/tape.zig')
-rw-r--r--src/tape.zig10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/tape.zig b/src/tape.zig
index 68413315..608ad6ff 100644
--- a/src/tape.zig
+++ b/src/tape.zig
@@ -1062,6 +1062,14 @@ pub fn poison(why: []const u8) void {
};
}
+/// A replica's speculation leaves what is the authority's be (a terminal's
+/// emulator, a kind's state): true, and the input waits for its order.
+pub fn authorityOnly(comptime why: []const u8) bool {
+ if (!speculating()) return false;
+ poison(why);
+ return true;
+}
+
/// A speculation read a terminal's rows or moved its view (`Tape.touched`).
pub fn touchTerminal() void {
if (on) |t| if (t.speculating) {
@@ -1247,7 +1255,7 @@ pub fn startFromEnv() void {
pub fn replayMain(path: []const u8) u8 {
const gpa = std.heap.c_allocator;
// What a shell starts before its core (tui.zig's localSession).
- pardes.TerminalImages.start(gpa);
+ pardes.Term.start(gpa);
pardes.syntax.start(gpa);
const bytes = std.Io.Dir.cwd().readFileAlloc(std.Io.Threaded.global_single_threaded.io(), path, gpa, .unlimited) catch |err| {
std.debug.print("replay: cannot read {s}: {t}\n", .{ path, err });