=== modified file 'src/com/goldencode/p2j/ui/ErrorWriterBatch.java'
--- src/com/goldencode/p2j/ui/ErrorWriterBatch.java	2023-03-14 15:25:28 +0000
+++ src/com/goldencode/p2j/ui/ErrorWriterBatch.java	2023-05-02 16:14:38 +0000
@@ -16,6 +16,7 @@
 **                  (redirected) console.
 ** 008 SVL 20171024 Added displayError(errmsg, noMessageBox).
 ** 009 GBB 20230313 ErrorManager.writeLog() called. Simplified windows condition blocks.
+** 010 GBB 20230502 Don't write to System.out batch output that is redirected to a strean.
 */
 /*
 ** This program is free software: you can redistribute it and/or modify
@@ -132,8 +133,11 @@
          // TODO: In Windows the native message box should be displayed here.
       }
 
-      // then log it to redirected console
-      System.out.println(errmsg);
+      if (client == null || !client.isRedirected())
+      {
+         // if not redirected to a stream, write it to the console
+         System.out.println(errmsg);
+      }
    }
 
    /**
@@ -261,8 +265,11 @@
          // TODO: In Windows the native message box should be displayed here.
       }
 
-      // then log it to redirected console
-      System.out.println(output);
+      if (client == null || !client.isRedirected())
+      {
+         // if not redirected to a stream, write it to the console
+         System.out.println(output);
+      }
    }
 
    /**

=== modified file 'src/com/goldencode/p2j/ui/client/Window.java'
--- src/com/goldencode/p2j/ui/client/Window.java	2022-10-11 09:13:05 +0000
+++ src/com/goldencode/p2j/ui/client/Window.java	2023-05-02 17:00:59 +0000
@@ -2,7 +2,7 @@
 ** Module   : Window.java
 ** Abstract : Window widget implementation for CHUI
 **
-** Copyright (c) 2005-2021, Golden Code Development Corporation.
+** Copyright (c) 2005-2023, Golden Code Development Corporation.
 **
 ** -#- -I- --Date-- --JPRM-- ----------------------------Description-----------------------------
 ** 001 EVL 20050509   @21167 Creation based on CHARVA Window class.
@@ -278,6 +278,7 @@
 **                           Missed the suppression of the pauseBeforeHide when keepMessages is on.
 ** 142 CA  20201015          Replaced java.util.Stack with ArrayDeque (as synchronization is not required).
 **     HC  20210603          Fixed tiny input not to clear the previously input value.
+** 143 GBB 20230502          Don't display a message on the terminal in chui when redirected to a stream.
 */
 /*
 ** This program is free software: you can redistribute it and/or modify
@@ -1855,7 +1856,7 @@
       boolean switched = tc.isRedirected();
       int redir = -1;
 
-      // in redirected mode we output to both the terminal and to the stream, but we output
+      // in redirected mode we output only to the stream and we output
       // the unmodified text, not the text that may have been truncated above
       if (switched)
       {
@@ -1869,7 +1870,7 @@
       try
       {
          // Make sure to suppress output if it is redirected with KEEP-MESSAGES option
-         if (content[0] == null && !isKeepMessages)
+         if (content[0] == null && !isKeepMessages && (!tc.isChui() || !switched))
          {
             // 'clear' flag is no longer used
             content[0] = message;
@@ -1877,7 +1878,7 @@
             return 0;
          }
 
-         if (content[1] == null && !isKeepMessages)
+         if (content[1] == null && !isKeepMessages && (!tc.isChui() || !switched))
          {
             // 'clear' flag is no longer used
             content[1] = message;
@@ -1887,14 +1888,14 @@
 
          try
          {
-            if (messageNeedPause && !isKeepMessages)
+            if (messageNeedPause && !isKeepMessages && (!tc.isChui() || !switched))
                tc.pauseBeforeHide();
 
             return 0;
          }
          finally
          {
-            if (!isKeepMessages)
+            if (!isKeepMessages && (!tc.isChui() || !switched))
             {   
                // 'clear' flag is no longer used
                displayMessage(new String[] {message, null}, cs, -1);

=== modified file 'src/com/goldencode/p2j/util/ControlFlowOps.java'
--- src/com/goldencode/p2j/util/ControlFlowOps.java	2023-04-12 18:36:16 +0000
+++ src/com/goldencode/p2j/util/ControlFlowOps.java	2023-05-02 16:28:53 +0000
@@ -284,6 +284,7 @@
 **     HC  20230125          Added caching of resolved procedure internal entries.
 ** 084 CA  20230215          Added unknown.UNKNOWN singleton (used by FWD runtime at this time).
 ** 085 GBB 20230315          Redundant ErrorManager.buildErrorText removed before ErrorManager.displayError.
+** 086 GBB 20230502          Run missing external procedure to produce error always.
 */
 
 /*
@@ -359,6 +360,7 @@
 import com.goldencode.p2j.security.*;
 import com.goldencode.p2j.security.SecurityManager;
 import com.goldencode.p2j.ui.*;
+import com.goldencode.p2j.ui.chui.*;
 import com.goldencode.p2j.util.InvocationRequestPayload.InvokeType;
 
 /**
@@ -8108,12 +8110,19 @@
    private static void invokeFailure(String target)
    throws StopConditionException
    {
+      int errCode = 293;
       String spec = "\"%s\" was not found";
-      String err  = String.format(spec, target);
-      err = ErrorManager.buildErrorText(293, err, true);
-      
+      String errMsg  = String.format(spec, target);
+      String err = ErrorManager.buildErrorText(errCode, errMsg, true);
+
+      // RUN external.p should never be a silent error
+      boolean isSilentOriginally = ErrorManager.isSilent();
+      ErrorManager.setSilent(false);
+      ErrorManager.addError(errCode, errMsg, false, true);
       ErrorManager.displayError(err);
-      throw new StopConditionException(err, new NumberedException(err, 293));
+      ErrorManager.setSilent(isSilentOriginally);
+      
+      throw new StopConditionException(err, new NumberedException(err, errCode));
    }
    
    /**

