Lately I’ve been encountering this weird behaviour where out of nowhere,
especially when switching buffers, the minibuffer will arrest focus, and
I have to use ‘other-window’ or similar to escape. This is not when I’m
prompted anything, the focus remains in the empty minibuffer like in any
other buffer, and if I try ‘C-x b’, I get
user error: Cannot switch buffers in minibuffer window
Because of this, I can’t switch buffers sometimes; when I hit C-x b,
when the relevant prompt appears, it tries to switch buffers in the
minibuffer window, leading to the above error. I can’t ‘keyboard-quit’
my way out of this, because, while that does quit the prompt, I’m then
stuck in the minibuffer window, and I need to use window selection
commands like I said above to be able to leave. Which works fine, but
then I can no longer use ‘switch-to-buffer’ in that frame without this
issue repeating, so I can’t switch buffers and lose my layout.