Ports ZIG/src/config (minus C/WASM APIs) and cli/{args,CommaSplitter,
diagnostics}.zig into ghostty-config:
- all 202 options with exact names, types, defaults and verbatim docs,
declared through one config_struct! macro; Zig's comptime reflection is
replaced by the ConfigField/CliTarget traits
- loading: default XDG files, -e, config-file includes (optional '?',
cycle detection), themes incl. light:/dark: pairs, conditional config,
replay, finalize() derived defaults, clone/changed diffing for reload
- Linux/GTK default keybinds built on ghostty_input::binding::Set
- formatter producing +show-config output
Verified against the installed Ghostty 1.3.1: `+show-config --default`
and `--default --docs` match byte for byte (except gtk-opengl-debug,
which differs between debug/release builds), as do two complex loaded
configs.
Open items (docs/rewrite/notes/ghostty-config.md): url regex needs an
Oniguruma-compatible engine (onig) in the renderer; some font/terminal
types are local copies awaiting integration; KeyRemapSet equality is
order sensitive unlike Zig.
Test Plan:
- cargo test -p ghostty-config (255 tests)
- compare `ghostty +show-config --default --docs` with our formatter
207 lines
13 KiB
Rust
207 lines
13 KiB
Rust
//! Constants for every config key (generated from the field list).
|
|
|
|
use crate::key::Key;
|
|
|
|
pub const LANGUAGE: Key = Key("language");
|
|
pub const FONT_FAMILY: Key = Key("font-family");
|
|
pub const FONT_FAMILY_BOLD: Key = Key("font-family-bold");
|
|
pub const FONT_FAMILY_ITALIC: Key = Key("font-family-italic");
|
|
pub const FONT_FAMILY_BOLD_ITALIC: Key = Key("font-family-bold-italic");
|
|
pub const FONT_STYLE: Key = Key("font-style");
|
|
pub const FONT_STYLE_BOLD: Key = Key("font-style-bold");
|
|
pub const FONT_STYLE_ITALIC: Key = Key("font-style-italic");
|
|
pub const FONT_STYLE_BOLD_ITALIC: Key = Key("font-style-bold-italic");
|
|
pub const FONT_SYNTHETIC_STYLE: Key = Key("font-synthetic-style");
|
|
pub const FONT_FEATURE: Key = Key("font-feature");
|
|
pub const FONT_SIZE: Key = Key("font-size");
|
|
pub const FONT_VARIATION: Key = Key("font-variation");
|
|
pub const FONT_VARIATION_BOLD: Key = Key("font-variation-bold");
|
|
pub const FONT_VARIATION_ITALIC: Key = Key("font-variation-italic");
|
|
pub const FONT_VARIATION_BOLD_ITALIC: Key = Key("font-variation-bold-italic");
|
|
pub const FONT_CODEPOINT_MAP: Key = Key("font-codepoint-map");
|
|
pub const CLIPBOARD_CODEPOINT_MAP: Key = Key("clipboard-codepoint-map");
|
|
pub const FONT_THICKEN: Key = Key("font-thicken");
|
|
pub const FONT_THICKEN_STRENGTH: Key = Key("font-thicken-strength");
|
|
pub const FONT_SHAPING_BREAK: Key = Key("font-shaping-break");
|
|
pub const ALPHA_BLENDING: Key = Key("alpha-blending");
|
|
pub const ADJUST_CELL_WIDTH: Key = Key("adjust-cell-width");
|
|
pub const ADJUST_CELL_HEIGHT: Key = Key("adjust-cell-height");
|
|
pub const ADJUST_FONT_BASELINE: Key = Key("adjust-font-baseline");
|
|
pub const ADJUST_UNDERLINE_POSITION: Key = Key("adjust-underline-position");
|
|
pub const ADJUST_UNDERLINE_THICKNESS: Key = Key("adjust-underline-thickness");
|
|
pub const ADJUST_STRIKETHROUGH_POSITION: Key = Key("adjust-strikethrough-position");
|
|
pub const ADJUST_STRIKETHROUGH_THICKNESS: Key = Key("adjust-strikethrough-thickness");
|
|
pub const ADJUST_OVERLINE_POSITION: Key = Key("adjust-overline-position");
|
|
pub const ADJUST_OVERLINE_THICKNESS: Key = Key("adjust-overline-thickness");
|
|
pub const ADJUST_CURSOR_THICKNESS: Key = Key("adjust-cursor-thickness");
|
|
pub const ADJUST_CURSOR_HEIGHT: Key = Key("adjust-cursor-height");
|
|
pub const ADJUST_BOX_THICKNESS: Key = Key("adjust-box-thickness");
|
|
pub const ADJUST_ICON_HEIGHT: Key = Key("adjust-icon-height");
|
|
pub const GRAPHEME_WIDTH_METHOD: Key = Key("grapheme-width-method");
|
|
pub const FREETYPE_LOAD_FLAGS: Key = Key("freetype-load-flags");
|
|
pub const THEME: Key = Key("theme");
|
|
pub const BACKGROUND: Key = Key("background");
|
|
pub const FOREGROUND: Key = Key("foreground");
|
|
pub const BACKGROUND_IMAGE: Key = Key("background-image");
|
|
pub const BACKGROUND_IMAGE_OPACITY: Key = Key("background-image-opacity");
|
|
pub const BACKGROUND_IMAGE_POSITION: Key = Key("background-image-position");
|
|
pub const BACKGROUND_IMAGE_FIT: Key = Key("background-image-fit");
|
|
pub const BACKGROUND_IMAGE_REPEAT: Key = Key("background-image-repeat");
|
|
pub const SELECTION_FOREGROUND: Key = Key("selection-foreground");
|
|
pub const SELECTION_BACKGROUND: Key = Key("selection-background");
|
|
pub const SELECTION_CLEAR_ON_TYPING: Key = Key("selection-clear-on-typing");
|
|
pub const SELECTION_CLEAR_ON_COPY: Key = Key("selection-clear-on-copy");
|
|
pub const SELECTION_WORD_CHARS: Key = Key("selection-word-chars");
|
|
pub const MINIMUM_CONTRAST: Key = Key("minimum-contrast");
|
|
pub const PALETTE: Key = Key("palette");
|
|
pub const PALETTE_GENERATE: Key = Key("palette-generate");
|
|
pub const PALETTE_HARMONIOUS: Key = Key("palette-harmonious");
|
|
pub const CURSOR_COLOR: Key = Key("cursor-color");
|
|
pub const CURSOR_OPACITY: Key = Key("cursor-opacity");
|
|
pub const CURSOR_STYLE: Key = Key("cursor-style");
|
|
pub const CURSOR_STYLE_BLINK: Key = Key("cursor-style-blink");
|
|
pub const CURSOR_TEXT: Key = Key("cursor-text");
|
|
pub const CURSOR_CLICK_TO_MOVE: Key = Key("cursor-click-to-move");
|
|
pub const MOUSE_HIDE_WHILE_TYPING: Key = Key("mouse-hide-while-typing");
|
|
pub const SCROLL_TO_BOTTOM: Key = Key("scroll-to-bottom");
|
|
pub const MOUSE_SHIFT_CAPTURE: Key = Key("mouse-shift-capture");
|
|
pub const MOUSE_REPORTING: Key = Key("mouse-reporting");
|
|
pub const MOUSE_SCROLL_MULTIPLIER: Key = Key("mouse-scroll-multiplier");
|
|
pub const BACKGROUND_OPACITY: Key = Key("background-opacity");
|
|
pub const BACKGROUND_OPACITY_CELLS: Key = Key("background-opacity-cells");
|
|
pub const BACKGROUND_BLUR: Key = Key("background-blur");
|
|
pub const UNFOCUSED_SPLIT_OPACITY: Key = Key("unfocused-split-opacity");
|
|
pub const UNFOCUSED_SPLIT_FILL: Key = Key("unfocused-split-fill");
|
|
pub const SPLIT_DIVIDER_COLOR: Key = Key("split-divider-color");
|
|
pub const SPLIT_PRESERVE_ZOOM: Key = Key("split-preserve-zoom");
|
|
pub const SEARCH_FOREGROUND: Key = Key("search-foreground");
|
|
pub const SEARCH_BACKGROUND: Key = Key("search-background");
|
|
pub const SEARCH_SELECTED_FOREGROUND: Key = Key("search-selected-foreground");
|
|
pub const SEARCH_SELECTED_BACKGROUND: Key = Key("search-selected-background");
|
|
pub const COMMAND: Key = Key("command");
|
|
pub const INITIAL_COMMAND: Key = Key("initial-command");
|
|
pub const NOTIFY_ON_COMMAND_FINISH: Key = Key("notify-on-command-finish");
|
|
pub const NOTIFY_ON_COMMAND_FINISH_ACTION: Key = Key("notify-on-command-finish-action");
|
|
pub const NOTIFY_ON_COMMAND_FINISH_AFTER: Key = Key("notify-on-command-finish-after");
|
|
pub const ENV: Key = Key("env");
|
|
pub const INPUT: Key = Key("input");
|
|
pub const WAIT_AFTER_COMMAND: Key = Key("wait-after-command");
|
|
pub const ABNORMAL_COMMAND_EXIT_RUNTIME: Key = Key("abnormal-command-exit-runtime");
|
|
pub const SCROLLBACK_LIMIT: Key = Key("scrollback-limit");
|
|
pub const SCROLLBAR: Key = Key("scrollbar");
|
|
pub const LINK: Key = Key("link");
|
|
pub const LINK_URL: Key = Key("link-url");
|
|
pub const LINK_PREVIEWS: Key = Key("link-previews");
|
|
pub const MAXIMIZE: Key = Key("maximize");
|
|
pub const FULLSCREEN: Key = Key("fullscreen");
|
|
pub const TITLE: Key = Key("title");
|
|
pub const CLASS: Key = Key("class");
|
|
pub const X11_INSTANCE_NAME: Key = Key("x11-instance-name");
|
|
pub const WORKING_DIRECTORY: Key = Key("working-directory");
|
|
pub const KEYBIND: Key = Key("keybind");
|
|
pub const KEY_REMAP: Key = Key("key-remap");
|
|
pub const WINDOW_PADDING_X: Key = Key("window-padding-x");
|
|
pub const WINDOW_PADDING_Y: Key = Key("window-padding-y");
|
|
pub const WINDOW_PADDING_BALANCE: Key = Key("window-padding-balance");
|
|
pub const WINDOW_PADDING_COLOR: Key = Key("window-padding-color");
|
|
pub const WINDOW_VSYNC: Key = Key("window-vsync");
|
|
pub const WINDOW_INHERIT_WORKING_DIRECTORY: Key = Key("window-inherit-working-directory");
|
|
pub const TAB_INHERIT_WORKING_DIRECTORY: Key = Key("tab-inherit-working-directory");
|
|
pub const SPLIT_INHERIT_WORKING_DIRECTORY: Key = Key("split-inherit-working-directory");
|
|
pub const WINDOW_INHERIT_FONT_SIZE: Key = Key("window-inherit-font-size");
|
|
pub const WINDOW_DECORATION: Key = Key("window-decoration");
|
|
pub const WINDOW_TITLE_FONT_FAMILY: Key = Key("window-title-font-family");
|
|
pub const WINDOW_SUBTITLE: Key = Key("window-subtitle");
|
|
pub const WINDOW_THEME: Key = Key("window-theme");
|
|
pub const WINDOW_COLORSPACE: Key = Key("window-colorspace");
|
|
pub const WINDOW_HEIGHT: Key = Key("window-height");
|
|
pub const WINDOW_WIDTH: Key = Key("window-width");
|
|
pub const WINDOW_POSITION_X: Key = Key("window-position-x");
|
|
pub const WINDOW_POSITION_Y: Key = Key("window-position-y");
|
|
pub const WINDOW_SAVE_STATE: Key = Key("window-save-state");
|
|
pub const WINDOW_STEP_RESIZE: Key = Key("window-step-resize");
|
|
pub const WINDOW_NEW_TAB_POSITION: Key = Key("window-new-tab-position");
|
|
pub const WINDOW_SHOW_TAB_BAR: Key = Key("window-show-tab-bar");
|
|
pub const WINDOW_TITLEBAR_BACKGROUND: Key = Key("window-titlebar-background");
|
|
pub const WINDOW_TITLEBAR_FOREGROUND: Key = Key("window-titlebar-foreground");
|
|
pub const RESIZE_OVERLAY: Key = Key("resize-overlay");
|
|
pub const RESIZE_OVERLAY_POSITION: Key = Key("resize-overlay-position");
|
|
pub const RESIZE_OVERLAY_DURATION: Key = Key("resize-overlay-duration");
|
|
pub const FOCUS_FOLLOWS_MOUSE: Key = Key("focus-follows-mouse");
|
|
pub const CLIPBOARD_READ: Key = Key("clipboard-read");
|
|
pub const CLIPBOARD_WRITE: Key = Key("clipboard-write");
|
|
pub const CLIPBOARD_TRIM_TRAILING_SPACES: Key = Key("clipboard-trim-trailing-spaces");
|
|
pub const CLIPBOARD_PASTE_PROTECTION: Key = Key("clipboard-paste-protection");
|
|
pub const CLIPBOARD_PASTE_BRACKETED_SAFE: Key = Key("clipboard-paste-bracketed-safe");
|
|
pub const TITLE_REPORT: Key = Key("title-report");
|
|
pub const IMAGE_STORAGE_LIMIT: Key = Key("image-storage-limit");
|
|
pub const COPY_ON_SELECT: Key = Key("copy-on-select");
|
|
pub const RIGHT_CLICK_ACTION: Key = Key("right-click-action");
|
|
pub const CLICK_REPEAT_INTERVAL: Key = Key("click-repeat-interval");
|
|
pub const CONFIG_FILE: Key = Key("config-file");
|
|
pub const CONFIG_DEFAULT_FILES: Key = Key("config-default-files");
|
|
pub const CONFIRM_CLOSE_SURFACE: Key = Key("confirm-close-surface");
|
|
pub const QUIT_AFTER_LAST_WINDOW_CLOSED: Key = Key("quit-after-last-window-closed");
|
|
pub const QUIT_AFTER_LAST_WINDOW_CLOSED_DELAY: Key = Key("quit-after-last-window-closed-delay");
|
|
pub const INITIAL_WINDOW: Key = Key("initial-window");
|
|
pub const UNDO_TIMEOUT: Key = Key("undo-timeout");
|
|
pub const QUICK_TERMINAL_POSITION: Key = Key("quick-terminal-position");
|
|
pub const QUICK_TERMINAL_SIZE: Key = Key("quick-terminal-size");
|
|
pub const GTK_QUICK_TERMINAL_LAYER: Key = Key("gtk-quick-terminal-layer");
|
|
pub const GTK_QUICK_TERMINAL_NAMESPACE: Key = Key("gtk-quick-terminal-namespace");
|
|
pub const QUICK_TERMINAL_SCREEN: Key = Key("quick-terminal-screen");
|
|
pub const QUICK_TERMINAL_ANIMATION_DURATION: Key = Key("quick-terminal-animation-duration");
|
|
pub const QUICK_TERMINAL_AUTOHIDE: Key = Key("quick-terminal-autohide");
|
|
pub const QUICK_TERMINAL_SPACE_BEHAVIOR: Key = Key("quick-terminal-space-behavior");
|
|
pub const QUICK_TERMINAL_KEYBOARD_INTERACTIVITY: Key = Key("quick-terminal-keyboard-interactivity");
|
|
pub const SHELL_INTEGRATION: Key = Key("shell-integration");
|
|
pub const SHELL_INTEGRATION_FEATURES: Key = Key("shell-integration-features");
|
|
pub const COMMAND_PALETTE_ENTRY: Key = Key("command-palette-entry");
|
|
pub const OSC_COLOR_REPORT_FORMAT: Key = Key("osc-color-report-format");
|
|
pub const VT_KAM_ALLOWED: Key = Key("vt-kam-allowed");
|
|
pub const CUSTOM_SHADER: Key = Key("custom-shader");
|
|
pub const CUSTOM_SHADER_ANIMATION: Key = Key("custom-shader-animation");
|
|
pub const BELL_FEATURES: Key = Key("bell-features");
|
|
pub const BELL_AUDIO_PATH: Key = Key("bell-audio-path");
|
|
pub const BELL_AUDIO_VOLUME: Key = Key("bell-audio-volume");
|
|
pub const APP_NOTIFICATIONS: Key = Key("app-notifications");
|
|
pub const MACOS_NON_NATIVE_FULLSCREEN: Key = Key("macos-non-native-fullscreen");
|
|
pub const MACOS_WINDOW_BUTTONS: Key = Key("macos-window-buttons");
|
|
pub const MACOS_TITLEBAR_STYLE: Key = Key("macos-titlebar-style");
|
|
pub const MACOS_TITLEBAR_PROXY_ICON: Key = Key("macos-titlebar-proxy-icon");
|
|
pub const MACOS_DOCK_DROP_BEHAVIOR: Key = Key("macos-dock-drop-behavior");
|
|
pub const MACOS_OPTION_AS_ALT: Key = Key("macos-option-as-alt");
|
|
pub const MACOS_WINDOW_SHADOW: Key = Key("macos-window-shadow");
|
|
pub const MACOS_HIDDEN: Key = Key("macos-hidden");
|
|
pub const MACOS_AUTO_SECURE_INPUT: Key = Key("macos-auto-secure-input");
|
|
pub const MACOS_SECURE_INPUT_INDICATION: Key = Key("macos-secure-input-indication");
|
|
pub const MACOS_APPLESCRIPT: Key = Key("macos-applescript");
|
|
pub const MACOS_ICON: Key = Key("macos-icon");
|
|
pub const MACOS_CUSTOM_ICON: Key = Key("macos-custom-icon");
|
|
pub const MACOS_ICON_FRAME: Key = Key("macos-icon-frame");
|
|
pub const MACOS_ICON_GHOST_COLOR: Key = Key("macos-icon-ghost-color");
|
|
pub const MACOS_ICON_SCREEN_COLOR: Key = Key("macos-icon-screen-color");
|
|
pub const MACOS_SHORTCUTS: Key = Key("macos-shortcuts");
|
|
pub const LINUX_CGROUP: Key = Key("linux-cgroup");
|
|
pub const LINUX_CGROUP_MEMORY_LIMIT: Key = Key("linux-cgroup-memory-limit");
|
|
pub const LINUX_CGROUP_PROCESSES_LIMIT: Key = Key("linux-cgroup-processes-limit");
|
|
pub const LINUX_CGROUP_HARD_FAIL: Key = Key("linux-cgroup-hard-fail");
|
|
pub const GTK_OPENGL_DEBUG: Key = Key("gtk-opengl-debug");
|
|
pub const GTK_SINGLE_INSTANCE: Key = Key("gtk-single-instance");
|
|
pub const GTK_TITLEBAR: Key = Key("gtk-titlebar");
|
|
pub const GTK_TABS_LOCATION: Key = Key("gtk-tabs-location");
|
|
pub const GTK_TITLEBAR_HIDE_WHEN_MAXIMIZED: Key = Key("gtk-titlebar-hide-when-maximized");
|
|
pub const GTK_TOOLBAR_STYLE: Key = Key("gtk-toolbar-style");
|
|
pub const GTK_TITLEBAR_STYLE: Key = Key("gtk-titlebar-style");
|
|
pub const GTK_WIDE_TABS: Key = Key("gtk-wide-tabs");
|
|
pub const GTK_CUSTOM_CSS: Key = Key("gtk-custom-css");
|
|
pub const DESKTOP_NOTIFICATIONS: Key = Key("desktop-notifications");
|
|
pub const PROGRESS_STYLE: Key = Key("progress-style");
|
|
pub const BOLD_COLOR: Key = Key("bold-color");
|
|
pub const FAINT_OPACITY: Key = Key("faint-opacity");
|
|
pub const TERM: Key = Key("term");
|
|
pub const ENQUIRY_RESPONSE: Key = Key("enquiry-response");
|
|
pub const ASYNC_BACKEND: Key = Key("async-backend");
|
|
pub const AUTO_UPDATE: Key = Key("auto-update");
|
|
pub const AUTO_UPDATE_CHANNEL: Key = Key("auto-update-channel");
|