When a new build starts, the AnsiConsole is installed on a background thread. If the build finishes very quickly and without using that console (e.g. failed to parse settings.xml), it can happen that the systemUninstall call in the shutdown code happens before this systemInstall call. This leaves the system in a broken state for the next build when using an embedded runner.
The shutdown code needs to wait for the startup to ensure that it leaves the terminal and System.out/System.err in a consistent state