Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Bug 159803: PTY in console mode on Windows

Corbat Thomas wrote:
> Input:
> asdf<Enter>
> Output:
> a
> s
> d
> f
> Now, when I enable winpty in console mode I get the following output with the same input:
> fsdf
> Yes, it is actually starting with an ‘f’ and I don’t get linebreaks. Honestly, I would not have believed that if hadn’t seen it myself. When I terminate the Input with ctrl+z, the program terminates without finishing properly, i.e. output after the while loop is omitted.

That looks less like a fault of your program and more like something further down the pipeline mangling carriage returns and line feeds to me. An 'f' at the beginning of the line is what I would expect when your program outputs a CR (without an LF) before the 'f' and the terminal interprets that as "return to the beginning of the line but don't advance to the next line". That doesn't explain however why the 'f' appears a second time and why the other characters aren't all stacked in the first position as well, so there must be something else going on.

Not familiar with either the CDT console nor with how MinGW iostreams handles line endings, that's all I can say.


Back to the top