Saturday, 30 January 2016

Editable garbage printed at bash prompt after printing binary file in an xterm

Sometimes I would have garbage printed at the bash prompt in xterm after printing a binary file, like


I've never got around to work out why, until now.

The reason is the presence of byte 9A in the file. See This is the "DECID" control sequence, which should cause the terminal to send a response string (as if it had been typed by the operator). Equivalent to DA or "Send Device Attributes". The response string in this case is


with some more bytes at the beginning (ESC ? or ESC >, I'm not sure which).

No comments:

Post a Comment