     newCols = Math.max 1, Math.floor swidth  / charWidth
     newRows = Math.max 1, Math.floor sheight / charHeight
 
+
     @setSize newCols, newRows
 
-  windowDidResize: _.throttle (-> @updateSize()), 500
+
+  updateAppSize: ->
+
+    { appView } = @getOptions()
+
+    height = appView.parent.getHeight() - 24 # padding
+
+    newHeight = Math.floor(height / @_mbHeight) * @_mbHeight
+
+    appView.setHeight newHeight
+
+
+  windowDidResize: _.debounce (-> @updateSize()), 100
 
   lineFeed: ->
     if @cursor.y is @screenBuffer.scrollingRegion[1]


    @updateSize()

    @container.on "mousedown mousemove mouseup mousewheel contextmenu", (event) =>
      @inputHandler.mouseEvent event

    @clientInterface =


    return sizes


  updateSize: (force = no) ->


    [swidth, sheight] = [@parent.getWidth()  or @currentWidth,\
                         @parent.getHeight() or @currentHeight]

    @updateAppSize()

    return  if not force and \
               swidth is @currentWidth and sheight is @currentHeight

