Question

I have a file (output from a program) that includes VT-100 escape sequences (colors, bold face, etc.). When I open the file in Fundamental mode, the escape sequences appear as are, and are not interpreted. How can display the file with the VT-100 sequences recognized as colors, etc?

Was it helpful?

Solution

See https://unix.stackexchange.com/questions/19494/how-to-colorize-text-in-emacs

For example: put the following in your emacs init file:

(define-derived-mode fundamental-ansi-mode fundamental-mode "fundamental ansi"
  "Fundamental mode that understands ansi colors."
  (require 'ansi-color)
  (ansi-color-apply-on-region (point-min) (point-max)))

then run M-x fundamental-ansi-mode on the buffer with the escape sequences.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top