summaryrefslogtreecommitdiff
path: root/core/Core.zig
diff options
context:
space:
mode:
Diffstat (limited to 'core/Core.zig')
-rw-r--r--core/Core.zig37
1 files changed, 17 insertions, 20 deletions
diff --git a/core/Core.zig b/core/Core.zig
index de911469..d2cfadfc 100644
--- a/core/Core.zig
+++ b/core/Core.zig
@@ -303,7 +303,7 @@ theme_file_path: config.Settings.Text(limits.host_path_cap) = .{},
/// what a failed ThemeFile goes back to (colors.revertThemeFile).
theme_file_loaded: config.Settings.Text(limits.host_path_cap) = .{},
theme_file_generation: u32 = 0,
-theme_file_pane: u8 = 0,
+theme_file_pane: Pane.Id = .at(0),
chrome: colors.ChromeTheme = colors.initial_chrome,
/// Every drawn frame's timings (FrameStats: the Debug box, PARDES_FRAMES):
/// its runner's (`Options.frames`), which its frontend writes as it draws
@@ -472,11 +472,11 @@ pub const replica = .{
"tape",
},
.derived = .{ "shell_rows", "diff_output", "locations_cache", "retired_panes", "tty_filter_palette", "body_chrome" },
- // The host's handles, the 9P server's fids and log, the state file
- // every session of the user shares (and Recent read from it), this
- // session's closed panes, and the files of a host with no file
- // system of its own.
- .authority = .{ "host", "fs", "store", "recent", "db", "fallback" },
+ // The host's handles, the state file every session of the user
+ // shares (and Recent read from it), this session's closed panes, and
+ // the files of a host with no file system of its own. (The 9P
+ // server's own part of `fs` says so in fs.Namespace.)
+ .authority = .{ "host", "store", "recent", "db", "fallback" },
.len = .{ .{ "look_src", "n_look_src" }, .{ "session_dir", "session_dir_len" }, .{ "session_home", "session_home_len" }, .{ "session_shell", "session_shell_len" } },
};
@@ -531,9 +531,9 @@ pub const perform = @import("Effect.zig").perform;
/// second copy of this drifted once, leaving restored tags without an
/// allocator and every 9P mtime 0.
pub fn create(gpa: std.mem.Allocator, opts: Options) !*Pardes {
- // The global still set beside the field (P20): a core made while
- // a tape records (PARDES_RECORD, a replica's step) is its.
- const tape = opts.tape orelse pardes.tape.on orelse &pardes.tape.none;
+ // Its options' (a recording session's, an authority's, a replay's), or
+ // the one nobody records.
+ const tape = opts.tape orelse &pardes.tape.none;
const p = try gpa.create(Pardes);
p.* = .{
.gpa = gpa,
@@ -564,10 +564,9 @@ pub fn create(gpa: std.mem.Allocator, opts: Options) !*Pardes {
return p;
}
-/// A new session, its tape written from here when PARDES_RECORD asks.
+/// A new session, recorded from here on its options' tape.
pub fn init(gpa: std.mem.Allocator, opts: Options) !*Pardes {
// By hand, not `taped`: no core yet to enter on; the tape adopts the one made.
- pardes.tape.startFromEnv();
const taped = pardes.tape.enter(null, .{ .init = opts });
// The tape adopts the core made, none on a failure.
var made: ?*Pardes = null;
@@ -824,8 +823,8 @@ fn recentFound(p: *Pardes, hash: u64) ?recent_files.Entry {
pub fn deinit(p: *Pardes) void {
// By hand, not `taped`: what it records is no argument (`current`), and it leaves on no core.
- const taped = pardes.tape.enter(p, .{ .deinit = pardes.tape.current(p) });
- pardes.tape.forget(p);
+ const taped = pardes.tape.enter(p, .{ .deinit = p.tape.current(p) });
+ p.tape.forget(p);
defer pardes.tape.leave(null, taped);
if (std.c.getenv("PARDES_FRAMES")) |path| p.frames.dump(std.mem.span(path));
// Every file open now is closed with its dot, and the list kept.
@@ -1581,12 +1580,6 @@ fn stepInner(p: *Pardes) void {
/// local socket costs microseconds and not a vsync.
pub const serveFs = pardes.tape.taped(serveFsInner);
fn serveFsInner(p: *Pardes, req: ctlfs.Req) ctlfs.Reply {
- // The held write of an Edit whose commands run, asked again by a
- // retry of its park: still waiting, or its answer, never run twice.
- if (p.fs.edit_hold) |*h| if (h.names(req)) {
- if (!h.done) return .{ .tag = req.tag, .status = .again };
- return filesystem.EditHold.answer(&p.fs);
- };
defer pardes.panes.File.syncTwins(p);
if (!ctlfs.changesPane(p, req)) return ctlfs.handle(p, req);
// An address, a limit or the mark flag is nothing drawn: a script's
@@ -2293,6 +2286,10 @@ pub const Options = struct {
/// first effects (runtime/session.zig); a client's session is on it,
/// its first join made there with no hello (replica.join).
pair: ?c_int = null,
+ /// A client exec'd at an Upgrade (runtime/client.zig `execAgain`,
+ /// PARDES_JOIN_VIEW): the view it had, which the session kept for it
+ /// (views.away), joined again for as a rejoin dials (replica.join).
+ join_view: ?u8 = null,
mounts: []const filesystem.Mount = &.{},
config_dir: ?[]const u8 = null,
/// Where what outlives the session is kept (Db.zig): the user's state
@@ -2308,7 +2305,7 @@ pub const Options = struct {
/// A client's: the kinds it caught breaking PA_PLAIN, its frontend's
/// list, which outlives each core it joins with. In no tape and no dump.
distrusted: ?*pardes.Addon.Distrusted = null,
- /// The core's tape (`Pardes.tape`); null: `tape.on`'s, or `tape.none`.
+ /// The core's tape (`Pardes.tape`); null: `tape.none`.
tape: ?*pardes.tape.Tape = null,
/// What the host's scan of the addon directories found (Addon.scan).
addons: []const pardes.Kind.Loaded = &.{},