When setting the terminal color, ansicolor uses the file handle syscall.Stdout for the windows system calls.
In my use case, this is not sufficient. I am compiling my go application as a windows GUI application (no terminal) and, if the command-line argument "-console" is provided, I allocate a new console.
I'm using the following syscalls for that:
procAttachConsole = kernel32.MustFindProc("AttachConsole")
procAllocConsole = kernel32.MustFindProc("AllocConsole")
procFreeConsole = kernel32.MustFindProc("FreeConsole")
As a result, the syscall.stdout handle (=1) is not correct, but there is no way to configure another window handle.
When setting the terminal color, ansicolor uses the file handle
syscall.Stdoutfor the windows system calls.In my use case, this is not sufficient. I am compiling my go application as a windows GUI application (no terminal) and, if the command-line argument "-console" is provided, I allocate a new console.
I'm using the following syscalls for that:
As a result, the syscall.stdout handle (=1) is not correct, but there is no way to configure another window handle.