I recently updated to emacs 25.1, and I'm noticing that sometimes escape sequences like [<8;38;34m or [<8;20;27m are being inserted into my document. I use emacs in the terminal (emacs -nw). I use iTerm2 on macOS.

I haven't yet figured out what I do when this happens (I have thus far only noticed it after it happened). If I do I'll post more here.

Can any shed some light on what might be causing this? I can't figure out what ANSI escape sequence this might be. I haven't found a great list of sequences, but none of the ones I've seen have anything close to this.

  • This is an escape sequence that the terminal sends to report mouse events. See ctlseqs, the SGR variant. CSI is ESC [. It appears that the terminal is sending these escape sequences but Emacs doesn't support them. Are you running Emacs from some other program in the same terminal that might have activated mouse reporting? Can you reproduce this with emacs -q (and if not post a .emacs that reproduces the problem)? With emacs -Q? Sep 26, 2016 at 20:18
  • Well so far I can't figure out how to reproduce it at all, but once I do I'll play around with it.
    – asmeurer
    Sep 26, 2016 at 20:23

1 Answer 1


It looks like emacs 28.1 has fixed whatever was causing this. Quite a few things relating to terminal mouse reporting are much better in emacs 28.1.

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.