Home » Questions » Computers [ Ask a new question ]

How to correct the unrecognizable code in my debian?

How to correct the unrecognizable code in my debian?

After running programs that output unrecognizable code, the whole shell would be full of unrecognizable code.

Asked by: Guest | Views: 244
Total answers/comments: 1
bert [Entry]

"SI/SO VT100 Control Characters
The garbled characters are likely due to the terminal getting a SI character (Shift In; ASCII 14; Control-N). SI is a VT100 control character that can cause the terminal to switch to an alternate character set. Many real terminals (e.g. an actual hardware device, or just the text-only console of an OS) and terminal programs honor this escape code.
The direct way to switch back to the normal character set is to send a SO character (Shift Out; ASCII 15; Control-O) to the terminal.
Recovery
Because the character set is switched, you may have to type the recovery commands “blind” (without relying on seeing what you have typed).
Usually the echo command will be useful. Often you can type
E C H O Space Control-V Control-O Enter / Return
to get the terminal to see a Control-O (the Control-V tells the input-side of the terminal that the next is to be passed literally, otherwise the input side will ‘eat’ the character before it gets the the shell and thus before it can be sent back to the output side of the terminal).
If you can assume a reasonable shell with a printf builtin (or no shell builtin and a reasonable external printf command), you can use printf '\017' to send a Control-O to the terminal."