Cygwin terminal buffers STDOUT

851 Views Asked by At

I use Altera Quartus software which comes with its own Cygwin distribution and a dumb terminal which, according to the shortcut placed in my Start Menu by Altera, is run using

cmd.exe /c "c:\altera\15.1\nios2eds\NiosII Command Shell.bat"

where this batch file configures the environment for Quartus and launches bash. When I use this window to run Altera tools, their output comes out immediately (not buffered) and in color.

I also have my own Cygwin installation with an Xserver and terminals (i.e. lxterminal, mrxvt, xfce4-terminal, etc). I have adapted Altera's batch file to configure Altera's environment within my Cygwin and I can run all of Altera's tools. However, when I run these tools, their output is neither in color (not a big deal but surprising), and is buffered until the end of execution when all output appears at the same time.

Does anyone have any ideas on how to bypass this buffering?

1

There are 1 best solutions below

0
On

Somehow, your tools are thinking that the output is not a terminal but a file. For files, the tool itself will create a buffer (4K on Linux). For terminals, the output is usually line buffered (i.e. the output code will collect all the characters until an end-of-line is detected and then print them all at once).

To help you further, we need more information how you "adapted Altera's batch file to configure Altera's environment within my Cygwin"