 class Executable extends EventEmitter
 
     # instance wired the agda-mode executable
-    agdaProcessWired: false
-    agdaProcess: null
+    processWired: false
+    process: null
 
     constructor: (@core) ->
 

            .then (path) => path
            .fail        => @queryExecutablePathUntilSuccess()

    getAgdaProcess: -> Q.Promise (resolve, reject, notify) =>
        if @agdaProcessWired
            resolve @agdaProcess
        else
            @getExecutablePath().then (path) =>
                process = spawn path, ['--interaction']

                # see if it is really agda
                process.stdout.once 'data', (data) =>
                  if /^Agda2/.test data
                    @processWired = true
                    @process = process
                    resolve process

    ################
    #   COMMANDS   #
    ################

    load: -> @getProcess().then (process) =>

        includeDir = atom.config.get 'agda-mode.agdaLibraryPath'

        if includeDir
            command = "IOTCM
                \"#{@core.filePath}\"
                NonInteractive
                Indirect
                ( Cmd_load
                    \"#{@core.filePath}\"
                    [\".\", \"#{includeDir}\"])\n"
            process.stdin.write command
        else
            command = "IOTCM
                \"#{@core.filePath}\"
                NonInteractive
                Indirect
                ( Cmd_load
                    \"#{@core.filePath}\"
                    [])\n"
            process.stdin.write command

module.exports = Executable
