I am not even sure this is a previous command or a non-finished command or whatever, but I do know I really don\'t like it.
My problem is that some commands (or mes
Chances are you're getting into the situation because you started a command and used your mouse to select something in a different window. If that's the case, you can have Emacs automatically abort the command when you do such an action.
This is the code you'd add to your .emacs:
(defun stop-using-minibuffer ()
"kill the minibuffer"
(when (and (>= (recursion-depth) 1) (active-minibuffer-window))
(abort-recursive-edit)))
(add-hook 'mouse-leave-buffer-hook 'stop-using-minibuffer)
Note: I grabbed this from my blog post on the topic.
And there is also a super user question that addresses this issue, and my answer there provides a command to jump back to the minibuffer.