Web lists-archives.com

Re: stdbuf does not work

Thank you again, Eliot, for this direction.I haven't had time to get everything working but winpty does appear to work.Note that the undocumented switch,  -Xallow-non-tty must be included to use pipes.This now works, i.e. the text output from xgraph shows up immediately.
    winpty  -Xallow-non-tty xgraph | cat -A
winpty may be found here:    https://github.com/rprichard/winptyThe download is for the source. I was able to make it without a hiccup by doing the following in directory winpty-master:   ./configure   make   make install
rprichard includes he "undocumented" switches here:    https://github.com/rprichard/winpty/issues/103
Thanks again.
Best - Don

      From: Eliot Moss <moss@xxxxxxxxxxxx>
 To: cygwin@xxxxxxxxxx 
 Sent: Saturday, August 18, 2018 1:01 PM
 Subject: Re: stdbuf does not work
Donald emailed me directly that this:

xgraph ... | strbuf -oL -eL tr -d '\015' | ...
does not fix the problem.  While I don't recall his ever having described
"the problem" that he is trying to use strbuf to solve, I now gather that
it has to do with xgraph doing more buffering of output than he would
like, so the downstream programs are not responding in a timely way.

The general problem is that this kind of buffering is usual for pipes, and
thus what the Microsoft C RunTime (CRT) does (cygwin's C run-time does
the same thing, I believe, but strbuf can override it).

The fix is to be writing to a character ("console") device of some kind.
This post on stackoverflow gives a solution:


The solution proposed there is a program called winpty, and use of
(apparently undocumented) flags to winpty to achieve the desired effect.
I am posting back to the list rather than to Don directly, in hope that
this works and his confirmation to the list may be helpful in the future
to others trying to achieve that same effect.

Regards - Eliot

Problem reports:      http://cygwin.com/problems.html
FAQ:                  http://cygwin.com/faq/
Documentation:        http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple