aboutsummaryrefslogtreecommitdiff
path: root/vendor/libghostty-vt/src/os/cgroup.zig
diff options
context:
space:
mode:
authorCan Celik <ogulcancelik@gmail.com>2026-09-10 21:51:57 +0300
committerGitHub <noreply@github.com>2026-09-10 21:51:57 +0300
commit425c86179791cd32e2d4ce0ae7f269940b4b0663 (patch)
treee52c4383a6d69216cbe2a32638bf90841d7e2189 /vendor/libghostty-vt/src/os/cgroup.zig
parent90e947a6e26e02f10ec7f1694c4eb5b78a86406b (diff)
chore: upgrade libghostty and preserve terminal behavior (#3906)
Diffstat (limited to 'vendor/libghostty-vt/src/os/cgroup.zig')
-rw-r--r--vendor/libghostty-vt/src/os/cgroup.zig9
1 files changed, 5 insertions, 4 deletions
diff --git a/vendor/libghostty-vt/src/os/cgroup.zig b/vendor/libghostty-vt/src/os/cgroup.zig
index 9e68a50f..f5eacc6c 100644
--- a/vendor/libghostty-vt/src/os/cgroup.zig
+++ b/vendor/libghostty-vt/src/os/cgroup.zig
@@ -1,4 +1,5 @@
const std = @import("std");
+const global = @import("../global.zig");
const log = std.log.scoped(.@"linux-cgroup");
@@ -11,16 +12,16 @@ pub fn current(buf: []u8, pid: u32) ?[]const u8 {
// 0::/user.slice/user-1000.slice/session-1.scope
// The cgroup path is the third field.
const path = std.fmt.bufPrint(&path_buf, "/proc/{}/cgroup", .{pid}) catch return null;
- const file = std.fs.openFileAbsolute(path, .{}) catch return null;
- defer file.close();
+ const file = std.Io.Dir.openFileAbsolute(global.io(), path, .{}) catch return null;
+ defer file.close(global.io());
var read_buf: [64]u8 = undefined;
- var file_reader = file.reader(&read_buf);
+ var file_reader = file.reader(global.io(), &read_buf);
const reader = &file_reader.interface;
const len = reader.readSliceShort(buf) catch return null;
const contents = buf[0..len];
// Find the last ':'
const idx = std.mem.lastIndexOfScalar(u8, contents, ':') orelse return null;
- return std.mem.trimRight(u8, contents[idx + 1 ..], " \r\n");
+ return std.mem.trimEnd(u8, contents[idx + 1 ..], " \r\n");
}