We can record and reply a terminal/konsole session with script command and reply it with scriptreply command.
Here is the example to record the session:
$ script -t 2> timing.txt -a session.txt
Script started, file is session.txt
Now you can start typing some commands.
$ echo "Hello world"
To stop recording run exit command.
In above session we ran echo, date commands, and stored output in timings.txt and session.txt
To replay recorded session use scriptreplay as shown below:
$ scriptreplay timing.txt session.txt
It will print/replay whole session that we recorded.