Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keybind = (blank) should restore default keybinds #5936

Closed
mitchellh opened this issue Feb 22, 2025 · 1 comment · Fixed by #5977
Closed

keybind = (blank) should restore default keybinds #5936

mitchellh opened this issue Feb 22, 2025 · 1 comment · Fixed by #5977

Comments

@mitchellh
Copy link
Contributor

Discussed in #5816

Originally posted by levito February 16, 2025
According to https://ghostty.org/docs/config#syntax, options with empty values should set them to the default. But with keybind =, all keybinds are removed, including the default ones.

Also, according to https://ghostty.org/docs/config#file-location, multiple config files are applied after one another, with the macOS config in ~/Library overwriting the ~/.config one.

With this behavior, I wanted to create two config files to have dotfiles working on both Linux and macOS:

  1. ~/.config/ghostty/config with options for both systems and keybinds for Linux
  2. ~/Library/Application\ Support/com.mitchellh.ghostty/config should then unset the Linux keybinds with keybinds = and set different ones for macOS

Did I miss anything, or is the current behavior that keybind = removes all keybinds including the default ones a bug?

@mitchellh
Copy link
Contributor Author

As an implementation note, I think the best way to do this is to pull out all our default keybind setting into a function (if it isn't already, I can't remember) and call that directly from the Keybind parse CLI flags when empty instead of clearing.

mitchellh added a commit that referenced this issue Feb 25, 2025
Fixes #5936.

Extracts the default keybind setting to an `init` function. Add logic to
call `init` in `parseIntoField` if it is defined for the type.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant