 
         # Initialize pinging the server to keep the console alive
         @_init_session_ping()
+
+    update_scrollbar: () =>
+        while @scrollbar_nlines < @terminal.ybase
+            console.log("adding lines")
+            @scrollbar.append($("<br>"))
+            @scrollbar_nlines += 1
+        @resize_scrollbar()
+
 
     #######################################################################
     # Private Methods

            # nothing implemented
            return
        @terminal.refresh(0, @opts.rows-1)
        @render_scrollbar()


    # Determine the current size (rows and columns) of the DOM


        # The remote server sends data back to us to display:
        @scrollbar_nlines = 0
        @value = ''
        @session.on 'data',  (data) =>
            try
                @terminal.write(data)
                @value += data.replace(/\x1b\[.{1,5}m|\x1b\].*0;|\x1b\[.*~|\x1b\[?.*l/g,'')

                if @scrollbar_nlines < @terminal.ybase
                    @update_scrollbar()

                setTimeout(@set_scrollbar_to_term, 10)

            catch e
                # TODO -- these are all basically bugs, I think...
