[mosh-users] Thoughts on scrolling

Peter Jeremy peterjeremy at acm.org
Tue Apr 24 07:01:00 EDT 2012


On 2012-Apr-23 11:35:25 -0400, Scott Gifford <sgifford at suspectclass.com> wrote:
>Maybe just using the keyboard for scrolling would be OK, but the scrollbar
>UI is pretty friendly and habitual, so it may be hard to move away from.
> Terminal programs also have useful features like search, configurable
>scrollback sizes, etc. that I would miss if they were not also implemented
>in mosh.
>
>It's true that screen and tmux have scrolling features built in already,
>but I personally use them only rarely because they are so limited and slow
>to use.

Unfortunately, what you want isn't feasible unless mosh becomes a full
GUI terminal emulator (like xterm).  A GUI terminal emulator can
retain an arbitrary amount of scrollback and use GUI functions
(scrollbar, scrollwheel) to access its internal scrollback but
generally don't include any provision for a program to access the GUI
scroll functions (xterm allows a program to enable or disable the
scroll bar but nothing more, your comments suggest that iTerm2 does
have some way of passing this to an program).  Programs like tmux &
screen (and potentially mosh) can also retain an arbitrary amount of
scrollback but do not have direct access to GUI features to allow it
to be accessed - instead, unless the terminal provides some way to
indirectly access these features (eg iTerm2), it's only accessible via
in-band character sequences.  And the data then needs to be
transferred from tmux (or whatever) to the terminal for display -
which will be slower than just moving the display window within an
internal buffer.

In order to reduce the amount of state to be tracked (and data
transferred), mosh does not necessarily transfer all application
output to the client, so scrollback on the client terminal is not
necessarily complete.  This means you can't rely on the GUI scroll
features whilst using mosh.

There are two options for handling scrollback within mosh.  The first
is to do it in much the same way as it is in tmux or screen -
scrollback data is tracked within mosh_client & mosh_server and data
that had been optimised out of the transmitted stream is sent on
request when the user scrolls back (via magic character sequences).
This is potentially a RTT slower than a local tmux because missing
data has to be requested from the remote server.

The other option is for mosh to track the full size of the terminal's
scrollback buffer, rather than just the visible screen, and ensure
that any data that would be retained in the scrollback buffer is
transmitted (rather than optimising out data that is not visible).
This would allow you to use the GUI scrollback features but at the
expense of significantly greater memory requirements for both
mosh_client & mosh_server, as well as increased data transfer due
to reduced output optimisation.

-- 
Peter Jeremy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://mailman.mit.edu/pipermail/mosh-users/attachments/20120424/712dcd97/attachment.bin


More information about the mosh-users mailing list