[mosh-devel] Prompt length recognition

Keith Winstein keithw at MIT.EDU
Wed Nov 21 22:29:38 EST 2012


We did used to have some code in Mosh to try to do exactly this. It
tracked the first column that the user had actually typed something
in. But it ended up leading to more (and more frustrating) mistakes
than it averted. I think while we still have a relatively
unsophisticated prediction machine (only one thread of predictions at
a time), on balance not trying to get too fancy is better in practice.

On Wed, Nov 21, 2012 at 10:05 PM, Timo Sirainen <tss at iki.fi> wrote:
> On 19.11.2012, at 19.28, Florian Bruhin wrote:
>
>> Just my two cents:
>>
>> * Adam Stankiewicz <sheerun at sher.pl> [2012-11-18 19:49:54 +0100]:
>>> For now if you hit backspace, it is going to delete half of the
>>> terminal prompt, and print it again afterwards.
>>>
>>> Using command prompt is standard, wouldn't it be possible for mosh to
>>> dynamically recognize the length of it and prevent erasing after
>>> holding the backspace?
>>
>> And what if I'm using an editor and happen to have some lines which
>> start with the same characters? Then I can't erase them? ;)
>
> The prediction goes wrong. It gets still erased.
>
>> * Timo Sirainen <tss at iki.fi> [2012-11-19 18:53:45 +0200]:
>>> Also another related thing I thought about was that if after
>>> pressing enter the cursor moves to the same same X and Y or Y+1
>>> coordinate as after previous enter, it could immediately assume that
>>> prediction works (instead of only after typing 1 (or was it 2)
>>> chars).
>>
>> Well, I don't want my password being echoed just because my command
>> prompt happens to be the same length than the "Changing password for
>> USERNAME" prompt or anything like that ;)
>
> Good point. But a small checksum of the characters at the beginning of line would solve this.
>
>> I previously brought up the suggestion of having a special "control
>> code" which means "end of prompt" so you could simply include that
>> into a shell- or irc-client-prompt.
>
> That would be a nice workaround, but very mosh-specific..
>
>
> _______________________________________________
> 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