IInteractiveSession SetupSession()
        {
            var ses = new CSharpInteractiveSession();

            ses.TextReceived += t => DispatchService.GuiDispatch(() => view.WriteOutput(t));
            ses.PromptReady  += () => DispatchService.GuiDispatch(() => view.Prompt(true));
            ses.Exited       += () => DispatchService.GuiDispatch(() => {
                if (kill == KillIntent.None)
                {
                    view.WriteOutput("\nSession termination detected. Press Enter to restart.");
                    isPrompting = true;
                }
                else if (kill == KillIntent.Restart)
                {
                    view.Clear();
                }
                kill = KillIntent.None;
            });
            ses.StartReceiving();
            return(ses);
        }
 IInteractiveSession SetupSession()
 {
     var ses = new CSharpInteractiveSession ();
     ses.TextReceived += t => DispatchService.GuiDispatch (() => view.WriteOutput (t));
     ses.PromptReady += () => DispatchService.GuiDispatch (() => view.Prompt (true));
     ses.Exited += () => DispatchService.GuiDispatch (() => {
         if (kill == KillIntent.None) {
             view.WriteOutput ("\nSession termination detected. Press Enter to restart.");
             isPrompting = true;
         } else if (kill == KillIntent.Restart) {
             view.Clear ();
         }
         kill = KillIntent.None;
     });
     ses.StartReceiving ();
     return ses;
 }