IConsole and ConsoleHost

Dec 10, 2009 at 3:54 AM

I'm trying to make a simple GUI repl leveraging the IConsole and ConsoleHost classes and running into problems.  I've got an IConsole implementation that directs the Write outputs to a textbox on a winforms form, but it seems like Write is only ever called with Style.Prompt and never with Out or Error.  Basically what happens when I run is that I get the prompt printed to my textbox just fun, but the echo of my statement and the result of running it are only ever sent to the Output window (showing Debug output).

I'm using Ruby.  Here's a sample of what I get:

 

IronRuby 0.9.1.0 on .NET 2.0.50727.4927
Copyright (c) Microsoft Corporation. All rights reserved.
>>> 

 

IronRuby 0.9.1.0 on .NET 2.0.50727.4927

Copyright (c) Microsoft Corporation. All rights reserved.

 

>>> 

 

 

 

If I then type "a = 5" into my input and send it to the engine, by textbox only gets  ">>>" added to it, while this ends up in the output window:

 

CT_INIT: Object

CT_INIT: File::Constants

CT_INIT: IO

CT_INIT: File

MT_INIT: Kernel

MT_INIT: Object

MT_INIT: <anonymous>

MT_INIT: Comparable

MT_INIT: Numeric

MT_INIT: Precision

MT_INIT: Integer

MT_INIT: Fixnum

=> 5

 

 

I really really really want => 5 to end up in my textbox.  Am I doing something wrong? Or is something internal to ConsoleHost always writing to System.Out or something instead of console.Out.  I also have textwriters hooked up (in IConsole) for Output and Error and they never get written to either.

 

Thanks.