chromium / axiom

Axiom Project
https://chromium.github.io/axiom/web_shell/
Apache License 2.0
53 stars 26 forks source link

`cat some_binary_file` prints the contents, but leaves terminal in broken state #125

Open ussuri opened 9 years ago

ussuri commented 9 years ago

E.g. cat some.pdf:

...
Q�9�␊W���°��Ԣ�漣��≠⎺┐��R�│�*���FL��\���·5���R��ݗ�⎻���≥-�£┘���EC
�]A⎺␍�Ȱ�R����␋┬+�␤\����,��M&├�?5�B�3�£��┌�M���ٷ"΃���T�≤���E�
�°�ڸ␌▒├: ±␍⎼␋┴␊:/▒/␉/⎻.⎻␍°: T≤⎻␊E⎼⎼⎺⎼: C▒┼┼⎺├ ⎼␊▒␍ ⎻⎼⎺⎻␊⎼├≤ '⎻␊
␊┐R␊└▒␋┼␋┼±B┤°' ⎺° ┤┼␍␊°␋┼␊␍
±␍⎼␋┴␊:/▒/␉> 

The last line above is what the prompt becomes after this. This broken state is unrecoverable. Also, an attempt to type something in the prompt prints wrong ASCII chars (upper half).

At the same time, the console shows warnings:

...
Ignored CC1 code: ""
hterm.amd.js:10832 Ignored CC1 code: "\u0013"
hterm.amd.js:10826 Unknown ESC code: "\u0004"
hterm.amd.js:10832 Ignored CC1 code: "\u0011"
hterm.amd.js:10832 Ignored CC1 code: "\u0005"