changeset 6002:38085f903f23

maint: merge release to default.
author Markus Mützel <markus.muetzel@gmx.de>
date Sun, 05 Dec 2021 18:30:35 +0100
parents d5489b19bc4f (current diff) 88762923aa9a (diff)
children 556dfbc6457e
files
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/installer-files/octave-launch.c	Sat Dec 04 15:32:37 2021 -0500
+++ b/installer-files/octave-launch.c	Sun Dec 05 18:30:35 2021 +0100
@@ -338,6 +338,12 @@
     StringCchCopyW (argbuffer, ARGBUF_SZ, L"octave.exe ");
     StringCchCatW (path, PATH_SZ, L"\\octave.exe");
 
+    /* If parent process has a console, attach to it.
+       Let the function fail silently, when parent has no console
+       (e.g., when program has been started from link in start menu).
+       No console will be shown in this case. */
+    AttachConsole (ATTACH_PARENT_PROCESS);
+
     if (! (no_gui_libs || no_gui_arg_found))
       {
         /* Unless --no-gui or --no-gui-libs is specified, we will use a GUI window.  */