PowerShell ISE doesn't flush stdout

1

I'm having a little problem when running a console program in PowerShell ISE: when the program writes out a line in portions using flush, PowerShell won't show the line until the program writes a line ending. For example the program is doing something like this (C++):

std::cout << "Doing something time-consuming..." << std::flush;
// Do something for some time
std::cout << " done in " << x << " seconds" << std::endl;

And PowerShell ISE will only show the whole line when this section of code completes. With non-ISE PowerShell this doesn't happen, the line is printed in portions as expected.
So the question is: can I somehow make PowerShell ISE disable its internal buffer and print the program's stdout directly?

lapis

Posted 2014-03-09T01:12:20.593

Reputation: 321

Answers

0

Seems like this is not possible, at least without hacking it through Reflection (as I was told at the Microsoft forum).
I think I just should use another tool as an advanced alternative to cmd, like Console or ConEmu (which can also run a PowerShell console inside its interface).

lapis

Posted 2014-03-09T01:12:20.593

Reputation: 321