     validateExecutablePath: (path) -> new Promise (resolve, reject) =>
         path = parsePath path
 
-        exec path, ['-V'], (error, stdout, stderr) =>
-            if /^Agda/.test stdout
+        process = spawn path, ['-V']
+
+        process.on 'error', (error) =>
+            reject new InvalidExecutablePathError error
+
+        process.stdout.once 'data', (data) =>
+            if /^Agda/.test data.toString()
                 resolve path
             else
-                reject new InvalidExecutablePathError error if error
-                reject new InvalidExecutablePathError stderr if stderr
+                reject new InvalidExecutablePathError data.toString()
 
     # keep banging the user until we got the right path
     queryExecutablePathUntilSuccess: (path) ->
         @core.panel.setContent "Agda executable not found: \"#{path}\"", [], 'warning', 'path of executable here'
         @core.panel.query()
             .then (path) =>
-                log 'Executable', "got path: #{path}"
+                path = parsePath path
                 @validateExecutablePath path
                     .then (path) => path
                     .catch InvalidExecutablePathError, => @queryExecutablePathUntilSuccess path
             .then (path) =>
-                log 'Executable', "path validated: #{path}"
                 atom.config.set 'agda-mode.executablePath', path
                 return path
             .catch InvalidExecutablePathError, =>
-                warn 'Executable', "path failed"
                 @queryExecutablePathUntilSuccess path
 
     # get executable path from config, query the user if failed

{exec, spawn} = require 'child_process'
Promise = require 'bluebird'
{log, warn, error} = require './logger'
{parsePath} = require './util'
Stream = require './executable/stream'
{InvalidExecutablePathError} = require './error'

    quit: =>
        @process.kill()
        @processWired = false

    compile: =>
        @sendCommand "NonInteractive", "Cmd_compile MAlonzo \"#{@core.getPath()}\" [#{@getLibraryPath()}]"
