 
   doResize: ->
 
-    @forEachSubViewInIDEViews_ (pane) ->
+    @forEachSubViewInIDEViews_ (pane) =>
       {paneType} = pane.options
       switch paneType
         when 'terminal'
-          {terminal} = pane.webtermView
+          { webtermView } = pane
+          { terminal }    = webtermView
+
           terminal.windowDidResize()  if terminal?
+
+          unless @isInSession
+            KD.utils.wait 400, -> # defer was not enough.
+              webtermView.triggerFitToWindow()
+
         when 'editor'
           height = pane.getHeight()
           {ace}  = pane.aceView

    switch paneType
      when 'terminal'
        terminalOptions =
          machine  : @mountedMachine
          session  : context.session
          hash     : paneHash
          joinUser : @collaborationHost or KD.nick()
          fitToWindow : yes

        @createNewTerminal terminalOptions


          if ace?.editor?
            ace.setHeight height
            ace.editor.resize()


  notify: (title, cssClass = 'success', type = 'mini', duration = 4000) ->

