changeset 32575:b08a96c70196 stable

Show warning for incompatible terminal on each startup on Windows (bug #62791). * scripts/startup/site-rcfile: Display warning on startup for incompatible terminal setting on Windows.
author Markus Mützel <markus.muetzel@gmx.de>
date Sun, 10 Dec 2023 16:38:40 +0100
parents e424a55bc9fb
children 606ac462fa34
files scripts/startup/site-rcfile
diffstat 1 files changed, 17 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/startup/site-rcfile	Mon Dec 04 18:24:49 2023 +0100
+++ b/scripts/startup/site-rcfile	Sun Dec 10 16:38:40 2023 +0100
@@ -5,3 +5,20 @@
 ##
 ## 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