jesseduffield.lazygit/pkg/config
Stefan Haller e81cfdba33 Add a keybinding for toggling mouse capture at runtime (%)
Some terminals provide a modifier key that bypasses mouse capture so
that text can be selected with the mouse and copied to the clipboard
(option in iTerm, shift in Ghostty), but others don't (e.g. the
terminals built into VS Code and Zed). In those, selecting text
requires setting gui.mouseEvents to false in the config file and back
again afterwards, which is inconvenient.

Add a global keybinding (% by default) that toggles mouse capture on
the fly. Like the whitespace toggle, it flips the in-memory config
value, so the toggled state lasts until the config file is changed and
reloaded.

The key needs to be free in every panel, and % is; as a plain rune it
also arrives reliably in every terminal on all platforms, and it can't
fire while typing in a text prompt, since editors consume plain runes.
An alt-based binding would have been more mnemonic, but doesn't reach
lazygit in the built-in terminals of VS Code and Zed on macOS (the
very terminals that need this feature) unless the option key is
configured to act as meta; and a ctrl-based binding would burn one of
the few remaining free ctrl keys, which are better saved for future
features that get used more frequently.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 17:21:18 +02:00
..
app_config.go Allow overriding the platform used for default keybindings 2026-07-03 19:08:22 +02:00
app_config_test.go Allow overriding the platform used for default keybindings 2026-07-03 19:08:22 +02:00
config_default_platform.go Clean up build tags 2025-08-14 20:40:44 +02:00
config_linux.go Fix opening links containing ampersands (&) in WSL 2024-12-04 09:43:30 +01:00
config_windows.go Change OpenCommand to Open and OpenLinkCommand to OpenLink 2023-04-13 13:14:00 +02:00
dummies.go Fold legacy quit-alt1 into the multi-key quit binding 2026-05-25 15:32:47 +02:00
editor_presets.go fix(config): add Nushell support for nvim-remote preset 2026-02-07 09:00:10 +01:00
editor_presets_test.go Fix nvim-remote commands for fish shell 2025-04-27 20:12:11 +02:00
keybinding.go Fold legacy quit-alt1 into the multi-key quit binding 2026-05-25 15:32:47 +02:00
keybinding_test.go Fold legacy quit-alt1 into the multi-key quit binding 2026-05-25 15:32:47 +02:00
keynames.go Convert keybinding fields to Keybinding 2026-05-25 15:32:47 +02:00
keynames_test.go Change keybinding syntax to spell out full modifier names, and use + instead of - 2026-04-30 22:38:53 +02:00
pager_config.go Allow cycling pagers in reverse 2026-06-07 15:51:57 +02:00
pager_config_test.go Allow cycling pagers in reverse 2026-06-07 15:51:57 +02:00
side_panel.go Add the gui.sidePanels config option 2026-06-23 14:15:18 +02:00
user_config.go Add a keybinding for toggling mouse capture at runtime (%) 2026-07-10 17:21:18 +02:00
user_config_validation.go Stop requiring jumpToBlock to have exactly five entries 2026-06-23 14:15:18 +02:00
user_config_validation_test.go Stop requiring jumpToBlock to have exactly five entries 2026-06-23 14:15:18 +02:00