     @emit = new Bacon.Bus()
 
   startSCLang: () ->
+    @recompiling = false
+
     opts =
       stdin: false
       echo: false

    deferred.promise

  recompile: ->
    @sclang?.quit()
      .then () =>
        @startSCLang()

  isCompiled: ->
    @sclang?.state is 'ready'

        process.chdir(dir)
        @sclang = new supercolliderjs.sclang(options)

        unlisten = (sclang) ->
          for event in ['exit', 'stdout', 'stderr', 'error', 'state']
            sclang.removeAllListeners(event)

        @sclang.on 'state', (state) =>
          if state
            @bus.push("<div class='state #{state}'>#{state}</div>")

        @sclang.on 'exit', () =>
          @bus.push("<div class='state dead'>sclang exited</div>")
          unless @recompiling
            if atom.config.get 'atom-supercollider.growlOnError'
              growl("sclang exited", {title: "SuperCollider"})
          unlisten(@sclang)
          @sclang = null

        sc3 = /^sc3>\s*$/mg
        @sclang.on 'stdout', (d) =>
