Repository navigation
Expand file tree
/
Copy pathconfig.zig
More file actions
58 lines (44 loc) · 1.96 KB
/
Copy pathconfig.zig
File metadata and controls
58 lines (44 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
const std = @import("std");
const build_options = @import("build_options");
pub const macos_gui_tests = build_options.macos_gui_tests;
pub const Backend = enum {
fbdev,
x11,
wayland,
macos,
};
pub const backend: Backend = if (build_options.use_macos) .macos else if (build_options.use_wayland) .wayland else if (build_options.use_x11) .x11 else .fbdev;
pub const default_fg: u8 = 7;
pub const default_bg: u8 = 0;
pub const font_width: u32 = 8;
pub const font_height: u32 = 16;
pub const scale: u32 = build_options.scale;
pub const cell_width: u32 = font_width * scale;
pub const cell_height: u32 = font_height * scale;
comptime {
if (scale != 1 and scale != 2 and scale != 4) {
@compileError("scale must be 1, 2, or 4");
}
}
pub const Keymap = enum {
us,
jp,
};
pub const keymap: Keymap = if (build_options.use_jp_keymap) .jp else .us;
pub const max_fps: u32 = build_options.max_fps;
/// Minimum nanoseconds between frames. 0 = unlimited.
pub const frame_min_ns: u64 = if (max_fps == 0) 0 else 1_000_000_000 / max_fps;
pub const pty_buf_size: u32 = build_options.pty_buf_kb * 1024;
/// Number of scrollback rows for the main screen. 0 disables scrollback at
/// compile time (zero overhead).
pub const scrollback_lines: u32 = build_options.scrollback_lines;
/// Lines scrolled per mouse-wheel notch.
pub const scrollback_wheel_lines: u32 = 3;
/// When true, the mouse wheel scrolls the alt-screen scrollback ring while
/// in alt screen (instead of translating to arrow keys). Opt-in: enables
/// wheel-driven history browsing inside apps like `codex` that enter alt
/// screen without enabling mouse tracking. Default false preserves
/// `less`/`nano`/`vim` wheel-as-arrow behaviour.
pub const alt_screen_wheel_scrollback: bool = build_options.alt_screen_wheel_scrollback;
pub const shell: [:0]const u8 = std.mem.span(@as([*:0]const u8, build_options.shell));
pub const version: [:0]const u8 = std.mem.span(@as([*:0]const u8, build_options.version));