onlcr
is for translating outgoing newlines to carriage returns.
stty -F /dev/ttyS0 inlcr
will translate incoming newlines to carriage returns. You can run that from another terminal after starting screen to avoid any resetting that screen may do on startup. Unfortunately however, this will only change the problem. You'll then get only returns and no newlines.
What is needed is an option to append a return to an incoming newline so that the terminal receives \n\r
, which is what the serial device should have output in the first place. There seems to be an onlret
option to do this for outgoing data, but no inlret
option as we would seem to need in this case.
I have the exact same problem (using picocom though) and I've been googling off and on for days trying to find the standard fix, but no one seems to have one. There are a number of serial devices out there which only output \n
and simply can't be made to output \r\n
and I refuse to believe that all of them belong to only two linux users. What gives!?
stty
setting? Though I find it strange that you see that when reading.stty
instructs the terminal to treat a newline as if it were a newline and carriage return. Otherwise we can see the terminal moves to the next line but does not return the index pointer to the beginning of the line, like it would if\r
had been sent along with\n
.