A carriage return is interpreted specifically by CodeMirror (when it is on its own, it creates a line break when it will be ignored before the line feed), so in this case you cannot.
But other non-printable characters (e.g. \b ) will appear as red dots by default, and you can adapt the corresponding cm-invalidchar CSS class to customize their appearance.
Marijn
source share