summaryrefslogtreecommitdiff
path: root/test/session.zig
diff options
context:
space:
mode:
Diffstat (limited to 'test/session.zig')
-rw-r--r--test/session.zig11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/session.zig b/test/session.zig
index 28557322..8b3c5c41 100644
--- a/test/session.zig
+++ b/test/session.zig
@@ -120,6 +120,17 @@ pub const Session = struct {
return out.items;
}
+ /// A range file (`dot`, `addr`, `limit`) as its two offsets.
+ pub fn range(s: *Session, path: []const u8) !struct { u32, u32 } {
+ var it = std.mem.tokenizeScalar(u8, try s.read(path), ' ');
+ return .{ try std.fmt.parseInt(u32, it.next() orelse return error.NoRange, 10), try std.fmt.parseInt(u32, it.next() orelse return error.NoRange, 10) };
+ }
+
+ /// No frontend attached, as a detached session's daemon says.
+ pub fn detach(s: *Session) void {
+ pardesOf(s).unattended = true;
+ }
+
/// The serial of the pane with the keyboard.
pub fn focused(s: *Session) !u32 {
return std.fmt.parseInt(u32, std.mem.trim(u8, try s.read("/focus"), "\n"), 10);