Skip to content

Commit

Permalink
Merge pull request #267 from Kasparsu/fix_windows_terminal_support
Browse files Browse the repository at this point in the history
Fix windows terminal support
  • Loading branch information
avivbeeri authored Mar 2, 2024
2 parents 3312cc4 + 3d233fb commit b754b96
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ We'd like to thank the following people for their contributions.
* Trevor Martin [https://github.com/trelemar]
* 8_BIT-DEV [https://github.com/8-BIT-DEV]
* catsanddo [https://github.com/catsanddo]
* Kaspar Martin Suursalu [https://github.com/Kasparsu]
8 changes: 8 additions & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,14 @@ char* resolveEntryPath(ENGINE* engine, char* entryArgument, bool autoResolve) {

int main(int argc, char* argv[])
{
#ifdef __MINGW32__
if(!GetStdHandle(STD_OUTPUT_HANDLE)) {
if (AttachConsole(ATTACH_PARENT_PROCESS)) {
freopen("CONOUT$","wb",stdout);
freopen("CONOUT$","wb",stderr);
}
}
#endif
// configuring the buffer has to be first

setbuf(stdout, NULL);
Expand Down

0 comments on commit b754b96

Please sign in to comment.