Kernel targets print extraneous shell prompt at end
$ ./target/debug/vmtest -k tests/.assets/bzImage-v6.2-empty ls
=> bzImage-v6.2-empty
===> Booting
===> Setting up VM
===> Running command
Cargo.lock
Cargo.toml
docs
LICENSE
Makefile
README.md
scripts
src
target
tests
vmtest.toml
[root@(none) /]#
Note the [root@(none) /]# at the end.
I think it happens b/c of the login terminal in init.sh: https://github.com/danobi/vmtest/blob/fd8316159a53bee55acb8c6a57c0c65c1b3c28e6/src/init/init.sh.template#L114
Not sure the best way to suppress that prompt. One option is to use templating engine to ifdef the login shell out. But it'd be preferable to have one codepath for all kernel targets.
Another option is to ignore the final line in ui.rs. But that's a total hack.
A third option is to insert a break after handling CommandEnd: https://github.com/danobi/vmtest/blob/fd8316159a53bee55acb8c6a57c0c65c1b3c28e6/src/ui.rs#L207-L230. But the command output streamer runs in a separate thread. So we could receive CommandEnd before all the output is streamed to the UI. Better to allow the out-of-order output rather than potentially truncate.
If the prompt is coming from setsid --ctty --wait /bin/bash --login , I would go with your first suggestion.