syl20bnr / spacemacs

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!
http://spacemacs.org
GNU General Public License v3.0
23.67k stars 4.89k forks source link

ESC not mapped in magit commit buffer #12980

Closed arnar closed 3 years ago

arnar commented 4 years ago

Description :octocat:

When I open a magit commit buffer (e.g. with SPC g c c or SPC g c w), it starts in insert mode and ESC does not work to go to normal mode.

ESC seems to be unmapped (C-h k ESC asks for further input).

M-x evil-normal-state does work, and after that evil mappings work fine, i.e. I can enter insert mode with i and get back to normal with ESC. C-h k ESC shows that it's correctly mapped to (evil-force-normal-state).

Reproduction guide :beetle:

Observed behaviour: :eyes: :broken_heart: ESC is unmapped, asks for next key in chord.

Expected behaviour: :heart: :smile: ESC escapes to normal mode.

System Info :computer:

duianto commented 4 years ago

Do you have any Magit related user customizations?

I think COMMIT_EDITMSG buffer has opened in normal state for me ever since I started using Spacemacs 3+ years ago.

When I was first learning the evil bindings I thought that it might be better if it opened in insert state so that one could start typing.

But I've gotten used to it opening in normal state. It might have become a reflex to press i before starting to type. And Esc to start editing or confirming the commit message.

I just tested the issues reproduction steps in both Linux and Windows. And the commit buffer opens in normal state.


Did you mean to state the key bindings as SPC g m c c?

Because SPC g c calls magit-clone.

SPC g m calls magit-dispatch which opens the Magit transient buffer With the key bindings sections:

Where c calls commit. And c (in the Create section) calls Commit, which opens the COMMIT_EDITMSG buffer.

System Info

PopOS 19.10
#### System Info :computer:
- OS: gnu/linux
- Emacs: 26.3
- Spacemacs: 0.300.0
- Spacemacs branch: develop (rev. cab1e6958)
- Graphic display: t
- Distribution: spacemacs
- Editing style: vim
- Completion: helm
- Layers:
```elisp
(auto-completion command-log emacs-lisp git helm markdown multiple-cursors
                 (org :variables org-agenda-files
                      '("~/org/notes.org"))
                 python
                 (shell :variables shell-default-height 30 shell-default-position 'bottom)
                 spell-checking syntax-checking treemacs version-control)
```
- System configuration features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS GLIB NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM THREADS LIBSYSTEMD LCMS2
Windows 1903
#### System Info :computer:
- OS: windows-nt
- Emacs: 26.3
- Spacemacs: 0.300.0
- Spacemacs branch: develop (rev. cab1e6958)
- Graphic display: t
- Distribution: spacemacs
- Editing style: vim
- Completion: ivy
- Layers:
```elisp
(autohotkey
 (auto-completion :variables auto-completion-return-key-behavior nil auto-completion-complete-with-key-sequence nil auto-completion-complete-with-key-sequence "jk")
 (colors :variables)
 command-log dap debug emacs-lisp git ivy json java
 (javascript :variables javascript-backend 'lsp)
 markdown multiple-cursors
 (org :variables)
 (python :variables)
 react shell spell-checking syntax-checking treemacs typescript version-control)
```
- System configuration features: XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS THREADS LCMS2
arnar commented 4 years ago

Thanks! Turns out this bug shows up only on my employer's custom emacs distro, which is based on 26.3. Using debian's 26.1 distribution does not have this bug. So I'll file a bug internally.

But to answer:

I have no Magit related custom config. I just tried with a vanilla .spacemacs file on the dev branch, with the only change of enabling the git layer, and am able to reproduce (starts in insert mode, ESC not mapped).

Indeed I had a typo, I meant SPC g s c c (staging a change in the status buffer, if needed).

github-actions[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!