Solved question of Using script(1) to capture console output

Dear all :
i have use script to record console output to a txt file(test.txt). when i use gedit open test.txt. the display in below with a unread word.
Code:
Script started on Wed Aug 21 15:12:18 2024
game@fb14:~/download $ 
[23Cqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
[23Cmpv --vo=tct videoBG.17363418b3c2246a0e27.mp4[K
[34C[P 
[33C[P 
[32C[P 
[32C[4hd[4l 
[33C[4hr[4l 
[34C[4hm[4l 
=[0m (+) Video --vid=1 (*) (h264 1920x1080 30.000fps)
[0m[0;31m[vo/drm/drm] VT_GETMODE failed: Inappropriate ioctl for device
[0m[0;33m[vo/drm/drm] Failed to set up VT switcher. Terminal switching will be unavailable.
[0m[0;31m[vo/drm/drm] No primary DRM device could be picked!
[0m[0;31m[vo/drm/drm] Failed to find a usable DRM primary node!
[0m[1;31mError opening/initializing the selected video_out (--vo) device.
[0m[0mVideo: no video
[0m[1;31mNo video or audio streams selected.
[0m[0mExiting... (Errors when loading file)
[0m>game@fb14:~/download $ q

but , when i use cat test.txt in console , that will display right . 
Script started on Wed Aug 21 15:12:18 2024
game@fb14:~/download $ mpv --vo=drm videoBG.17363418b3c2246a0e27.mp4
 (+) Video --vid=1 (*) (h264 1920x1080 30.000fps)
[vo/drm/drm] VT_GETMODE failed: Inappropriate ioctl for device
[vo/drm/drm] Failed to set up VT switcher. Terminal switching will be unavailable.
[vo/drm/drm] No primary DRM device could be picked!
[vo/drm/drm] Failed to find a usable DRM primary node!
Error opening/initializing the selected video_out (--vo) device.
Video: no video
No video or audio streams selected.
Exiting... (Errors when loading file)
game@fb14:~/download $ q
any one can tell me how to modify the gedit to display normal ? thanks ...
 
The 'cryptic' stuff you see are escape sequences produced by the shell for e.g. use colored output.
Just
cat typescript test.txt
and you get it as it was seen.

To be more correct:
Those escape sequences are codes to control the terminal's output.
 
What is the “unread word”? Everyone thinks you are talking about the control codes/escape sequences like [0m but maybe you mean something else?
dear richardtoohey2:
unread word like as
[34C[P
[33C[P
[32C[P
[32C[4hd

i don't know what is it when gedit opening test.txt. thanks.
 
Back
Top