## System-wide startup file for Octave.
##
## If the environment variable OCTAVE_SITE_INITFILE is set when Octave
## starts, then that file is executed instead of this file.
##
## This file contains commands that should be executed each time Octave starts
## for every user at this site.

if ispc () && isguirunning () ...
    && ~strcmp (winqueryreg ("HKEY_CURRENT_USER", 'Console\%%Startup', "DelegationConsole"), ...
                "{B23D10C0-E52E-411E-9D5B-C09FDF709C7D}")
  warn_str = ["WARNING: You are using an incompatible Windows configuration!\n", ...
              "Microsoft's new Terminal App is not compatible with Octave.\n", ...
              "Please follow the instructions on the following page and set the ", ...
              "default terminal to \"Windows Console Host\":\n", ...
              "https://octave.discourse.group/t/4981/"];
  warning ("octave:terminal-app", warn_str);
  answer = questdlg ([warn_str, "\n\nWould you like to open that page in your browser?"], ...
                     "Incompatible Configuration", "Yes", "No", "Yes");
  if strcmp (answer, "Yes")
    system ("start https://octave.discourse.group/t/4981/");
  endif
  clear warn_str answer
endif
