Run console output truncated at 120 characters

My Windows console application is having its output truncated at a width 120 characters and is not wrapping properly. Using the "soft wrap" button does nothing.

If the text is really long it wraps at 120 characters but characters in the middle are missing.

For example, if I printf a constant string with just digits and letters repeated

"01234567890abcdefghijklmnopqrstuvwxyz01234567890abcdefghijklmnopqrstuvwxyz01234567890abcdefghijklmnopqrstuvwxyz01234567890abcdefghijklmnopqrstuvwxyz01234567890abcdefghijklmnopqrstuvwxyz01234567890abcdefghijklmnopqrstuvwxyz" );


I get the following in the console window:

01234567890abcdefghijklmnopqrstuvwxyz01234567890abcdefghijklmnopqrstuvwxyz01234567890abcdefghijklmnopqrstuvwxyz012345678
stuvwxyz01234567890abcdefghijklmnopqrstuvwxyz01234567890abcdefghijklmnopqrstuvwxyz


So, from this you can see it is simply deleting everything from the 121st character to the 141st character.

4 comments
Comment actions Permalink

Hi John.

As you can see on the screenshot, it correctly works for us.

This issue may relates to the common IntelliJ IDEA problem:
https://youtrack.jetbrains.com/issue/IDEA-117552
Please comment or upvote.



Attachment(s):
Windows 8.1 x64.png
0
Comment actions Permalink

The problem appears to be related to the use of

SetConsoleScreenBufferSize( handleStdOut, coordConsole );
SetConsoleWindowInfo( handleStdOut, TRUE, &rectConsoleWindow );


in my code or possibly a bug of some kind in these Windows functions.

0
Comment actions Permalink

Yes, doing that interferes with the way CLion handles the process output. I suggest putting these invocations into #ifndef block and introduce a new define that exists only when building from CLion.

0
Comment actions Permalink

This is happening to me as well, and I'm not making any calls to the SetConsole_() functions he mentions.  CLion 2016.3.5 running on Windows 10.  Happens on both my desktop and my laptop.

0

Please sign in to leave a comment.