Skip to content

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

@teobugslayer

Description

@teobugslayer

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-OutputRelated to output processing (inserting text into buffer, retrieving buffer text, etc.)Issue-QuestionFor questions or discussionProduct-ConptyFor console issues specifically related to conptyResolution-By-DesignIt's supposed to be this way. Sometimes for compatibility reasons.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions