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

Fix empty keybind setting #5977

Merged
merged 5 commits into from
Feb 25, 2025

Conversation

unknown
Copy link
Contributor

@unknown unknown commented 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.

@unknown unknown force-pushed the unknown/fix-empty-keybind branch from b8097ee to a38f34c Compare February 25, 2025 03:43
@unknown unknown force-pushed the unknown/fix-empty-keybind branch from a38f34c to 22d99f2 Compare February 25, 2025 04:39
@unknown unknown requested a review from jcollie February 25, 2025 14:28
Copy link
Contributor

@mitchellh mitchellh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One easy request.

A couple notes for the future (we should NOT do them in this PR, just to keep things simple, but can follow up):

  1. We should move the keybindings out to a dedicated file. They've been causing too much noise in Config.zig for too long and this reminded me. src/config/keybinding.zig or something.

  2. We should make a src/cli/args.init function that takes a struct and uses comptime to find all the fields that have an init and call them so that we have one place we can always use to default any "config" structure (we use args for other stuff too).

@unknown unknown requested a review from mitchellh February 25, 2025 15:31
Copy link
Contributor

@mitchellh mitchellh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies, one small thing. I'd fix it myself but not at a PC rn.

@mitchellh mitchellh enabled auto-merge February 25, 2025 16:55
@mitchellh
Copy link
Contributor

Perfect. Thanks!

@unknown
Copy link
Contributor Author

unknown commented Feb 25, 2025

Apologies, one small thing. I'd fix it myself but not at a PC rn.

Perfect. Thanks!

No worries! I can work on the followups when I get the chance.

@mitchellh mitchellh merged commit 0b7df75 into ghostty-org:main Feb 25, 2025
27 of 29 checks passed
@github-actions github-actions bot added this to the 1.2.0 milestone Feb 25, 2025
@unknown unknown deleted the unknown/fix-empty-keybind branch February 25, 2025 17:18
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 this pull request may close these issues.

keybind = (blank) should restore default keybinds
3 participants