Giter VIP home page Giter VIP logo

Comments (6)

keithw avatar keithw commented on September 27, 2024

This is "basically" intended behavior -- the predicted cells are
updated to deal with the CR and the innocent bystanders are left to be
updated by the server.

But much better would be to only show the new prediction after the new
epoch (post-CR) is confirmed. Right now only cursor movements are
versioned into epochs; for cell predictions we only keep the most
recent prediction epoch.

So my plan here is to also store a list of overlay epochs to fix this.
If done right this will also fix related problems where if you press
"backspace" fast enough, you can backspace past the entire prompt even
if the RTT is fast. (Because each backspace makes a new epoch so we
never have a chance to verify the accuracy of the old epoch and see
that it was wrong...)

On Thu, Feb 9, 2012 at 4:16 PM, Anders Kaseorg
[email protected]
wrote:

If I press Enter after

(Last line of output from the previous command)
andersk@dr-wily:~$ echo hello_

at the bottom of the screen, mosh temporarily shows the following prediction:

(Last line of output from llo
andersk@dr-wily:~$ echo hello_

Reply to this email directly or view it on GitHub:
#6

from mosh.

saurik avatar saurik commented on September 27, 2024

Maybe there could be a special case: "if enter is pressed while on the bottom line mosh treats it like a carriage return without a line feed" (maybe even clearing the line)?

This particular prediction glitch happens constantly, and I will claim is the most obvious thing that makes one realize they are "in the matrix" and are not using a "real" terminal: every single command typed into the shell (as you will pretty much always be at the bottom row of the screen) causes this glitch. It would be one thing if this was something that happened only every now and then, but I find myself staring at this glitch more than I find myself doing any actual work.

In other applications, it is simply brutal: if you are in an IRC client, such as irssi, this glitch temporarily destroys the status bar (which is rendered above the text input line) every single time you hit enter, and you have to wait for it to resynchronize to fix it. (I will also point out that I'm not the only person who noticed this more severe glitch while using irssi: in fact, I hadn't gotten mosh working well enough to even use irssi yet by the time a couple of my friends reported the status bar flashing.)

from mosh.

keithw avatar keithw commented on September 27, 2024

Well, you are of course right that it's annoying (and that's part of why we only use predictions on long-latency links and to smooth out glitches, not for everybody).

I've experimented with some other options (clearing the predictions completely, not clearing the predictions), and they all have seemed worse to me in actual usage, but I am open to ideas. I do think simply versioning the cell predictions (as we already do for cursor predictions to great success) is the solution here.

I would make a distinction between what happens at the shell (which is a correct prediction, although it is jarring for the user to see it "before its time") versus what happens in irssi (where mosh is just wrong in predicting that the screen will scroll), but maybe this is irrelevant.

from mosh.

saurik avatar saurik commented on September 27, 2024

The prediction at the shell isn't right, though, because of the way the synchronization occurs: while the line does "move up", it does not end up at the line directly above the cursor, and the synchronization algorithm redraws all of the content above before fixing that. That is what is meant by the "(Last line of output from llo" description in the original issue: the glitch that you see is that just a few characters from the end of your command (not the entire line, which would be more reasonable) get moved up by a line, the output of your command appears (as expected, but truncated at the position of the gitch), and only afterwards does the random weird floating prediction of the last few characters from your command disappear and get replaced by the real output.

from mosh.

keithw avatar keithw commented on September 27, 2024

Fair enough. Let me experiment more with this and maybe we can make a temporary change before we have full versioned cell predictions.

If you want to experiment, try commenting out the part of PredictionEngine::newline_carriage_return() between line 765 (for ( overlays_type::iterator i = overlays.begin();) and the comment on line 778 (make blank prediction for last row).

from mosh.

saurik avatar saurik commented on September 27, 2024

I tried that, and the difference is like night and day: there are no more glitches in either bash or irssi, and suddenly I feel like I've exited the matrix! ;P Thank you so much for that suggestion: you just made my day, this is downright epic.

from mosh.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.