Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to recognize VT-100 escape sequences when reading a file

Tags:

emacs

vt100

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?

like image 733
sawa Avatar asked Oct 20 '25 07:10

sawa


1 Answers

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.

like image 99
Joost Diepenmaat Avatar answered Oct 22 '25 02:10

Joost Diepenmaat



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!