http://bugs.winehq.org/show_bug.cgi?id=49780
--- Comment #11 from Forest forestix@gaga.casa --- Created attachment 79366 --> http://bugs.winehq.org/attachment.cgi?id=79366 bug 58665 reproducer: should print 3 lines; wine prints 4 lines
This is a reproducer for bug 58665: "cmd incorrectly wraps text containing ANSI escape sequences". That bug was closed as a duplicate of this one, reducing the visibility of its different symptoms. I am therefore posting the reproducer here, in hopes that these symptoms will be noticed and solved.
This batch file prints 3 lines of text, each with the same 79 printable characters. The second line includes some ANSI escape sequences to change the first couple of characters' color.
Ideally, the output should look like this, with the head of line 2 in red:
79 chars _123456789_123456789_123456789_123456789_123456789_123456789_123456789 79 chars _123456789_123456789_123456789_123456789_123456789_123456789_123456789 79 chars _123456789_123456789_123456789_123456789_123456789_123456789_123456789
In Wine, when the output is a terminal window (not wineconsole), the output looks like this:
79 chars _123456789_123456789_123456789_123456789_123456789_123456789_123456789 79 chars _123456789_123456789_123456789_123456789_123456789_123456789_12 3456789 79 chars _123456789_123456789_123456789_123456789_123456789_123456789_123456789
Note that the second line is prematurely wrapped. Wine is apparently passing the batch file's output to the unix terminal, which can handle the unprintable escape codes, but Wine is also corrupting the output by inserting a line break that is not present in the batch file's output.
I am aware that this problem is not the same as wineconsole's lack of virtual terminal processing. If that means it should be in a separate report, then I invite the maintainers to re-open bug 58665.