     contextMenu.once 'ContextMenuItemReceivedClick', -> contextMenu.destroy()
 
 
-
+  terminateSessions: (machine)->
+
+    machine.getBaseKite().webtermKillSessions()
+
+    .catch (err)->
+      # This `webterm.killSessions` is not deployed yet
+      # when I was writing these lines, so I've added
+      # a feedback for user. ~ GG
+      if err.type is "methodNotFound"
+        new KDNotificationView
+          title : "Coming soon"
+      else
+        warn "Failed to terminate sessions", err
 
   terminateSession: (machine, session)->
 


    sessions = machine?.getBaseKite().terminalSessions or []

    terminalSessions =
      "New Session"  :
        callback     : => @createTerminal { machine }
        separator    : sessions.length > 0

    activeSessions = []
    frontApp.forEachSubViewInIDEViews_ 'terminal', (pane) =>
      if pane.remote?
        activeSessions.push pane.remote.session

    sessions.forEach (session, i) =>
      isActive = session in activeSessions
      terminalSessions["Session (#{session[0..5]}) &nbsp"] =
        disabled          : isActive
        children          :
          'Open'          :
            disabled      : isActive
            callback      : => @createTerminal { machine, session }
          'Terminate'     :
            callback      : => @terminateSession machine, session

    items =
      'New File'          : callback : => @createEditor()


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


  openSavedFile: (file, content) ->

      pane = @tabView.getActivePane()
      if pane.data instanceof FSFile and pane.data.path is @getDummyFilePath()
        @tabView.removePane @tabView.getActivePane()
