If Magit's log is open and you hit RET on any of the commits, it opens a visit file/blob window where you can see the diff with some details. There's a few ways to do it, but I believe in Doom Emacs the default is magit-diff-visit-file-other-window where it will spawn a new window if you only have one, otherwise it will try to use one of the existing windows.

If you only have 1 window open (with Magit status/log), it will spawn another window on the right side of the screen with commit details. After you close that window, you're back to your full-screen magit status/log buffer (OK).

However, if you already have a 2 windows open (e.g. vertically split), Magit will spawn the view-commit buffer in your other window, but after you close it (via q), it will not return focus to the status/log buffer, so you will have to do it manually. This is very disruptive if you're visiting many commits. I'm fairly positive this behaviour was different back when I was using an older Magit/Spacemacs a few years back, but I can't tell now whether it's new Magit's behaviour, or is it Doom Emacs or something else.

TL;DR: Magit doesn't return focus to status/log buffer after you close visit-file/blob window.


  • I've tried searching through issues in magit repo but couldn't find anything matching, hence posting it here hoping someone might know the answer.
  • I'm running vanilla freshly installed Doom, with just a few lines of config, so I believe this would be easily reproducible.
  • Environment: macOS, brew-installed Emacs 27.1, latest vanilla Doom 2.0.9.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.