When I switch to noecho mode, the lines following a newline are severely indented. To fix it, I have to replace \n with \r\n before sending it to the user. This doesn't happen in echo mode. Any ideas on where to start looking? Kernel code and my code seem fine so far.