count = read(is->fd, is->unused,
INPUT_SOURCE_BUF_SIZE - (is->unused - is->buf));
if (count <= 0) {
+ if(count == 0 && is->kind == CPReal && shells[ChatDlg]) { // [HGM] absence of terminal is no error if ICS Console present
+ RemoveInputSource(is); // cease reading stdin
+ stdoutClosed = TRUE; // suppress future output
+ return True;
+ }
(is->func)(is, is->closure, is->buf, count, count ? errno : 0);
return True;
}
return -1;
}
+Boolean stdoutClosed = FALSE;
+
int
OutputToProcess (ProcRef pr, char *message, int count, int *outError)
{
if (pr == NoProc)
{
- if (appData.noJoin || !appData.useInternalWrap)
- outCount = fwrite(message, 1, count, stdout);
- else
+ if (appData.noJoin || !appData.useInternalWrap) {
+ if(!stdoutClosed) outCount = fwrite(message, 1, count, stdout);
+ } else
{
int width = get_term_width();
int len = wrap(NULL, message, count, width, &line);
} ChildProc;
extern char *oldICSInteractionTitle;
+extern Boolean stdoutClosed;
char *ExpandPathName P((char *path));
int MySearchPath P((char *installDir, char *name, char *fullname));