mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 16:26:08 +03:00

This introduces a command palette (inspired by @pluiedev's work in #5681, but not using it as a base) for macOS. The command palette is available in the `View` menu and also bindable via `toggle_command_palette`, default binding is `cmd+shift+p` to match VSCode. The commands in the command palette must map to a _bindable_ action, though they may not have an associated keybinding. This means that any new binding actions we add in the future can be represented here and also makes it easy in the future to add configuration to add new custom entries to the command palette. For this initial PR, the available commands are hardcoded (`src/input/commands.zig`). I've noticed in other programs (VSCode, Zed), the command palette contains pretty much _all available actions_ even if they're basically useless in the context of a command palette. For example, Zed has the "toggle command palette" action in the command palette and it... does nothing (it probably should hide the palette). I followed @pluiedev's lead and made this subjective in this PR but I wonder if we should actually force all binding actions to be available. There are various other improvements I'd like to make but omitted from this PR for the sake of limiting scope: * Instead of an entry with no matches doing nothing, we can allow users to manually input _any_ configurable binding. * Localization, since macOS doesn't have any yet. But for Linux when we port this we probably have to change our strings extraction. ## Demo https://github.com/user-attachments/assets/a2155cfb-d86b-4c1a-82b5-74ba927e4d69