mbbsemu / MBBSEmu

The MajorBBS Emulation Project is an Open Source, Cross-Platform emulator for easily running The MajorBBS & Worldgroup Modules
https://www.mbbsemu.com
MIT License
128 stars 14 forks source link

CMD.exe -console ANSI is weird #230

Closed Cthulhuhost closed 3 years ago

Cthulhuhost commented 3 years ago

Describe the bug See image. First screen (login screen of mbbs) ansi is all wonky.

To Reproduce Steps to reproduce the behavior: run cmd.exe execute 'mbbsemu.exe -M Muicyber -Console' See the login screen https://imgur.com/WSqC2yq

Expected behavior A readable login screen for human eyes would be nice.

Screenshots https://imgur.com/WSqC2yq vs https://www.mbbsemu.com/images/login.png

Screen shots of expected vs. actual between MBBSEmu and MajorBBS/Worldgroup help with understanding the expected difference between the two.

Software Information:

enusbaum commented 3 years ago

Based on the screen shot it looks like the Unicode mapping for the ANSI characters is working as intended, but the ANSI CSI codes aren't being handled by the console for color/position.

We'll need to check to see if there's a way for us to set the terminal/console to color mode in addition to Unicode.

enusbaum commented 3 years ago

It looks like for Windows, we need to enable ENABLE_VIRTUAL_TERMINAL_PROCESSING

https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences?redirectedfrom=MSDN

I'm looking into how we can do this programmatically within the Application if the end user is on a Win32 platform.

enusbaum commented 3 years ago

Confirmed a fix for this by detecting Windows platforms and setting the proper flags for the current console.

PR pending

image