I remembered the name of the command I was talking about on Saturday. It is called ttyrec. It is a derivative of script. Unlike script ttyrec can record remote sessions and curses sessions. Ttyrec is the most popular way to record nethack sessions. Ttyrec has a companion command ttyplay for playing back a ttryec session.