app, libgimp: Fix truncation and lack of color on attached Windows console

This commit is contained in:
Bruno Lopes 2025-11-08 12:02:39 -03:00
parent dc3cda93cb
commit c79bf5790d
No known key found for this signature in database
2 changed files with 6 additions and 4 deletions

View file

@ -955,8 +955,9 @@ gimp_attach_console_window (void)
/* If run on native shell, attach to it */
if (AttachConsole (ATTACH_PARENT_PROCESS) != 0)
{
freopen ("CONOUT$", "w", stdout);
freopen ("CONOUT$", "w", stderr);
/* 'r' is needed to prevent interleaving and '+' to support colors */
freopen ("CONOUT$", "r+", stdout);
freopen ("CONOUT$", "r+", stderr);
_flushall ();
{

View file

@ -204,8 +204,9 @@ gimp_main (GType plug_in_type,
/* Make plugins output available on console */
if (AttachConsole (ATTACH_PARENT_PROCESS) != 0 && ! g_getenv ("TERM") && ! g_getenv ("SHELL"))
{
freopen ("CONOUT$", "w", stdout);
freopen ("CONOUT$", "w", stderr);
/* 'r' is needed to prevent interleaving and '+' to support colors */
freopen ("CONOUT$", "r+", stdout);
freopen ("CONOUT$", "r+", stderr);
_flushall ();
}