         @validateExecutablePath path
             .then (path) => path
             .catch InvalidExecutablePathError, => @queryExecutablePathUntilSuccess()
+
     getProcess: -> new Promise (resolve, reject) =>
         if @processWired
             resolve @process
         else
             @getExecutablePath().then (path) =>
-                process = spawn path, ['--interaction']
+                process = execFile path, ['--interaction']
 
                 # catch other forms of errors
                 process.on 'error', (error) =>
                     reject error
 
-                # see if it is really agda
-                process.stdout.once 'data', (data) =>
-                  if /^Agda2/.test data
+                process.stdout.once 'data', =>
                     @processWired = true
                     @process = process
                     resolve process


    constructor: (@core) ->

    getLibraryPath: ->
        path = atom.config.get('agda-mode.libraryPath')
        path.unshift('.')


    # locate the path and see if it is Agda executable
    validateExecutablePath: (path) -> new Promise (resolve, reject) =>
        path = @parsePath path
        execFile path, ['-V'], (error, stdout, stderr) =>
            if /^Agda/.test stdout
                resolve path
            else
