Fix typo - varwindow.
Wrap stdout and stderr in a class that flushes them after use.
Get error output into gedit.