libghostty
Loading...
Searching...
No Matches
Build Info

Detailed Description

Query compile-time build configuration of libghostty-vt.

These values reflect the options the library was built with and are constant for the lifetime of the process.

Basic Usage

Use ghostty_build_info() to query individual build options:

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");
GhosttyString version_string = {0};
size_t version_major = 0;
size_t version_minor = 0;
size_t version_patch = 0;
GhosttyString version_pre = {0};
GhosttyString version_build = {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");
}
}

Enumerations

enum  GhosttyOptimizeMode
enum  GhosttyBuildInfo {
  GHOSTTY_BUILD_INFO_INVALID = 0 , GHOSTTY_BUILD_INFO_SIMD = 1 , GHOSTTY_BUILD_INFO_KITTY_GRAPHICS = 2 , GHOSTTY_BUILD_INFO_TMUX_CONTROL_MODE = 3 ,
  GHOSTTY_BUILD_INFO_OPTIMIZE = 4 , GHOSTTY_BUILD_INFO_VERSION_STRING = 5 , GHOSTTY_BUILD_INFO_VERSION_MAJOR = 6 , GHOSTTY_BUILD_INFO_VERSION_MINOR = 7 ,
  GHOSTTY_BUILD_INFO_VERSION_PATCH = 8 , GHOSTTY_BUILD_INFO_VERSION_PRE = 9 , GHOSTTY_BUILD_INFO_VERSION_BUILD = 10 , GHOSTTY_BUILD_INFO_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE
}

Functions

GHOSTTY_API GhosttyResult ghostty_build_info (GhosttyBuildInfo data, void *out)

Enumeration Type Documentation

◆ GhosttyBuildInfo

Build info data types that can be queried.

Each variant documents the expected output pointer type.

Enumerator
GHOSTTY_BUILD_INFO_INVALID 

Invalid data type. Never results in any data extraction.

GHOSTTY_BUILD_INFO_SIMD 

Whether SIMD-accelerated code paths are enabled.

Output type: bool *

GHOSTTY_BUILD_INFO_KITTY_GRAPHICS 

Whether Kitty graphics protocol support is available.

Output type: bool *

GHOSTTY_BUILD_INFO_TMUX_CONTROL_MODE 

Whether tmux control mode support is available.

Output type: bool *

GHOSTTY_BUILD_INFO_OPTIMIZE 

The optimization mode the library was built with.

Output type: GhosttyOptimizeMode *

GHOSTTY_BUILD_INFO_VERSION_STRING 

The full version string (e.g. "1.2.3" or "1.2.3-dev+abcdef").

Output type: GhosttyString *

GHOSTTY_BUILD_INFO_VERSION_MAJOR 

The major version number.

Output type: size_t *

GHOSTTY_BUILD_INFO_VERSION_MINOR 

The minor version number.

Output type: size_t *

GHOSTTY_BUILD_INFO_VERSION_PATCH 

The patch version number.

Output type: size_t *

GHOSTTY_BUILD_INFO_VERSION_PRE 

The pre metadata string (e.g. "alpha", "beta", "dev"). Has zero length if no pre metadata is present.

Output type: GhosttyString *

GHOSTTY_BUILD_INFO_VERSION_BUILD 

The build metadata string (e.g. commit hash). Has zero length if no build metadata is present.

Output type: GhosttyString *

Definition at line 51 of file build_info.h.

◆ GhosttyOptimizeMode

Build optimization mode.

Definition at line 38 of file build_info.h.

Function Documentation

◆ ghostty_build_info()

GHOSTTY_API GhosttyResult ghostty_build_info ( GhosttyBuildInfo data,
void * out )

Query a compile-time build configuration value.

The caller must pass a pointer to the correct output type for the requested data (see GhosttyBuildInfo variants for types).

Parameters
dataThe build info field to query
outPointer to store the result (type depends on data parameter)
Returns
GHOSTTY_SUCCESS on success, GHOSTTY_INVALID_VALUE if the data type is invalid
Examples
c-vt-build-info/src/main.c.