   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}



    appManager.tell 'IDE', 'setActiveTabView', @tabView
    appManager.tell 'IDE', 'setFindAndReplaceViewDelegate'

    @updateStatusBar()


