[mosh-devel] Backspace into shell prompt bug

john hood cgull at glup.org
Mon Aug 1 19:52:28 EDT 2016


Mosh's prediction is rather simple, and only reflects characters typed 
at the keyboard.  Yes, it can be cosmetically ugly for the time that it 
lasts.  It does have the benefit of being fairly predictable in its 
behavior and easy to learn to work with.

The scheme you outline is specific to shells and could fail due to 
prompt changes, for example $PWD.  A simpler scheme might be to note 
where the cursor is when the first keyboard input is received on a new 
row of text, and not do predictive display for columns to the left of 
that.  But this is imperfect too:  consider word wrap in an editor; the 
wrapped word is printed on a new line and the cursor is positioned after 
it.  In that case, backspacing over the wrapped word to delete it is a 
normal edit.

Any more ideas?

regards,

   --jh

On 8/1/16 12:07 PM, John Leuenhagen wrote:
> Hello,
>
>           I have been using mosh for a while now, and it really saves me
> a lot of time and takes care of the frustration that comes with using
> ssh over a slow connection. I thought that I would inform you of the one
> quirk that I've experienced with it. It hardly impacts functionality,
> but if you hold backspace to clear a line of text (specifically on the
> shell), you are able to delete the entire prompt as well. I imagine this
> would be due to the way mosh "displays now, updates later". I would
> imagine that one way this could be eliminated would be by reading the
> file that sets up the shell, such as .bashrc for bash, generating a
> sample prompt string, matching it with that received over mosh, and
> preventing it from being deleted. That's just an idea I came up with on
> the fly though, so there's likely a better way to get the desired
> result. I understand if it's too much work for such a small issue, so
> don't sweat it if you're not up to it.
>
> Thanks,
>
> -John Leuenhagen
>
>
> _______________________________________________
> mosh-devel mailing list
> mosh-devel at mit.edu
> http://mailman.mit.edu/mailman/listinfo/mosh-devel




More information about the mosh-devel mailing list