'script' also does something similar, and is one of the lesser known commands.
from the man page:
script makes a typescript of everything displayed on your ter‐
minal. It is useful for students who need a hardcopy record of
an interactive session as proof of an assignment, as the type‐
script file can be printed out later with lpr(1).