New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mosh prevents the use of scrollback #122

Open
taralx opened this Issue Apr 10, 2012 · 82 comments

Comments

Projects
None yet
@taralx
Copy link

taralx commented Apr 10, 2012

If I use mosh to connect, and then run a command with a lot of output, e.g. ps, my scrollback buffer doesn't get any of the overflow. This is sad-making -- I don't always know when a command will produce a lot of output, and, additionally, I like scrollback for seeing previous commands' output.

@keithw

This comment has been minimized.

Copy link
Member

keithw commented Apr 10, 2012

Thanks. The're a compromise here between skipping frames for speedy terminal support and wanting to have everything sent to the local terminal, and mosh picks a particular (not necessarily perfect) point on that spectrum. The workaround for now is to run "screen" or "tmux" on the remote end and use that for scrollback.

@wjessop

This comment has been minimized.

Copy link

wjessop commented Apr 23, 2012

I realise this is a closed issue, but not seeing all the output of a command is a real blocker for me. If I run a command I need to see all the output, having to load up screen or tmux with it's non-native scroll support doesn't really work.

Is there no way we could set an option for not discarding all the output?

@taralx

This comment has been minimized.

Copy link

taralx commented Apr 23, 2012

I understand why this is closed -- mosh doesn't actually send the stream to the client, so dumping all but the last screen is correct behavior.

I would love an option to have an extended "screen" which included X lines of scrollback, but that's more of a feature request, and is hard.

@keithw

This comment has been minimized.

Copy link
Member

keithw commented Apr 23, 2012

We are working on this for mosh 1.3 and will try to do the most pleasant thing possible. You can follow this issue at #2.

@ShadSterling

This comment has been minimized.

Copy link

ShadSterling commented Jul 15, 2012

Without seeing the output, I don't know what my command did. This is completely unacceptable, especially without any warning. I will not use mosh again.

@jessejoe

This comment has been minimized.

Copy link

jessejoe commented Apr 23, 2013

Since #2 is now closed, and this issue was not affected, can this possibly be reopened?

@andersk andersk reopened this Apr 23, 2013

@enagorny

This comment has been minimized.

Copy link

enagorny commented May 29, 2013

+1 for such functionality

@xapple

This comment has been minimized.

Copy link

xapple commented Jun 17, 2013

It's been about a year now that I have my eye on mosh waiting for this feature to be implemented. I think mosh could become an essential tool -- but not until this works. Let's face it: without scrollback it's pretty useless in the real world (except when you are trapped in a lift maybe).

@KamilKedzia

This comment has been minimized.

Copy link

KamilKedzia commented Jun 27, 2013

Scrollback is essential in everyday use. I was about to make mosh my primary tool for remote work but as I discovered this flaw I'm back to ssh. I might consider getting back to mosh when working in extremely poor networking conditions but giving up scrollback for the possibility of having single ssh session at work, commuting and at home is not an option.

@ViViDboarder

This comment has been minimized.

Copy link

ViViDboarder commented Aug 1, 2013

I just noticed this as an issue, but using gnu-screen isn't a big deal for me. Maybe I'll look into tmux or something too.

Some resources for those of you not familiar. Getting multiple windows out of one SSH session is a pretty good feature anyway for those of you not using it.

http://www.howtogeek.com/58487/how-to-easily-multitask-in-a-linux-terminal-with-byobu/
http://www.howtogeek.com/114582/2-alternatives-to-gnu-screen-for-linux-terminal-multitasking/

@garrettreid

This comment has been minimized.

Copy link

garrettreid commented Aug 12, 2013

Another +1, the lack of scrollback is a usability issue for me. I realize this feature is probably a lot of work, but it would really improve my life, let me use mosh in more cases, and probably solve world hunger.

@JeffBezanson

This comment has been minimized.

Copy link

JeffBezanson commented Aug 15, 2013

+1
I can make do with the screen workaround but this would be great.

@nikolay

This comment has been minimized.

Copy link

nikolay commented Aug 20, 2013

+1

This "feature" is a major blocker. If I have to run screen myself, honestly, there's little value in mosh as screen already solves the dropped connection issue and I can resume where I left without all the negatives like high latency and weird cursor behavior.

@FiloSottile

This comment has been minimized.

Copy link

FiloSottile commented Oct 15, 2013

I guess that the scrollback does not need to be as fast as the actual terminal, so mosh might cache on the server and then slowly stream to the client that would catch up eventually.

@jjn2009

This comment has been minimized.

Copy link

jjn2009 commented Nov 18, 2013

+1
I find the lack of scroll back to be pretty unacceptable as well.

@bufferunderflow

This comment has been minimized.

Copy link

bufferunderflow commented Dec 22, 2013

no backscroll, hulk SMASH!!!

@zwass

This comment has been minimized.

Copy link

zwass commented Dec 26, 2013

+1

@hamiltont

This comment has been minimized.

Copy link

hamiltont commented Dec 29, 2013

+1 - This issue is also preventing me from using mosh 100% of the time. Do any shells/terminal programs exist with APIs to deal with native scrolling? Perhaps something to get the ball rolling in this case would be a proof of concept for an easy client, instead of searching for the general solution for every shell

@mkawalec

This comment has been minimized.

Copy link

mkawalec commented Jan 2, 2014

Just to add one more voice to this stream of lament, I will happily use mosh once this feature is added. It doesn't really work for me in this state.

@ghost

This comment has been minimized.

Copy link

ghost commented Jan 5, 2014

Scrollback is a major feature and without it mosh will not be fully functional tool. I understand limitations but this should be configurable for user. Sorry, I have to back to ssh for now.

@Nishith

This comment has been minimized.

Copy link

Nishith commented Jan 6, 2014

+1
Adding to the chorus.

@otto2704

This comment has been minimized.

Copy link

otto2704 commented Jan 7, 2014

+1
me too (especially that it should be configurable. eg maybe not necessary on a phone, but essential on a linux box in my eyes)

@NathanielCapital

This comment has been minimized.

Copy link

NathanielCapital commented Jan 9, 2014

+1
Without scrollback feature, the mosh session doesn't really feel persistant, the workaround of tmux and screen is really very very inconvenient in some cases, like now I am using mobile phone to connect. You can simply scrollback by swipe if the feature is there, but using hot-keys like ctrl-a [ make the an mental interruption in the workflow.

@ekenberg

This comment has been minimized.

Copy link

ekenberg commented Jan 11, 2014

Any news on this? Native scrollback (ie swipe in Mac OS X Terminal) is essential for an efficient workflow. Please consider making this feature a priority! Thank you.

@andersk

This comment has been minimized.

Copy link
Member

andersk commented Jan 11, 2014

Even if this is implemented, you’re most likely not going to get native scrollback. Native scrollback would require sending all the scrollback data to the local terminal in sequential order, which would totally erase Mosh’s features of graceful packet loss handling and working Control-C. If you don’t want Mosh’s features, you might as well just use SSH.

The plans we’ve discussed (see #2) involve adding new Mosh-specific key bindings to access a dynamically loaded server-side scrollback buffer, similar to what you can already achieve by running screen inside of Mosh.

As far as I’m aware, no code has been written (and repeating “+1” over and over isn’t going to magically cause code to become written).

@ekenberg

This comment has been minimized.

Copy link

ekenberg commented Jan 11, 2014

@andersk Thank you for the update. Sorry about native scrollback, I didn't think that through before posting. I just started using Mosh, and the only thing I care about is being able to survive network roaming. Anyway, thanks.

@jordanade

This comment has been minimized.

Copy link

jordanade commented Sep 23, 2016

It sounds like most would be happy without "complete native scrollback" but rather, say, 3x or some configurable ratio of the current screen's height. But it sounds like mosh couldn't do this without communicating the false 3x height to apps like vi and emacs, thus ruining their full-screen UI. There's no way to tell the server that the screen is 24 rows while actually syncing 72 rows. Is that right?

@cgull

This comment has been minimized.

Copy link
Member

cgull commented Sep 23, 2016

Correct. The emulated terminal's window size must be the same as that displayed for full screen apps to work well. The way scroll back is usually implemented is that an emulator maintains a separate buffer of rows for scroll back. When cursor motion pushes text off the window it's copied into the scroll back buffer. So the size doesn't matter much for implementation.

But on Mosh, we have to do that on the server side and then find some way to display it on client, either in band from the remote server (but screen/tmux do this well already) or out of band, on the local client, with an extension to the protocol (big task, and it still wouldn't get native-like scroll back in your outer GUI terminal emulator). It's not an easy/trivial issue to solve.

@gvaish

This comment has been minimized.

Copy link

gvaish commented Nov 30, 2016

Though not really a perfect solution, but using screen helps me scrollback.

Using the default bindings for screen:

. Execute C-a Esc to enter into copy / block selection mode.
. Use mouse scroll, up/down or C-b/C-f to scroll.

@MisterTea

This comment has been minimized.

Copy link

MisterTea commented Mar 22, 2017

If you are willing to sacrifice type prediction, you can use Eternal Terminal. ET keeps your connection alive and supports native scrollback: https://mistertea.github.io/EternalTCP/

@ezyang

This comment has been minimized.

Copy link

ezyang commented Apr 11, 2017

4ast@b642df6 may be of interest

@rerime

This comment has been minimized.

Copy link

rerime commented Apr 13, 2017

Mrrr.....Hope it will ever be implemented
+100500

@sterpe

This comment has been minimized.

Copy link

sterpe commented May 8, 2017

Guessing this is still not resolved...

@roosemberth

This comment has been minimized.

Copy link

roosemberth commented May 13, 2017

+1, I think people would even like a bounty for this

@danielmotaleite

This comment has been minimized.

Copy link

danielmotaleite commented Jun 27, 2017

how about having a mosh option to automatically start screen or tmux... this would allow both the mosh features and the screen/tmux scrollback!

I think most people really miss the scrollback, but always forget to start screen or tmux ... if mosh could do that automatically, the problem is solved

@t-nelson

This comment has been minimized.

Copy link

t-nelson commented Jul 1, 2017

@danielmotaleite mosh doesn't need to support that. You can do it yourself. I've achieved the same for years with the following for in ~/.profile

if [[ "$SSH_TTY" != "" ]]
then
  if [[ "$TERM" != "screen" ]]; then
    screen -dr default
    if (($?)); then
      screen -ln -S default
    fi
  fi
fi
@calder

This comment has been minimized.

Copy link

calder commented Jul 13, 2017

+large-number. This is a dealbreaker.

@cpakkala

This comment has been minimized.

Copy link

cpakkala commented Jul 21, 2017

I appreciate all the hard work on mosh, but the "workaround" is simply not good enough. No one has mentioned it, but I find it hard to believe that I'm the only one whose use-case is as follows:

Start a single tmux session on one host, per activity ("session" and "activity" to me are synonymous), and then use mosh within various tmux panes to remote into other machines. This is much cleaner and more organized than moshing into each machine and then starting a tmux session on each one. More importantly doing the latter breaks the abstraction of an "activity" for me; yet the former is problematic because then I either have to deal with the missing scrollback in each of the mosh panes, or I have to nest a tmux session in each pane. Nesting, of course causes many larger issues and is to be avoided...

@ddacunha

This comment has been minimized.

Copy link

ddacunha commented Aug 7, 2017

I believe I have read most of the 67 previous comment I appreciate this issue is still open so that mosh can gracefully manage packet loss handling and have an always working Control-C.
However I have not seen the following proposal: could I choose how many lines mosh actually returns to my terminal upon completion of the command? Or is that not possible without the terminal app allowing to change the terminal history?

@rledisez

This comment has been minimized.

Copy link

rledisez commented Aug 10, 2017

I rebased patch from @4ast on v1.3.2 (see last two commits on https://github.com/rledisez/mosh/commits/localScrollback-1.3.2)

@andersk if I take time to make it an option that must be enabled on the client side, would this be something that could be accepted eventually?

At this point, I'm just asking if it is worth I spend time on it (if yes, i take any advices ;))

@NoahO

This comment has been minimized.

Copy link

NoahO commented Oct 3, 2017

@rledisez even if you have to fork mosh, you will still have users. I can't use eternalTCP because I need UDP support.

@netroby

This comment has been minimized.

Copy link

netroby commented Dec 20, 2017

+1 scrollback

@crushcafeteria

This comment has been minimized.

Copy link

crushcafeteria commented Feb 22, 2018

please give us scrollback. pleaseeeeee.....

@eminence eminence referenced this issue Mar 29, 2018

Closed

Mosh history #969

@Sora233

This comment has been minimized.

Copy link

Sora233 commented Apr 13, 2018

+1

@Jan69

This comment has been minimized.

Copy link

Jan69 commented Jun 21, 2018

I can't believe this has dragged on for 6 years, at this point, and still nowhere near the answer....
also, unrelated to this specific issue, but there's no way to even just disable all of the history-stuff? why not?

@tomas

This comment has been minimized.

Copy link

tomas commented Aug 2, 2018

@rledisez does scrollback work in your branch? if there's anything missing just point me in the right direction and I'll try to get it working.

@shovas

This comment has been minimized.

Copy link

shovas commented Aug 10, 2018

+1 Scrollback needed. Screen or tmux are effective, I imagine, but I don't think I'd make the switch without this being native. I just don't like have to run extra programs every time I login. I have too many sessions for that.

@KopfKrieg

This comment has been minimized.

Copy link

KopfKrieg commented Aug 10, 2018

I have too many sessions for that.

How about one tmux session per machine? You can create new "windows" within tmux, or split the view.

@tomas

This comment has been minimized.

Copy link

tomas commented Aug 16, 2018

I'm trying out @rledisez's branch and, although type prediction isn't available, native scrollback works beautifully.

@abhatia2107

This comment has been minimized.

Copy link

abhatia2107 commented Sep 7, 2018

@rledisez As it looks like native scrollback is working in your branch. Can we expect it to come in master branch?

@NyaMisty

This comment has been minimized.

Copy link

NyaMisty commented Nov 8, 2018

Why there aren't any feedback from the maintainers?
This issue has been opened for almost 6.5 years, and someone has made a patch.
Whether merge it or not, plz give us some response ;)
I'm hoping this will be resolve before its 7th anniversary.

@LvChengbin

This comment has been minimized.

Copy link

LvChengbin commented Jan 8, 2019

+The weight of the world.

To use tmux together with mosh can solve this problem by adding set -g mouse on in .tmux.conf file.

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