mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-19 10:16:12 +03:00

This gets `zig build -Dtarget=aarch64-ios` working. By "working" I mean it produces an object file without compiler errors. However, the object file certainly isn't useful since it uses a number of features that will not work in the iOS sandbox. This is just an experiment more than anything to see how hard it would be to get libghostty working within iOS to render a terminal. Note iOS doesn't support ptys so this wouldn't be a true on-device terminal. The challenge right now is to just get a terminal rendering (not usable).
18 lines
579 B
Zig
18 lines
579 B
Zig
const std = @import("std");
|
|
const builtin = @import("builtin");
|
|
const Allocator = std.mem.Allocator;
|
|
|
|
/// Open a URL in the default handling application.
|
|
pub fn open(alloc: Allocator, url: []const u8) !void {
|
|
const argv = switch (builtin.os.tag) {
|
|
.linux => &.{ "xdg-open", url },
|
|
.macos => &.{ "open", url },
|
|
.windows => &.{ "rundll32", "url.dll,FileProtocolHandler", url },
|
|
.ios => return error.Unimplemented,
|
|
else => @compileError("unsupported OS"),
|
|
};
|
|
|
|
var exe = std.process.Child.init(argv, alloc);
|
|
try exe.spawn();
|
|
}
|