This set of configuration changes achieves the following:
- Disable automatic copying to clipboard while using the mouse to select text. Instead, the selection is copied
when the user types either
Ctrl+Shift+c
orSuper+c
(on macOS only) after using the mouse to select text. - The
Super+c
keybinding works by remapping it toCtrl+Shift+c
in ghostty. - Ghostty will ignore those keybindings so that tmux can handle them. This allows tmux to copy text cleanly even when scrolling through history and using split panes.
- Ghostty will still handle pasting with
Ctrl+Shift+v
orSuper+v
(on macOS only). - The
r
key can be pressed while selecting text to toggle rectangular selection on or off. - Clicking outside the selection will clear the selection.
- The selection will be displayed as inverse text on both tmux and ghostty for consistency.
- If you're using ghostty without tmux, the selection will no longer be copied.
- The
unconsumed:
target currently doesn't work withCtrl+Shift+c
andSuper+c
; once it does, that might be a good way to address the above problem.
Apply these changes to your ~/.config/ghostty/ghostty.conf
file if you're on macOS.
Apply these changes to your ~/.config/ghostty/ghostty.conf
file if you're on Linux.
It's assumed that you've installed oh-my-tmux.
The changes in this file can be added to your ~/.tmux.conf.local
file - this location might be different
depending on how you've installed oh-my-tmux.