summaryrefslogtreecommitdiff
path: root/src/exec.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/exec.zig')
-rw-r--r--src/exec.zig9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/exec.zig b/src/exec.zig
index e1c13daa..c5218279 100644
--- a/src/exec.zig
+++ b/src/exec.zig
@@ -411,11 +411,16 @@ pub fn spawnTty(p: *Pardes, from: usize) ?*Pane {
pub fn spawnV9fsTty(p: *Pardes, from: usize) void {
if (comptime !hosted or @import("builtin").os.tag != .linux)
return p.reportError(from, "Tty9p", error.LinuxRequired);
- if (p.fs.socket_path.len == 0)
+ // The 9P server's: a replica has the authority's answer.
+ if (!pardes.tape.authority(servesSocket, .{p}))
return p.reportError(from, "Tty9p", error.SessionSocketRequired);
_ = spawnTtyWithMount(p, from, true);
}
+fn servesSocket(p: *Pardes) bool {
+ return p.fs.socket_path.len != 0;
+}
+
fn spawnTtyWithMount(p: *Pardes, from: usize, v9fs: bool) ?*Pane {
// No pane asking (an empty window's tag): the session's directory, as
// New's scratch is.
@@ -1009,7 +1014,7 @@ pub fn applyStartupConfig(p: *Pardes) void {
/// setting lines: a command in it (`Newcol`) is the session's start, and
/// would not be right twice.
pub fn reapplyInitFile(p: *Pardes, path: []const u8, text: []const u8) void {
- const init_path = p.opts.startup_config_path orelse return;
+ const init_path = p.startupPath() orelse return;
if (!std.mem.eql(u8, init_path, path)) return;
applyInitText(p, text, true);
}