There used to be a Unix program for copying text as it was typed. As I recall, the original program was called "photo", but then it changed its name, or another program took its place. (I think the program in fact copied all input and output.)
Is there such a program today?
(I actually want to save Firefox input and output.)