     @webtermView.connectToTerminal()
 
     @webtermView.once "WebTerm.terminated", =>
+
       paneView = @parent
       tabView  = paneView.parent
 
       tabView.removePane paneView
 
+      @machine.getBaseKite().fetchTerminalSessions()
+
+
   getMode: ->
-    return 'create'
+    return  if @session? then 'resume' else 'create'
 
   runCommand: (command, callback) ->
     return unless command


    super options, data

    {@machine} = @getOptions()

    @createTerminal()

  createTerminal: ->
    @webtermView       = new WebTermView

      readOnly         : @getOption 'readOnly'
      machine          : @machine
      mode             : @getMode()
      session          : @session
      cssClass         : 'webterm'
      advancedSettings : no

