make +version hyperlink to the github commit

This commit is contained in:
xdBronch
2024-09-02 00:09:57 -04:00
committed by Mitchell Hashimoto
parent 5d476135c5
commit b748ae6c0f

View File

@ -10,7 +10,17 @@ pub fn run(alloc: Allocator) !u8 {
_ = alloc; _ = alloc;
const stdout = std.io.getStdOut().writer(); const stdout = std.io.getStdOut().writer();
const tty = std.io.getStdOut().isTty();
if (tty) if (build_config.version.build) |commit_hash| {
try stdout.print(
"\x1b]8;;https://github.com/ghostty-org/ghostty/commit/{s}\x1b\\",
.{commit_hash},
);
};
try stdout.print("Ghostty {s}\n\n", .{build_config.version_string}); try stdout.print("Ghostty {s}\n\n", .{build_config.version_string});
if (tty) try stdout.print("\x1b]8;;\x1b\\", .{});
try stdout.print("Build Config\n", .{}); try stdout.print("Build Config\n", .{});
try stdout.print(" - Zig version: {s}\n", .{builtin.zig_version_string}); try stdout.print(" - Zig version: {s}\n", .{builtin.zig_version_string});
try stdout.print(" - build mode : {}\n", .{builtin.mode}); try stdout.print(" - build mode : {}\n", .{builtin.mode});