Windows terminal does not work the same as ConHost when using C# Console methods #1966

Open
opened 2026-01-30 22:43:00 +00:00 by claunia · 0 comments
Owner

Originally created by @teobugslayer on GitHub (Jun 23, 2019).

I am using this code (C#, .Net core 3 preview 7). Some imports and constants omitted for brevity.
There is several inconsistencies between ConHost and Windows Terminal (WT):

  1. Using this code:
Console.SetWindowSize(maxX, maxY); // using constants 132 and 43 here
Console.SetBufferSize(maxX, maxY);
SetConsoleMode(hOut, dwMode | ENABLE_VIRTUAL_TERMINAL_PROCESSING); // DllImport'ed
  • In WT there's a vertical scroll bar and I can scroll. This is contrary to what I want
  1. Using this code:
Console.Clear();
ConsoleWrite(/*a string with length the entire screen buffer*/)
  • Sometimes the text disappears. Once I got into this state I (as a human using the console) got very confused because if I scroll up or down, the text re-appears. It's kind of hard to put into words but the behavior is crazy funny when seen in person
  1. Using this code
Console.CursorVisible = false;

does not work. I can see a blinking cursor.

Environment

Windows build number: Version 10.0.18362.175
Windows Terminal version (if applicable): 0.2.1715.0

Any other software?

Steps to reproduce

Expected behavior

When using methods of the standard .net core System.Console class, they should work as documented. Also, WT and ConHost should have the same behavor (unless ConHost is wrong)

Actual behavior

See bug description.

Originally created by @teobugslayer on GitHub (Jun 23, 2019). I am using this code (C#, .Net core 3 preview 7). Some imports and constants omitted for brevity. There is several inconsistencies between ConHost and Windows Terminal (WT): 1. Using this code: ```C# Console.SetWindowSize(maxX, maxY); // using constants 132 and 43 here Console.SetBufferSize(maxX, maxY); SetConsoleMode(hOut, dwMode | ENABLE_VIRTUAL_TERMINAL_PROCESSING); // DllImport'ed ``` * In WT there's a vertical scroll bar and I can scroll. This is contrary to what I want 2. Using this code: ```C# Console.Clear(); ConsoleWrite(/*a string with length the entire screen buffer*/) ``` * Sometimes the text disappears. Once I got into this state I (as a human using the console) got very confused because if I scroll up or down, the text re-appears. It's kind of hard to put into words but the behavior is crazy funny when seen in person 3. Using this code ```C# Console.CursorVisible = false; ``` does not work. I can see a blinking cursor. # Environment ```none Windows build number: Version 10.0.18362.175 Windows Terminal version (if applicable): 0.2.1715.0 Any other software? ``` # Steps to reproduce <!-- A description of how to trigger this bug. --> # Expected behavior When using methods of the standard .net core System.Console class, they should work as documented. Also, WT and ConHost should have the same behavor (unless ConHost is wrong) # Actual behavior See bug description.
claunia added the Issue-QuestionResolution-By-DesignArea-OutputProduct-Conpty labels 2026-01-30 22:43:00 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#1966