I wish to be able to open current shell output in emacs, for that I use script command that logs all the output into file typescript. The problem is that it consist also with terminal codes for colors and other necessary stuff, which is not parsed by emacs. I found function display-ansi-colors and it displays part of term sequences correctly, but a lot of them still undecoded. I using "xterm-256color" terminal. Is there a way to decode all term sequences correctly in emacs buffer?

  • 3
    Can you provide a recipe for demonstrating the problem?
    – phils
    Commented Nov 8, 2017 at 0:21
  • Also, is stackoverflow.com/q/22083177 relevant to your problem?
    – phils
    Commented Nov 8, 2017 at 0:23

1 Answer 1


What I've done is inside the shell that script starts I export TERM=dumb and then after I'm done I exit the shell and clear out any remaining ANSI sequences in the typescript file using ansifilter --plain

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.