aboutsummaryrefslogtreecommitdiff
path: root/vendor/libghostty-vt/src/os/passwd.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/passwd.zig
parent90e947a6e26e02f10ec7f1694c4eb5b78a86406b (diff)
chore: upgrade libghostty and preserve terminal behavior (#3906)
Diffstat (limited to 'vendor/libghostty-vt/src/os/passwd.zig')
-rw-r--r--vendor/libghostty-vt/src/os/passwd.zig7
1 files changed, 4 insertions, 3 deletions
diff --git a/vendor/libghostty-vt/src/os/passwd.zig b/vendor/libghostty-vt/src/os/passwd.zig
index e9bbff06..7c16e54e 100644
--- a/vendor/libghostty-vt/src/os/passwd.zig
+++ b/vendor/libghostty-vt/src/os/passwd.zig
@@ -5,6 +5,7 @@ const build_config = @import("../build_config.zig");
const Allocator = std.mem.Allocator;
const ArenaAllocator = std.heap.ArenaAllocator;
const posix = std.posix;
+const compat_fd = @import("../lib/compat/fd.zig");
const log = std.log.scoped(.passwd);
@@ -89,11 +90,11 @@ pub fn get(alloc: Allocator) !Entry {
// Once started, we can close the child side. We do this after
// wait right now but that is fine too. This lets us read the
// parent and detect EOF.
- _ = posix.close(pty.slave);
+ _ = compat_fd.close(pty.slave);
// Read all of our output
const output = output: {
- var output: std.ArrayListUnmanaged(u8) = .{};
+ var output: std.ArrayListUnmanaged(u8) = .empty;
while (true) {
const n = posix.read(pty.master, &buf) catch |err| {
switch (err) {
@@ -116,7 +117,7 @@ pub fn get(alloc: Allocator) !Entry {
};
// Shell and home are the last two entries
- var it = std.mem.splitBackwardsScalar(u8, std.mem.trimRight(u8, output, " \r\n"), ':');
+ var it = std.mem.splitBackwardsScalar(u8, std.mem.trimEnd(u8, output, " \r\n"), ':');
result.shell = if (it.next()) |v| try alloc.dupeZ(u8, v) else null;
result.home = if (it.next()) |v| try alloc.dupeZ(u8, v) else null;
return result;