only rewrite stdout/stderr/etc. if passed cli specifically

This commit is contained in:
Ryan Fleury
2026-06-19 20:12:21 -07:00
parent fe2aa4d14c
commit 0d62c49c52
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -41,6 +41,7 @@ entry_point(CmdLine *cmd_line)
#endif #endif
} }
str8_list_push(scratch.arena, &command_parts, exe_name); str8_list_push(scratch.arena, &command_parts, exe_name);
str8_list_push(scratch.arena, &command_parts, s("--cli"));
for EachIndex(idx, cmd_line->argc) for EachIndex(idx, cmd_line->argc)
{ {
String8 arg = str8_cstring(cmd_line->argv[idx]); String8 arg = str8_cstring(cmd_line->argv[idx]);
+1 -1
View File
@@ -588,7 +588,7 @@ entry_point(CmdLine *cmd_line)
//- rjf: re-open stdout handles if cli //- rjf: re-open stdout handles if cli
#if OS_WINDOWS #if OS_WINDOWS
if(cmd_line_has_flag(cmd_line, s("bin"))) if(cmd_line_has_flag(cmd_line, s("cli")))
{ {
AttachConsole(ATTACH_PARENT_PROCESS); AttachConsole(ATTACH_PARENT_PROCESS);
freopen("CONOUT$", "wt", stdout); freopen("CONOUT$", "wt", stdout);