working on macos

This commit is contained in:
Mitchell Hashimoto
2025-03-12 10:13:31 -07:00
parent 43467690f3
commit 7e9be00924
8 changed files with 8 additions and 8 deletions

View File

@@ -392,7 +392,7 @@ pub fn expandPath(alloc: Allocator, cmd: []const u8) !?[]u8 {
const PATH = switch (builtin.os.tag) {
.windows => blk: {
const win_path = std.process.getenvW(std.unicode.utf8ToUtf16LeStringLiteral("PATH")) orelse return null;
const path = try std.unicode.utf16leToUtf8Alloc(alloc, win_path);
const path = try std.unicode.utf16LeToUtf8Alloc(alloc, win_path);
break :blk path;
},
else => std.posix.getenvZ("PATH") orelse return null,

View File

@@ -195,7 +195,7 @@ pub fn translate(
} else false;
// Convert the utf16 to utf8
const len = try std.unicode.utf16leToUtf8(out, char[0..char_count]);
const len = try std.unicode.utf16LeToUtf8(out, char[0..char_count]);
return .{
.text = out[0..len],
.composing = composing,

View File

@@ -390,7 +390,7 @@ fn renderScreenWindow(self: *Inspector) void {
if (kitty_flags.int() != 0) {
const Flags = @TypeOf(kitty_flags);
inline for (@typeInfo(Flags).Struct.fields) |field| {
inline for (@typeInfo(Flags).@"struct".fields) |field| {
{
const value = @field(kitty_flags, field.name);

View File

@@ -28,7 +28,7 @@ pub fn render(page: *const terminal.Page) void {
{
_ = cimgui.c.igTableSetColumnIndex(1);
cimgui.c.igText("%d bytes (%d KiB)", page.memory.len, units.toKibiBytes(page.memory.len));
cimgui.c.igText("%d VM pages", page.memory.len / std.mem.page_size);
cimgui.c.igText("%d VM pages", page.memory.len / std.heap.page_size_min);
}
}
{

View File

@@ -59,7 +59,7 @@ pub fn allocTmpDir(allocator: std.mem.Allocator) ?[]const u8 {
if (builtin.os.tag == .windows) {
// TODO: what is a good fallback path on windows?
const v = std.process.getenvW(std.unicode.utf8ToUtf16LeStringLiteral("TMP")) orelse return null;
return std.unicode.utf16leToUtf8Alloc(allocator, v) catch |e| {
return std.unicode.utf16LeToUtf8Alloc(allocator, v) catch |e| {
log.warn("failed to convert temp dir path from windows string: {}", .{e});
return null;
};