summaryrefslogtreecommitdiff
path: root/src/main.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.zig')
-rw-r--r--src/main.zig14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/main.zig b/src/main.zig
index 2934aba9..4a55695c 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -1496,7 +1496,7 @@ fn nativeMain(std_init: std.process.Init) !void {
opts.recent_import = oldRecentDir(arena, init.environ_map);
if (found.dir) |d| @import("crash.zig").setDir(d);
if (attach) |name| if (std.mem.lastIndexOfScalar(u8, name, ':')) |colon| {
- remoteAttach(init, opts, name[0..colon], name[colon + 1 ..]);
+ attachClient(init, opts, name[0..colon], name[colon + 1 ..]);
};
if (attach) |name| if (!resuming) attachTo(init, opts, name);
if (detach) |name| {
@@ -1674,17 +1674,17 @@ fn commOf(io: std.Io, pid: []const u8, buf: *[64]u8) []const u8 {
/// window's (gui.zig).
fn clientOf(init: std.process.Init, opts: pardes.Options, path: []const u8, name: []const u8, far: bool) !void {
switch (pardes.platform) {
- .tui => try @import("tui/tui.zig").remote(init, opts, path, name, far),
- .gui => try @import("gui/gui.zig").remote(init, opts, path, name, far),
+ .tui => try @import("tui/tui.zig").runClient(init, opts, path, name, far),
+ .gui => try @import("gui/gui.zig").runClient(init, opts, path, name, far),
else => unreachable,
}
}
/// `pardes --attach=<where>:<name>` (`pardes-gui` too): a replica client
-/// (tui.zig and gui.zig `remote`), through the socket `where` names, or
+/// (tui.zig and gui.zig `runClient`), through the socket `where` names, or
/// through `ssh -L` of host `where`'s replica socket to one of this
/// process's.
-fn remoteAttach(init: std.process.Init, opts: pardes.Options, where: []const u8, name: []const u8) noreturn {
+fn attachClient(init: std.process.Init, opts: pardes.Options, where: []const u8, name: []const u8) noreturn {
const io = init.io;
if (comptime pardes.platform != .tui and pardes.platform != .gui) unreachable;
if (std.mem.indexOfScalar(u8, where, '/') != null) {
@@ -1697,7 +1697,7 @@ fn remoteAttach(init: std.process.Init, opts: pardes.Options, where: []const u8,
const here = std.fmt.bufPrintSentinel(&here_buf, "{s}/pardes-ssh-{d}.sock", .{ tmp, std.c.getpid() }, 0) catch die(io, "--attach: TMPDIR is too long for a socket's path", .{});
var there_buf: [ninep_io.sun_path_len + 64:0]u8 = undefined;
var dir_buf: [ninep_io.sun_path_len:0]u8 = undefined;
- const dir = if (std.c.getenv("PARDES_REMOTE_RUNTIME")) |d| std.mem.span(d) else ninep_io.socketDir(&dir_buf) orelse die(io, "--attach: no runtime directory to name the remote socket by: set PARDES_REMOTE_RUNTIME", .{});
+ const dir = if (std.c.getenv("PARDES_REMOTE_RUNTIME")) |d| std.mem.span(d) else ninep_io.socketDir(&dir_buf) orelse die(io, "--attach: no runtime directory to name the far socket by: set PARDES_REMOTE_RUNTIME", .{});
var forward_buf: [2 * ninep_io.sun_path_len + 64]u8 = undefined;
const there = std.fmt.bufPrintSentinel(&there_buf, "{s}/pardes-replica.sock", .{dir}, 0) catch unreachable;
const forward = std.fmt.bufPrintSentinel(&forward_buf, "{s}:{s}", .{ here, there }, 0) catch unreachable;
@@ -1814,7 +1814,7 @@ fn attachTo(init: std.process.Init, opts: pardes.Options, name: []const u8) nore
fn crossAttach(init: std.process.Init, opts: pardes.Options, name: []const u8) noreturn {
var sock_buf: [ninep_io.sun_path_len:0]u8 = undefined;
const sock = daemon.replicaSocket(&sock_buf) orelse die(init.io, "--attach: no runtime directory for the replica socket", .{});
- remoteAttach(init, opts, sock, name);
+ attachClient(init, opts, sock, name);
}
/// Where Recent's file (0.24) and the store before it were kept: