I want to use the tool 'script' in order to store everything I do in a terminal to a file, with a timestamp if possible. However, I receive output with control characters which makes the output hard to read and unusable for an assignment. This is what a logfile looks like:
Script started on 2023-08-12 12:33:49+02:00 [TERM="xterm-kitty" TTY="/dev/pts/2" COLUMNS="213" LINES="50"]
^[]0;user@arch:~/Documents/Test^G^[[?2004h[user@arch Test]$ echo^H^[[K^H^[[K^H^[[K^H^[[K^G^G^G^G^G^G^Gecho test
^[[?2004l^Mtest
^[]0;user@arch:~/Documents/Test^G^[[?2004h[user@arch Test]$ clear
^[[?2004l^M^[[H^[[2J^[]0;user@arch:~/Documents/Test^G^[[?2004h[user@arch Test]$ exit
^[[?2004l^Mexit
Script done on 2023-08-12 12:34:09+02:00 [COMMAND_EXIT_CODE="0"]
As you can see I am using kitty, which might be part of the problem. However I dont know how to resolve it. The logfile should usually just contain what I saw in the terminal.