[mosh-devel] Prompt length recognition

Timo Sirainen tss at iki.fi
Wed Nov 21 22:05:06 EST 2012


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..





More information about the mosh-devel mailing list