     reset: () =>
         # reset the terminal to clean; need to do this on connect or reconnect.
         #$(@terminal.element).css('opacity':'0.5').animate(opacity:1, duration:500)
-        @value = ''
+        @value = @value_orig = ''
         @scrollbar_nlines = 0
         @scrollbar.empty()
         @terminal.reset()


    refresh: () =>
        @terminal.refresh(0, @opts.rows-1)


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

            @set_session(opts.session)

    append_to_value: (data) =>
        # this @value is used for copy/paste of the session history and @value_orig for resize/refresh
        @value_orig += data
        @value += data.replace(/\x1b\[.{1,5}m|\x1b\].*0;|\x1b\[.*~|\x1b\[?.*l/g,'')

    init_mesg: () =>
