       if view instanceof IDETerminalPane
         sessionId = view.session or view.webtermView.sessionId
         @terminateSession @mountedMachine, sessionId
+
+
+  createSplitHandle = (type) ->
+
+    handle = new kd.CustomHTMLView
+      cssClass : "split-handle #{type}-split-handle"
+      partial  : '<span class="icon"></span>'
+
+    handle.setStyle { visibility: 'hidden' }
+
+    return handle
+
+
+  ensureSplitHandlers: ->
+
+    @verticalSplitHandle?.destroy()
+
+    @tabView.addSubView @verticalSplitHandle = createSplitHandle 'vertical'
+    @verticalSplitHandle.on 'click', @lazyBound 'emit', 'VerticalSplitHandleClicked'
+
+    notifier = setupSplitHandleNotifier @verticalSplitHandle
+    @on 'KDObjectWillBeDestroyed', notifier.bound 'destroy'
+
+    @horizontalSplitHandle?.destroy()
+
+    @tabView.addSubView @horizontalSplitHandle = createSplitHandle 'horizontal'
+    @horizontalSplitHandle.on 'click', @lazyBound 'emit', 'HorizontalSplitHandleClicked'
+
+    notifier = setupSplitHandleNotifier @horizontalSplitHandle
+    @on 'KDObjectWillBeDestroyed', notifier.bound 'destroy'
 
 
   createPane_: (view, paneOptions, paneData) ->

        click    : => @createEditorMenu tabHandle, icon

      tabHandle.addSubView icon, null, yes

    # This is a custom event for IDEApplicationTabView
    # to distinguish between user actions and programmed actions

      @focusTab()

    @tabView.on 'PaneAdded', (pane) =>

      { addSplitHandlers } = @getOptions()

      @ensureSplitHandlers()  if addSplitHandlers

      return unless pane.options.editor

      {tabHandle} = pane

      icon = new KDCustomHTMLView
