The attached patch makes it possible to compile the Qt terminal on Windows (using MSVC).
Unfortunately, the gnuplot terminal does not yet work correctly on Windows. The reason: select() is too limited on Windows. qt_waitforinput() uses select() to simultaneously wait on stdin and on a named pipe.
On Windows, select can only be used to wait on network sockets. There is WaitForMultipleObjects(), but I couldn't get it to work that way (probably because the QLocalSocket is already registered inside the Qt event loop). So this is no complete solution, but it is a starting point.
I would welcome if the patch could be included, even if the Qt terminal does not yet work on Windows:
- It makes it easier for someone else to continue this work
- It is disabled by default, so other people building on Windows won't be impacted
- All the new code is #defined so it only runs on Windows. So non-Windows-builds will continue to work (I tested this on Linux)
Some more information about the changes inside the patch.