When using the arrow keys in an application running on a 9600 baud serial port I get frequent garbage characters such as [A and [D which are of course broken escape codes.
-- Read at least one character of input, and more if immediately
-- available. In particular the characters making up a control sequence
-- will all be available at once, so they can be processed together
-- (with Posix.lexKeys).
I don't think that is a workable assumption on a slow serial port.
I originally detected this issue in an oddball serial port and pseudo terminal configuration which gave me an easy way to inspect traffic:
In this example I pressed right arrow 4 times. It worked correctly 3 times and then I got [C on the screen. The correct data is getting through, but it is clearly not interpreting the escape code.
Escape codes should still be recognized even if they do not arrive all at once.
When using the arrow keys in an application running on a 9600 baud serial port I get frequent garbage characters such as
[A
and[D
which are of course broken escape codes.This source code has the following comment:
I don't think that is a workable assumption on a slow serial port.
I originally detected this issue in an oddball serial port and pseudo terminal configuration which gave me an easy way to inspect traffic:
In this example I pressed right arrow 4 times. It worked correctly 3 times and then I got
[C
on the screen. The correct data is getting through, but it is clearly not interpreting the escape code.Escape codes should still be recognized even if they do not arrive all at once.
Possibly related to case #77.