v16 - cls corrupts output stream

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
Nov 19, 2014
I have a nervous habit of running cls periodically. When running inside take command (not once I detach tcc from TC) If I type cls or cls /c it seems to corrupt the current display placing my cursor at the top of the buffer but not clearing the TC display. I suppose this makes sense as TC is displaying the output while TCC has cleared its buffer, but it is very annoying when it happens.

Is there any way to avoid this odd screen artifact and keep them in sync?


Staff member
May 14, 2008
I've never seen (or heard) of anything like that before. A CLS or CLS /S just calls the Windows console APIs to clear the screen, so you'd either have to have something going wrong inside Windows or in your video driver. (Or have another app attached to your console that's blocking or rewriting the screen.)
It happens to me from time to time that CLS leaves a few parts of a few lines, usually close to the top of the display. Seems more likely to happen when there is a lot of output and/or when the computer is busy and/or when I configure the console to a very large number of lines (20,000+). Typing ENTER and getting the prompt as far down as the spurrious text, then executing CLS again usually clears the display for good. CLS/C seems to have less this problem (I aliased to this). Some time ago, I tried to understand if the spurrious text was really remaining in the console, or if it was a discrepancy between the console and TCMD — don't remember if I came to a conclusion.
On a total, it only affects a rather cosmetic point (after CLS, you anticipate the display should be blank except for the prompt, it is not as if real output were corrupted) during an interactive session.

Charles Dye

Super Moderator
Staff member
May 20, 2008
Albuquerque, NM
I suggest, as a troubleshooting technique, scrolling down (e.g. by rolling the mouse wheel) until the spurious text is offscreen, the scrolling back up and seeing whether it reappears.

If forcing a redraw this way makes the incorrect text disappear, then it was correctly erased from the console buffer, but not correctly redrawn on-screen. This might be a video driver issue -- try updating.
I believe I also did the trick with scrolling.
It is not so likely to be a problem of an outdated video driver, as the computers in my company are replaced every 2 or 3 years, and some departments produce 3D software. Anyway, I would have to ask the IT department for updating, which would require a more serious problem.
As said, it doesn't happen often enough for me to bother.
Nov 19, 2014
Yes when I newline to the bottom of the screen or scroll it clears it up but it's quite annoying. I'm just wondering if anyone else has found a solution as it drives me somewhat bonkers when it happens.

I am also using the 64 bit version for the first time. Don't think that's related. I have never seen this in TCC before (I was on 15.x for the last year+)