This example demonstrates how to query compile-time build configuration such as SIMD support, Kitty graphics, and tmux control mode availability.
#include <stdio.h>
void query_build_info() {
bool simd = false;
bool kitty_graphics = false;
bool tmux_control_mode = false;
printf("SIMD: %s\n", simd ? "enabled" : "disabled");
printf("Kitty graphics: %s\n", kitty_graphics ? "enabled" : "disabled");
printf("Tmux control mode: %s\n", tmux_control_mode ? "enabled" : "disabled");
size_t version_major = 0;
size_t version_minor = 0;
size_t version_patch = 0;
printf(
"Version: %.*s\n", (
int)version_string.
len, version_string.
ptr);
printf("Version major: %zu\n", version_major);
printf("Version minor: %zu\n", version_minor);
printf("Version patch: %zu\n", version_patch);
if (version_pre.
len > 0) {
printf(
"Version pre : %.*s\n", (
int)version_pre.
len, version_pre.
ptr);
} else {
printf("Version pre : (none)\n");
}
if (version_build.
len > 0) {
printf(
"Version build: %.*s\n", (
int)version_build.
len, version_build.
ptr);
} else {
printf("Version build: (none)\n");
}
}
int main() {
query_build_info();
return 0;
}
GHOSTTY_API GhosttyResult ghostty_build_info(GhosttyBuildInfo data, void *out)
@ GHOSTTY_BUILD_INFO_VERSION_PATCH
@ GHOSTTY_BUILD_INFO_VERSION_PRE
@ GHOSTTY_BUILD_INFO_TMUX_CONTROL_MODE
@ GHOSTTY_BUILD_INFO_VERSION_STRING
@ GHOSTTY_BUILD_INFO_VERSION_MAJOR
@ GHOSTTY_BUILD_INFO_KITTY_GRAPHICS
@ GHOSTTY_BUILD_INFO_SIMD
@ GHOSTTY_BUILD_INFO_VERSION_BUILD
@ GHOSTTY_BUILD_INFO_VERSION_MINOR