man script
says:
Certain interactive commands, such as vi(1), create garbage in the type‐ script file. Script works best with commands that do not manipulate the screen, the results are meant to emulate a hardcopy terminal.
I tried this out, starting a script session and then launching vim, and there do appear to be control characters in the output. Replaying the typescript also left some control characters on my command line after scriptreplay
had finished.
However, it did mostly work, even correctly capturing a vim session with a split window. The rogue control characters seem to be a slight annoyance rather than a fundamental issue. So is there a program similar to script
that works without this annoyance?