   spawnProcess: (rootDir, options) =>
     return unless @processMap?
     return unless atom.config.get('haskell-ghc-mod.enableGhcModi')
-    proc = @processMap.get(rootDir)
+    proc = @processMap.get(rootDir.getPath())
     debug "Checking for ghc-modi in #{rootDir.getPath()}"
     if proc?
       debug "Found running ghc-modi instance for #{rootDir.getPath()}"

        new InteractiveProcess(modiPath, [], options, @caps)
    proc.onExit (code) =>
      debug "ghc-modi for #{rootDir.getPath()} ended with #{code}"
      @processMap?.delete(rootDir)
    @processMap.set rootDir, proc
    return proc

  runModCmd: ({options, command, text, uri, args}) ->

  killProcess: =>
    return unless @processMap?
    debug "Killing all ghc-modi processes"
    @processMap.forEach (proc) ->
      proc.kill()

  killProcessForDir: (dir) =>
    return unless @processMap?
    debug "Killing ghc-modi process for #{dir.getPath()}"
    @processMap.get(dir.getPath())?.kill?()
    @processMap.delete(dir.getPath())

  destroy: =>
    return unless @processMap?
