record and replay interactive terminal sessions