TrueColorConsole icon indicating copy to clipboard operation
TrueColorConsole copied to clipboard

make kernel32 interop optional to support linux (and probably macOS)

Open zivillian opened this issue 7 years ago • 2 comments

This PR moves all interop calls to nested NativeMethods to prevent the runtime from trying to load the kernel32.dll on non windows systems and also adds a few Platform checks to just skip the windows specific calls. I had to disable the console resize for the plasma demo, since this is not supported on linux.

I've succesfully tested the plasma demo with this patch under dotnet 2.1.3 running on Ubuntu 16.04.5 LTS using the latest PuTTY snapshot Development snapshot 2018-08-26.6c924ba (True Color support was added after the latest stable release 0.70).

WriteFast seems to be superflous on linux - the plasma demo produced 10MBit/s of network traffic and showed only some small artifacts.

Sadly I don't own an apple device, so I was not able to test this on macOS.

grafik

zivillian avatar Sep 05 '18 17:09 zivillian

Tested on MacOS. Works for me using iTerm. image

Doesn't work using the native MacOS terminal image

thomasDOTwtf avatar Sep 05 '18 17:09 thomasDOTwtf

I am not sure why this wasn't merged, as I understand mac support was 0 before. Native terminal may need other commands (like windows) but certainly it would be better than nothing:)

mitchcapper avatar Oct 09 '20 08:10 mitchcapper