         for elt in [$(@terminal.element), @element]
             elt.css
                 position : 'relative'
-                top : 0
+                top : 0<br
                 width: "100%"
         @element.resizable('enable')
         @resize()

        sb.height(elt.height())

    set_scrollbar_to_term: () =>
        @ignore_scroll = true
        @scrollbar.scrollTop(@scrollbar[0].scrollHeight * @terminal.ydisp / @terminal.ybase)
        f = () =>
            @ignore_scroll = false
        setTimeout(f, 50)


    set_term_to_scrollbar: () =>
        ydisp = Math.ceil(@scrollbar.scrollTop() *  @terminal.ybase / @scrollbar[0].scrollHeight)
        if ydisp <= 5
            ydisp = 0
        else
            ydisp += 5
        @terminal.ydisp = ydisp
        @terminal.scrollDisp(0)





        # Plug the remote session into the terminal.

        # The user types in the terminal, so we send the text to the remote server.
        # We wait until the first write completes before enabling this.
        @first_response = true
        @terminal.on 'data',  (data) =>
            console.log("CLIENT --> SERVER: '#{data}'")
            if @first_response
                @first_response = false
                console.log("scrollbar_nlines = ", @scrollbar_nlines)
                console.log("@terminal.ybase = ", @terminal.ybase)
                if @scrollbar_nlines > 0  # reconnect
                    return

            @session.write_data(data)

        # The terminal receives a 'set my title' message.
        @terminal.on 'title', (title) => @set_title(title)

        # The remote server sends data back to us to display:
        @scrollbar_nlines = 0
        @session.on 'data',  (data) =>
            console.log("SERVER --> CLIENT: '#{data}'")
            try

                @terminal.write(data)

                if @scrollbar_nlines < @terminal.ybase
                    while @scrollbar_nlines < @terminal.ybase
                        @scrollbar.append($("<br>"))
