Emacs text gets stuck in minibuffer

佐手、 提交于 2019-12-14 01:14:49

问题


I am using GNU Emacs 24.4.1 (edit: also seen with 24.5.1). Some old output from vc-mode (I think) is appearing in the minibuffer:

Auto-merging foo/bar

I am not doing any version control operations at the moment, but this text is stuck in the minibuffer. Pressing C-g replaces it briefly with Quit, but it comes back with the next keystroke.

What it isn't: it's not a recursive edit. C-] or abort-recursive-edit gives the error No recursive edit is in progress and the awkward text in the minibuffer is still there.

It's not text selected with the mouse since I am running in a text console (GNU screen session over ssh) with no mouse support.

I have tried the switch-to-minibuffer command from http://www.emacswiki.org/emacs/MiniBuffer but that gives the error Minibuffer is not active. Yet still this awkward text keeps appearing.

It is not a screen size problem (with stale text because Emacs is not aware of the correct size of the terminal window) because I can resize the terminal window and Emacs resizes with it correctly... with the text still displayed in the minibuffer.

Sometimes I have seen this effect with two or more lines of text in the minibuffer. In fact, my current Emacs session has that in one client session (emacsclient -nw) in one screen, with the main session showing only one line. The client session shows several lines of version control gunk in the minibuffer:

Auto-merging foo/bar
CONFLICT (content): Merge conflict in foo/bar

How can I make it go away?


回答1:


This could happen if you hit C-g to terminate a running shell command. This would leave the minibuffer window pointing to the *Shell Command Output* buffer.

As described in bug #25209, you could check whether that has happened by calling (minibuffer-window) in the scratch buffer:

(minibuffer-window)
#<window 2 on *Shell Command Output*>

and fix it with:

(set-window-buffer (minibuffer-window) (get-buffer " *Minibuf-0*"))

This has been fixed in this commit, and the fix was released as part of Emacs 26.1.



来源:https://stackoverflow.com/questions/31022976/emacs-text-gets-stuck-in-minibuffer

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!