Is there any way to activate/deactivate the logging of all input and output on a zsh session?I am using oh-my-zsh with a customized prompt with colors, etc. and I would like to preserve all of these as possible (so that I can later open the log file in Emacs or less and have them re-parse the ansi color escape codes)Does zsh provide any functionality to facilitate this type of logging?Later on, what would be the best way to visualize the log files in Emacs (or some other editor) and have it properly parse all the  ansi color escape codes?
Logging all input and output in zsh on demand
zsh;emacs;logs
The simplest way to do this would be to use script.script is a utility which can create a TTY and then launch a program in that TTY. All output from that TTY can be logged to a file as well. It will log the raw data, including ANSI escapes.When not given a specific command to execute, it will spawn a new shell. You can use this shell as normal, and then just exit the shell when you're done.For examplescript /tmp/mylogAnd when you're done, just use CTRL+D or exit to leave the shell.