Page MenuHomeSolus

Using cat with binary files injects garbage into terminal prompt
Closed, InvalidPublic


"cat" a binary file that isn't intended for textual output. Most of the time, depending on the exact file contents, you will see these problems:

First, the terminal prompt appears in the middle of the last line printed, not after a newline, so it looks like part of the output. (I guess this would be true of any text file which doesn't end in a newline.)

Second, you get garbage injected onto the terminal prompt which always looks like "62;c62;c62;c...". This is not just an aesthetic intrusion. You can actually hit Enter and get this "command" to try to execute. Fortunately, it's nonsense that doesn't do anything, but maybe this should be fixed before someone figures out how to abuse this.

Event Timeline

JoshStrobl closed this task as Invalid.Nov 7 2016, 10:21 AM
JoshStrobl added a subscriber: JoshStrobl.

Or maybe just don't cat a binary file? Not sure what you expected.

"cat" a binary file that isn't intended for textual output.

So then you shouldn't cat it, clearly :) VTE's are driven by control sequences in the output. Binary garbage output often trips that and mangles the
PS1 among other things. Use reset to reset your VTE. Isn't an issue