From 129b4c269eae1860f1405b40215d544b08799947 Mon Sep 17 00:00:00 2001 From: "Guilhem C." Date: Sat, 25 Apr 2026 17:53:48 +0200 Subject: [PATCH 1/2] feat(ghostty): add config with native tabs/splits and transparency MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Initial Ghostty config for macOS, using native tabs/splits in place of tmux passthrough for in-terminal session management. Window: - Translucent background (background-opacity = 0.7) with macOS blur (background-blur-radius = 20). NOT fullscreen — macOS native fullscreen silently disables window-level transparency. Resize manually (green button or Rectangle/Spectacle); window-save-state retains the layout across launches. - macos-titlebar-style = tabs, copy-on-select to clipboard, mouse-hide-while-typing, 6px internal padding. Behavior: - macos-option-as-alt = left so emacs-style \e bindings reach the shell. On macOS, left-option composes Unicode by default (option+c → ç), which silently broke fzf-cd-widget (Alt+C) and any other Alt-prefixed zsh binding. Right option still composes accents (option+e e → é). Keybindings: - Cmd+Arrow navigates splits, Cmd+Shift+Arrow resizes, Cmd+Z toggles split zoom, Cmd+, renames the current tab, Ctrl+Tab / Ctrl+Shift+Tab cycles tabs. Co-Authored-By: Claude Opus 4.7 (1M context) --- dot_config/ghostty/config.tmpl | 44 ++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 dot_config/ghostty/config.tmpl diff --git a/dot_config/ghostty/config.tmpl b/dot_config/ghostty/config.tmpl new file mode 100644 index 0000000..44cedd4 --- /dev/null +++ b/dot_config/ghostty/config.tmpl @@ -0,0 +1,44 @@ +# Window +background-opacity = 0.7 +background-blur-radius = 20 +macos-titlebar-style = tabs +window-padding-x = 6 +window-padding-y = 6 +# Manually resize once (green button, or Rectangle/Spectacle); the layout +# is preserved across launches by window-save-state. +window-save-state = always + +# Behavior +copy-on-select = clipboard +mouse-hide-while-typing = true + +# Send Esc-prefix on left option so emacs-style bindings reach the shell +# (e.g. fzf-cd-widget on Alt+C). Right option still composes accents. +macos-option-as-alt = left + +# Keybindings +# Most defaults already match tmux muscle memory: +# Cmd+T = new tab, Cmd+W = close, Cmd+D = split right, +# Cmd+Shift+D = split down, Cmd+1-9 = goto tab + +# Navigate splits with Cmd+Arrow (default is Cmd+Alt+Arrow) +keybind = super+left=goto_split:left +keybind = super+down=goto_split:bottom +keybind = super+up=goto_split:top +keybind = super+right=goto_split:right + +# Resize splits with Cmd+Shift+Arrow (default is Cmd+Ctrl+Arrow) +keybind = super+shift+left=resize_split:left,10 +keybind = super+shift+down=resize_split:down,10 +keybind = super+shift+up=resize_split:up,10 +keybind = super+shift+right=resize_split:right,10 + +# Zoom split with Cmd+Z (default is Cmd+Shift+Enter) +keybind = super+z=toggle_split_zoom + +# Rename tab with Cmd+, (like tmux rename-window) +keybind = super+comma=set_tab_title: + +# Cycle tabs with Ctrl+Tab / Ctrl+Shift+Tab +keybind = ctrl+tab=next_tab +keybind = ctrl+shift+tab=previous_tab From 22adc101d201e34b8281ae9f58f6962bfd72bcd7 Mon Sep 17 00:00:00 2001 From: "Guilhem C." Date: Sat, 25 Apr 2026 17:32:21 +0200 Subject: [PATCH 2/2] chore(pre-commit): validate ghostty config files Catch invalid keybind actions, unknown config keys, and other ghostty-rejectable mistakes at commit time instead of at next reload. Skips silently if ghostty is not on PATH (Linux dev boxes). Caveat: validates the .tmpl as-is. The current ghostty config has no Go-template syntax, so chezmoi passes it through unchanged. If templating is added later, the hook will need to render via `chezmoi execute-template` before validating. Co-Authored-By: Claude Opus 4.7 (1M context) --- .pre-commit-config.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index dadc0f2..2d92491 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -46,6 +46,18 @@ repos: - id: trailing-whitespace args: [--markdown-linebreak-ext=md] + # Skips silently if `ghostty` is not on PATH (e.g. on Linux dev boxes). + # Note: validates the .tmpl as-is. The file currently has no Go-template + # syntax, so chezmoi passes it through unchanged. If templating is added + # later, render via `chezmoi execute-template` before validating. + - repo: local + hooks: + - id: ghostty-validate-config + name: validate ghostty config + entry: bash -c 'command -v ghostty >/dev/null || exit 0; for f in "$@"; do ghostty +validate-config --config-file="$f" || exit 1; done' -- + language: system + files: '^dot_config/ghostty/.*\.tmpl$' + - repo: meta hooks: - id: check-hooks-apply