Not sure what's going on here, but if I open a file in emacs (no window mode), and just do a search (ctrl-s), the buffer gets garbled. It fixes itself when I ctrl-l, but that's annoying to have to do so frequently.

I'm using OS X's Terminal declaring terminal as xterm-256color. Text encoding Unicode (UTF-8).

I'm ssh-ing to a VM and launching emacs in that VM.

Here's an example:

enter image description here

  • 5
    I presume there's a mismatch between your actual terminal settings/capabilities, and what Emacs thinks they are. Please provide details about your terminal, for starters.
    – phils
    Commented Feb 24, 2015 at 1:31
  • @phils Edited details.
    – emecs
    Commented Feb 24, 2015 at 4:36
  • Wish I could comment, instead of posting this as an "answer" but I want to participate in finding this solution. I have the same issue using iTerm2 in Yosemite when I ssh into an ubuntu VM and run emacs there. When I search, text gets garbled, highlighting remains, and the search information creeps up from the bottom of the screen. C-l fixes it, as for OP. Changing TERM has so far had no impact.
    – mattsilver
    Commented Mar 14, 2015 at 17:47
  • Make sure you are starting Emacs without your init file: emacs -Q or emacs -Q -nw etc. Otherwise, all bets are off - we have no idea what code you might have loaded that might contribute to the symptoms described.
    – Drew
    Commented Mar 14, 2015 at 18:19

2 Answers 2


This is common problem, seems to be a bug in Emacs.

Potential solutions are;

  • turn the number of CPUs down to 1 in virtual box.
  • force display redraw in isearch (add-hook 'isearch-update-post-hook 'redraw-display)
  • use this PPA (if you're on ubuntu) ppa:martin-trojer/emacs24-termfix

Here's some references where this issue is also discussed;


Awesome @user3756658. The second option (add-hook 'isearch-update-post-hook 'redraw-display) works for me. Text in the search buffer at the bottom still behaves weirdly, but this is an excellent workaround.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.