Skip to content

Support Ctrl+Enter to confirm commit #4530

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

Open
KnapSac opened this issue May 3, 2025 · 4 comments
Open

Support Ctrl+Enter to confirm commit #4530

KnapSac opened this issue May 3, 2025 · 4 comments
Labels
enhancement New feature or request

Comments

@KnapSac
Copy link

KnapSac commented May 3, 2025

Is your feature request related to a problem? Please describe.
When inside the commit description part of the commit dialog, the default keybind to commit is Alt+Enter. This is unfortunate, because it's also bound to toggle fullscreen in Windows Terminal. I tried to change the keybind by setting keybind.universal.confirmInEditor to <c-enter>, but that is not a supported option.

Describe the solution you'd like
I'd prefer <c-enter> as the default keybind, this is a common UI pattern on the web. I'd also be fine to have it be configurable. I don't know whether the keybind.universal.confirmInEditor setting is used for this, but if so it should probably support <c-enter>.

#1700 might be related, but I believe that it's outdated as Alt+Enter is no longer used to enter newlines in the commit message, which you can now do using Enter itself.

I'd be happy to look into implementing this.

@KnapSac KnapSac added the enhancement New feature or request label May 3, 2025
@stefanhaller
Copy link
Collaborator

Duplicate of #4397 (and #4502).

I'd be happy to look into implementing this.

This is very non-trivial. You'd first have to implement gdamore/tcell#671, and then add support for this in gocui.

Given the number of users having problems with this (see also #4375 (comment)) I'm wondering if we should change the default keybinding to something like <c-s> for the time being, to at least make it work everywhere. @jesseduffield Any opinion on that?

@KnapSac
Copy link
Author

KnapSac commented May 3, 2025

Wow, I really suck at searching today, my bad!

c-s does seem like a better default in my opinion.

@jesseduffield
Copy link
Owner

It sounds like we should leave <c-enter> as-is but add an additional keybinding of <c-s>

@stefanhaller
Copy link
Collaborator

It sounds like we should leave <c-enter> as-is but add an additional keybinding of <c-s>

Ok, added in #4532.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants