Context
Have some terminal interaction decryption files obtained using the traditional Unix script command. "
These transcripts contain many control characters (for example, backspace when editing shell commands) and many sequences of color codes as a result of running various commands. Sometimes even vibrant, full-featured (ncurses-based) applications such as "emacs -nw" or "aptitude" were executed.
At run time, the TERM environment variable was set to "xterm".
Need 1: read (more or less decided)
I need to read these files again, and sometimes copy a few small details.
The problem is that although there is not much of a problem with one color change, their actual density makes the output hardly readable. Worse, edited command lines (with cursors and edited words) are completely unreadable.
Okay Solution
Browse files using, for example, "less -r". Paging forward in the same terminal setting reproduces different colors and character.
But many other functions are more or less disturbed, for example. searching in the opposite direction creates erratic output to the terminal, often you have to press "Ctrl-L" to clear it.
Need 2: Editing
My preferred editor is emacs. Some people had a similar situation when starting a shell inside emacs, for example. Something is wrong with the Emacs shell .
This is not the situation. Examples of differences: here we do not need to run a real shell, but we need to move the cursor freely, as in normal editing.
Editing here means easily opening such a decryption file in an editor, and then:
- during editing, see character changes (color, attributes) transmitted by terminal codes
- (optionally) some character that is a neighbor on the terminal grid, but separated by some control characters in the file, will have a visual hint of this
- the ability to insert text
- delete sections
- use all editor functions, such as search / replace, etc.
- copy and paste to and from the file (including external programs that will receive only plain text)
- in my wildest dreams, something like “smoothing out” an action, for example, choosing a sequence with a highly edited command line and replacing it with a simple series of characters, as if it were printed in one pass. The "visual cues" mentioned above will disappear.