       '*spawnedError': ({message}) =>
         @die(); delay 100, -> $.alert message, 'Error'; return # give the window a chance to restore its original dimensions
         return
-      '*disconnected': => (if !@isDead then $.alert 'Interpreter disconnected', 'Error'; @die()); return
+      '*disconnected': => (if !@dead then $.alert 'Interpreter disconnected', 'Error'; @die()); return
       Disconnect: ({message}) =>
-        if !@isDead
+        if !@dead
           @die()
           if message == 'Dyalog session has ended'
             (try close()); D.process?.exit? 0

  openWindow: (ee) -> # "ee" for EditableEntity
    w = ee.token
    editorOpts = id: w, name: ee.name, tracer: ee.debugger, emit: @emit.bind(@), weakInterrupt: @WI.bind(@)
    if prefs.floating() && !D.floating && !@isDead
      pos = if ee.debugger then prefs.posTracer() else prefs.posEditor()
      delta = 32 * (ee.token - 1); pos[0] += delta; pos[1] += delta
      posH = x: pos[0], y: pos[1], width: pos[2], height: pos[3]

      </div>
    """

    @dead = 0
    @pending = [] # lines to execute: AtInputPrompt consumes one item from the queue, HadError empties it
    @w3500 = null # window for 3500⌶
    @host = @port = @wsid = ''; prefs.title @updateTitle.bind @
