anchor.diff:  ﻿namespace Mandolin0
   
   open System
  +open System.Collections.Generic
   open System.Text
   open System.Reflection
  +open System.Threading
   open System.Runtime.InteropServices
   open Autofac
   open Nessos.UnionArgParser
  
positive.code:             Console.WriteLine("\t{0}", oracle)
  
      let continueSession() =
          let savedTop = Console.CursorTop
          Console.CursorTop <- !_restoreSessionConsoleTop
          Console.Write("A previous session already exists, do you want to continue? [Y/N] ")
          let restoreSession = ref String.Empty
          while !restoreSession <> "Y" && !restoreSession <> "N" do
              restoreSession := Console.ReadKey().KeyChar.ToString().ToUpper()
  
          Console.CursorTop <- savedTop
          (!restoreSession).Equals("Y", StringComparison.Ordinal)
  
negative.code:             | List_Templates -> "show all the available templates"
              | List_Oracles -> "show all the available oracles"
              | Version -> "show the full version"
              
  module Program =
  
      let _syncRoot = new Object()
      let _nextCursorTopForUsername = ref 0
      let _restoreSessionConsoleTop = ref 0
      let _readKeysHandlers = new SortedList<Int32, ConsoleKeyInfo -> unit>()
      let mutable _updateProgressBarCallback : (unit -> unit) option = None    
      
      let readKeyDispatcher() =
          while true do
              let key = Console.ReadKey(true)
              for handler in _readKeysHandlers do
                  handler.Value(key)
  
      let createBlockingReadKey() =
          let resetEvent = new ManualResetEventSlim(false)
          let internalKey = ref(new ConsoleKeyInfo())
  
          let readKey = 
              fun () ->
                  resetEvent.Wait()
                  resetEvent.Reset()
                  !internalKey
  
          let consumeKey =
              fun (key: ConsoleKeyInfo) ->
                  internalKey := key
                  resetEvent.Set()
  
          (readKey, consumeKey)
                  
      let handleCtrCancelEvent (sessionManager: SessionManager) (saveCallback: unit -> unit) (deleteCallback: unit -> unit) =
          let (readKey, consumeKey) = createBlockingReadKey()
          _readKeysHandlers.Add(90, consumeKey)
  
          lock _syncRoot (fun () ->           
              Console.WriteLine()
              Console.WriteLine()
              Console.Write("Do you want to save the current session? [Y/N] ")
              let saveSession = ref String.Empty
              while !saveSession <> "Y" && !saveSession <> "N" do
                 saveSession := readKey().KeyChar.ToString().ToUpper()
  
              if (!saveSession).Equals("Y", StringComparison.Ordinal) then
                  saveCallback()
  