How can I read the terminal input on a tty device before a newline arrives?
问题 I am reading a serial device using embedded linux (angstrom) using open(), tcget/setattr(), read(). I can read and write data just fine. However, the device I am reading displays a prompt that is not terminated with a newline. This means I can't read the prompt until after I cause the device to send some other output that has a newline at the end. Basically, I know the prompt string ("COM3>") is sitting in the tty buffer waiting for the device to send a newline. read() won't access the "COM3>