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?

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).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.