anchor.diff:                      window.showErrorMessage("Unable to spawn FSI", null) |> ignore
                       failwith "unable to spawn FSI"
               let w = Fable.Core.JsInterop.import "window" "vscode"
  -            let terminal: Terminal = w?createTerminal(profile.options)
  -            terminal.processId |> Promise.onSuccess (fun pId -> fsiOutputPID <- Some pId) |> ignore
  -            lastCd <- None
  -            lastCurrentFile <- None
  -            fsiOutput <- Some terminal
  -            sendCd window.activeTextEditor
  +            let terminal: Terminal = w?createTerminal(profile.options) // setting up terminal state will happen on the terminal listener
               terminal.show(true)
               return terminal
           }
  
positive.code:             |> Promise.suppress
              |> ignore)
  
      let private handleCloseTerminal (terminal : Terminal) =
          fsiOutputPID
          |> Option.iter (fun currentTerminalPID ->
              terminal.processId
              |> Promise.onSuccess (fun closedTerminalPID ->
                  if closedTerminalPID = currentTerminalPID then
                      fsiOutput <- None
                      fsiOutputPID <- None
                      lastCd <- None
                      lastCurrentFile <- None)
              |> Promise.suppress // prevent unhandled promise exception
              |> ignore)
          |> ignore
  
      let private generateProjectReferences () =
          let ctn =
  
negative.code:         SdkScriptsNotify.activate context
          let w = Fable.Core.JsInterop.import "window" "vscode"
          w?registerTerminalProfileProvider("ionide-fsharp.fsi", provider) |> context.subscriptions.Add
          window.onDidCloseTerminal.Invoke(handleCloseTerminal >> box) |> context.subscriptions.Add
          (w?onDidOpenTerminal : Event<Terminal>).Invoke(handleOpenTerminal >> box) |> context.subscriptions.Add
          commands.registerCommand("fsi.Start", start |> objfy2) |> context.subscriptions.Add
          commands.registerCommand("fsi.SendLine", sendLine |> objfy2) |> context.subscriptions.Add
          commands.registerCommand("fsi.SendSelection", sendSelection |> objfy2) |> context.subscriptions.Add
  