Skip to content

Scrollback and alternate screen (was: Use alternate screen on smcup/rmcup ) #2

Closed

Description

@andersk

When the remote application uses smcup to enter the alternate screen, the client should put the real terminal in alternate screen mode too, so that for example the mouse wheel lets you scroll in less and emacs and barnowl.

Activity

  1. andersk commented on Feb 20, 2012

    @andersk
    MemberAuthor

    Or perhaps the client should always put the real terminal in alternate screen mode, for much the same reason that curses applications do—the scrollback history it generates in the primary screen isn’t particularly useful anyway.

  2. keithw commented on Feb 27, 2012

    @keithw
    Member

    In normal use (like line-by-line typing at the shell), the real-terminal scrollback will be somewhat useful. I'm not sure I want to give that up completely, although maybe the user would be annoyed that larger prints are only there partially in the scrollback.

  3. reopened this on Feb 27, 2012
  4. chingjun commented on Apr 11, 2012

    @chingjun

    Hi, I would like to know if you have any plan on this issue? I think mosh should work just like ssh, that it will enter smcup mode when the remote application requests so. I find it quite annoying when I use vim to open a large file and it leaves a lot of scrollbacks.

  5. reopened this on Apr 16, 2012
  6. keithw commented on Apr 16, 2012

    @keithw
    Member

    Here is the current proposed solution:

    (a) mosh-client puts the terminal in the alternate screen for the whole time

    (b) mosh-server interprets SMCUP/RMCUP the way xterm does, so people's "vim" continues to work the same as in xterm (or in screen with altscreen enabled)

    (c) we grab control-pgUp and control-PgDown for our own devious ends (providing proper scrollback).

  7. andersk commented on Apr 16, 2012

    @andersk
    MemberAuthor

    Sounds reasonable to me. I proposed the following modifications to (c):

    • we also grab Ctrl-Up and Ctrl-Down (since this is what Ctrl-wheel sends in gnome-terminal)
    • but we don’t grab any keys for scrollback while the inner application is inside an alternate screen.
  8. scottgifford commented on Apr 23, 2012

    @scottgifford

    Do I understand correctly that the plan here is to provide scrollback similar to what a regular terminal provides? That is, if I run a command with a lot of output, I can reliably scroll back with my terminal's scrollbars to see everything that was output by that command? That is a really important usability issue for me. Thanks!

  9. keithw commented on Apr 23, 2012

    @keithw
    Member

    Yes, Scott, that's the plan, although you won't be able to use your local terminal's scroll bars. For now you can use screen or tmux on the server side to get this feature.

  10. taralx commented on Apr 23, 2012

    @taralx

    This is a cool idea. Is it possible to support mousewheel too?

  11. keithw commented on Apr 23, 2012

    @keithw
    Member

    Yes, if we do it with Anders's amendment, it will support the mouse wheel.

  12. NickWoodhams commented on Jun 6, 2012

    @NickWoodhams
  13. haarts commented on Jun 11, 2012

    @haarts
  14. 66 remaining items

  15. rjurney commented on Oct 1, 2019

    @rjurney

    How hard would it be to add a rollback to mosh? What is involved?

  16. eminence commented on Oct 2, 2019

    @eminence
    Member

    but scrolling using tmux is laggy as it requires waiting for the remote server to send the updated screen contents

    If mosh ever learns how to do scrollback, I'm imaging that it would have to do the same thing, so I don't quite understand this complaint.

  17. comex commented on Oct 3, 2019

    @comex

    Why would it have to do the same thing? In principle Mosh should be able to keep a local copy of the scrollback buffer. I suppose there might be issues if something is spamming the terminal fast enough that the client doesn't receive all the text (since Mosh intentionally throttles screen updates to a fixed framerate). But that's solvable; Mosh would need some sort of algorithm to sync scrollback contents with the server, ideally with a lower priority than screen updates.

  18. caruccio commented on Jan 23, 2020

    @caruccio
  19. habibalamin commented on Feb 27, 2020

    @habibalamin
  20. rjurney commented on Feb 27, 2020

    @rjurney
  21. rjurney commented on Feb 27, 2020

    @rjurney
  22. andersk commented on Feb 27, 2020

    @andersk
    MemberAuthor

    Let’s bring this conversation back down from low Earth orbit, guys. The reason Mosh doesn’t support scrollback has nothing to do with philosophy. It also has nothing to do with whether this ticket is open or closed—there’s already a ticket open for scrollback, and it’s not this ticket, which was about alternate screen mode. It has everything to do with limited developer time. If you’ve read the Mosh paper, you’ll understand how the way Mosh prioritizes interactivity makes delivering usable scrollback a challenge, so it was left out of the initial implementation and nobody has had time to add it since. If we had infinite time to work on Mosh, a scrollback feature would likely be a priority. Nobody is stopping you from developing this functionality if you are interested, and as always, a well-designed, well-implemented pull request is likely to be accepted. But complaining on a closed issue isn’t going to make that happen any faster.

  23. JohanMollevik commented on Feb 27, 2020

    @JohanMollevik
  24. habibalamin commented on Feb 28, 2020

    @habibalamin
  25. eminence commented on Feb 28, 2020

    @eminence
    Member

    I am going to unlock the open issue about scrollback, since it's had a chance to cool off. However, please avoid commenting on that issue (or this issue) if there is nothing new to add. There are "reaction" buttons in github that can be used to express your interest (which don't spam the whole thread), and comments like "+1" aren't useful. We know this is a very important issue to some people and that running screen/tmux on the server isn't always a convenient or acceptable solution.

    Comments about unix philosophy are interesting, but are definitely off-topic for this github issue tracker. (However, you're welcome to join our #mosh IRC channel on freenode to discuss such things).

  26. geohuz commented on Jan 25, 2021

    @geohuz
  27. removed this from the mosh-future milestone on Jan 22, 2023
  28. ZenBerry commented on Jul 5, 2024

    @ZenBerry
  29. marek22k commented on Sep 27, 2026

    @marek22k

    The website says that the issue is being tracked here, but the issue is closed, and when I try to scroll, it doesn't work. What is the current status?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions