   removeOpenDocument: -> # legacy, should be reimplemented in ace bundle.
 
 
-  getActivePaneView: ->
-
-    return @tabView.getActivePane().view
+  getActivePaneView: -> return @tabView.getActivePane()?.view
 
 
   focusTab: ->

    .catch (err)->
      warn "Failed to terminate sessions", err

  terminateSession: (machine, session)->

    machine.getBaseKite().webtermKillSession {session}


      @updateStatusBar()
      @focusTab()

    @tabView.on 'PaneAdded', (pane) =>
      return unless pane.options.editor
      {tabHandle} = pane
