conhost: add basic VT control sequence

This is a minimal approach to running MC in wineconsole and addresses https://bugs.winehq.org/show_bug.cgi?id=49780.

Wineconsole thus supports basic CSI control sequences for:

  • SGR (Select Graphic Rendition) and
  • CUP (Cursor Position)

mc-in-wineconsole-260126

TODO:

  • check for ENABLE_VIRTUAL_TERMINAL_PROCESSING
  • bug states that SetConsoleMode does not return error code and therefore applications fail to handle it correctly
  • rewrite, if that is the way to go i will do that, to use newer API. This would allow more colors than ANSI colors only
  • test shared: several programs attached to the same console
    • tried to test it with mc and w64devkit in wineconsole both works as far control sequences are implemented.
    • tested following seq:
      • write esc seq to change current color in red,
      • don't emit esc seq to go back to default color
      • use old API to get screen buffer color and check the result (GetConsoleScreenBufferInfo)

    -> GetConsoleScreenBufferInfo matches the color which was set via CSI/SGR seq.

Edited by Thomas Csovcsity

Merge request reports

Loading