When I tried to look at the binary file with cat, the characters were garbled and I got a cold sweat. I will write a coping method and alias setting that summarizes the information lying on the Web.
reset
Reset the terminal with the reset command. It seems that this may not fix it. In that case, reset ** with a stronger method than the reset command.
echo ^[c
echo Type "space" "Ctrl + v" "Esc" "c" "Enter".
alias clearbin="echo -e '\ec'"
Since it clears what became binary, I simply made it clearbin. I am trying to interpret the escape character with echo -e. e becomes "Esc" and c remains the same.
I didn't understand why it was fixed in the second solution, so I investigated it.
echo
echo When you press "Space" and "Ctrl + v", it looks like this. "Ctrl + v" is a preparation for inputting "Esc", and nothing is displayed when it is a single unit. It seems that this preparation is necessary because you can not enter by just pressing "Esc".
echo ^[
Then press "Esc" and it will look like this.
echo ^[c
In addition to that, enter "c" It seems that "Esc" and "c" can reset the terminal more powerfully than the reset command. Finally, press "Enter" to finish.
It seems that "Esc" can be represented in octal or hexadecimal when set to alias.
alias clearbin="echo -e '\033c'"
alias clearbin="echo -e '\0x1bc'"
About ANSI escape sequences What does printf(“\033c” ) mean?
Recommended Posts