 
     @terminal.sessionEndedCallback = (sessions) =>
       @emit "WebTerm.terminated"
-      return
 
-      @server.getSessions (sessions) =>
-        keys = Object.keys sessions
-        keys.sort (a, b) ->
-          if sessions[a] < sessions[b]
-            -1
-          else if sessions[a] > sessions[b]
-            1
-          else
-            0
-        @sessionList.empty()
-        for key in keys
-          @sessionList.addItem
-            id: parseInt(key)
-            name: sessions[key]
-            mainView: this
-        @sessionBox.show()
     @terminal.setTitleCallback = (title) =>
       #@tabPane.setTitle title
 

    @terminal.windowDidResize()

  getAdvancedSettingsMenuItems:->

    settings      :
      type        : 'customView'
      view        : new WebtermSettingsView
        delegate  : @


class WebTermSessionItem extends KDListItemView
  constructor: (options = {},data) ->
    super options, data

  partial: (data) ->
    link = $(document.createElement("a"))
    link.text data.name
    link.attr "href", "#"
    link.bind "click", (event) =>
      data.mainView.sessionBox.hide()
      data.mainView.terminal.joinSession data.id
      event.preventDefault()
    link

      @container.$().scrollLeft 0
    @addSubView @container

    @terminal = new WebTerm.Terminal @container.$()

    if @options.advancedSettings
