       storage.setValue 'savedSessions', sessions
       storage.setValue 'activeIndex', activeIndex
 
+  removeSession: ({vmName, sessionId}) ->
+    @updateSessions()
+    {vmController:{terminalKites}} = KD.singletons
+    terminalKites[vmName].webtermKillSession
+      session: sessionId
+    .then (response) ->
+      log 'session removed from terminal kite'
+    .catch (err) ->
+      warn err
+
   addNewTab: (vm) ->
 
     KD.mixpanel "Open new Webterm tab, success"  if @_secondTab

    pane = @tabView.getActivePane()
    {terminalView} = pane.getOptions()
    terminalView.terminal?.scrollToBottom()
    terminalView.once 'WebTermConnected', (remote)=>
      @emit "WebTermConnected"
      if query.command


    if terminalView.terminal?.server?
    then runner()
    else
      terminalView.once "TerminalClosed", @bound "removeSession"
      terminalView.once 'WebTermConnected', runner

  handleQuery:(query)->

