The GNU Screen utility has the ability to log all shell output to a file, a useful feature to log the output of a long running build system, for instance.
- The log file generated by GNU Screen contains the terminal escape sequences that were output during the session.
- Although I could filter them out with some tool, I'd like to keep these escape sequences inside the log file as they color the output and help pin-point things like compiler warning and error messages.
- But I want to be able to view the file inside Emacs to process it, search for things, etc...
I'd like to visit that log file in Emacs and get Emacs render the escape code the way the shell originally did. Now what is seen is the escape sequences. Is there an Emacs major or minor mode that can do that?
Something like term-mode that would only render the text but without launching a terminal process?
- I was able to render the escape sequence by visiting the screen log file in fundamental-mode first, then launching the eshell-mode and then executing
(term-mode)
. But that's not ideal as it gets in the way by starting an active shell in the buffer. - If something already exists that'd be great, otherwise maybe it would be possible to write a major mode that acts just as a text editing mode but renders the escape sequences like term-mode does. Any suggestions?