[Toybox] vi

Rob Landley rob at landley.net
Thu Jun 17 02:20:18 PDT 2021


On 6/16/21 2:38 PM, Jarno Mäkipää wrote:
>> vi existing_non_empty_file
>> seems to work
>> I normally use Space key to navigate to the right but that doesn't seem to work, I have to use l key or right arrow key.
>> :1  doesn't bring me to line 1 (:number doesn't seem to work).
> 
> Most keycommands are still unimplemented, and some implemented ones
> may work incorrectly. Basic browsing of text file and some simple edit
> commands work.

I need to implement a pty master/slave pair that can wire up to the txpect()
plumbing in scripts/runtest.sh, so I can test commands with synthetic screen
width/height and starting cursor position.

Unfortunately I probably CAN'T come up with tests that both the host command and
the toybox command will reliably both pass in that setup, because host command
output isn't guaranteed to be consistent. (What it actually writes to the TTY in
what order is going to be version skew city, especially if it's using one of the
termio descendant libraries listening to $TERM, even if I feed it a known $TERM...)

And this is apart from the fact that testing something like "top" would have
butterfly effects all over the place in WHAT it's displaying, even if run in a
carefully constructed VM (ala mkroot). Kernel version skew launching a different
number of kernel threads changes starting PIDs, what order the results show in
because scheduler CPU time slice decisions...

But vi, which, and toysh command editing/history I can probably come up with
reasonable tests for given some infrastructure upgrades. Not this week, though...

Rob



More information about the Toybox mailing list