From b748ae6c0f8c1f14d459f0b47700f58d18ceb592 Mon Sep 17 00:00:00 2001 From: xdBronch <51252236+xdBronch@users.noreply.github.com> Date: Mon, 2 Sep 2024 00:09:57 -0400 Subject: [PATCH] make +version hyperlink to the github commit --- src/cli/version.zig | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/cli/version.zig b/src/cli/version.zig index 1366c99c8..cb6cf36de 100644 --- a/src/cli/version.zig +++ b/src/cli/version.zig @@ -10,7 +10,17 @@ pub fn run(alloc: Allocator) !u8 { _ = alloc; 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}); + if (tty) try stdout.print("\x1b]8;;\x1b\\", .{}); + try stdout.print("Build Config\n", .{}); try stdout.print(" - Zig version: {s}\n", .{builtin.zig_version_string}); try stdout.print(" - build mode : {}\n", .{builtin.mode});