feat: bind ctrl+c and ctrl+v in ghostty #49

Merged
aleksei merged 2 commits from feat/ghostty-ctrl-bindings into main 2026-11-22 16:24:12 +00:00
Owner

What changes

Replaces the Ghostty clipboard bindings in roles/ghostty with physical-key
triggers:

  • ctrl+shift+key_v=paste_from_clipboard → ctrl+key_v=paste_from_clipboard
  • ctrl+shift+key_c=copy_to_clipboard → performable:ctrl+key_c=copy_to_clipboard

key_v/key_c are W3C physical key names, so they match the V/C keys
regardless of the active keyboard layout. Plain Unicode triggers (ctrl+v,
ctrl+c) are layout-dependent: on a Russian layout the keys produce м/с,
so the bindings do not match (Ghostty issue #15110).

performable: still makes Ctrl+C consume the input only when there is a
selection; without a selection Ghostty falls back to normal key encoding, so
Ctrl+C is delivered to the application as SIGINT in legacy encoding.

Rollout

Applied to desktop_aleksei with --tags ghostty; the role reported
changed=1 for the rendered config. /home/aleksei/.config/ghostty/config.ghostty
now contains:

keybind = ctrl+key_v=paste_from_clipboard
keybind = performable:ctrl+key_c=copy_to_clipboard

The running Ghostty instance needs a config reload with Ctrl+Shift+, (the
default reload_config binding) or a restart.

Verification

  • ansible-playbook --syntax-check playbooks/desktop_aleksei.yaml passes.
  • dprint check passes.
  • The rendered config.ghostty contains the two physical-key bindings.
  • The host's config file is owned by aleksei:aleksei with mode 0644.

Note: if an application enables the Kitty keyboard protocol, Ctrl+C without a
selection may still be reported as a CSI u sequence instead of SIGINT; that is
a separate Ghostty/kitty-protocol limitation. A dedicated Cyrillic binding can
force SIGINT, but it would replace conditional copy in that layout.

## What changes Replaces the Ghostty clipboard bindings in `roles/ghostty` with physical-key triggers: - `ctrl+shift+key_v=paste_from_clipboard` → `ctrl+key_v=paste_from_clipboard` - `ctrl+shift+key_c=copy_to_clipboard` → `performable:ctrl+key_c=copy_to_clipboard` `key_v`/`key_c` are W3C physical key names, so they match the V/C keys regardless of the active keyboard layout. Plain Unicode triggers (`ctrl+v`, `ctrl+c`) are layout-dependent: on a Russian layout the keys produce `м`/`с`, so the bindings do not match (Ghostty issue #15110). `performable:` still makes Ctrl+C consume the input only when there is a selection; without a selection Ghostty falls back to normal key encoding, so Ctrl+C is delivered to the application as SIGINT in legacy encoding. ## Rollout Applied to `desktop_aleksei` with `--tags ghostty`; the role reported `changed=1` for the rendered config. `/home/aleksei/.config/ghostty/config.ghostty` now contains: ```ini keybind = ctrl+key_v=paste_from_clipboard keybind = performable:ctrl+key_c=copy_to_clipboard ``` The running Ghostty instance needs a config reload with `Ctrl+Shift+,` (the default `reload_config` binding) or a restart. ## Verification - `ansible-playbook --syntax-check playbooks/desktop_aleksei.yaml` passes. - `dprint check` passes. - The rendered `config.ghostty` contains the two physical-key bindings. - The host's config file is owned by `aleksei:aleksei` with mode `0644`. Note: if an application enables the Kitty keyboard protocol, Ctrl+C without a selection may still be reported as a CSI u sequence instead of SIGINT; that is a separate Ghostty/kitty-protocol limitation. A dedicated Cyrillic binding can force SIGINT, but it would replace conditional copy in that layout.
aleksei deleted branch feat/ghostty-ctrl-bindings 2026-11-22 16:24:12 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
zoo/infra!49
No description provided.