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:


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

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:
Please comment or upvote.

Windows 8.1 x64.png
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.

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.

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.


Please sign in to leave a comment.