This is cmd engine rewrite part XXXXI.
Main goal is to cover bug entry 39289.
To do so we need to: - properly handle the echo of commands when not in interactive mode + good news if that this shares mostly the code we added to rewrite commands to pass them in pipe sub-shells, + also fixing the handling of @ at start of command (there we a bunch of issues: it was only supported at the start of a single command, all the other forms IF/FOR/() are supposed to handle them too) + some of the tests assumed there is some kind of propagation of @ in chained commands; I do believe it's mostly linked to the commands actually run + most of the tests related to echo now pass (expect a few where there are discrepancies but only on the number of spaces inserted). I don't feel like fixing these unless an app actually depends on it, - fix a couple of other issues: + prompt $H actually echo:es \x08\x20\x08 instead of \x08... to ensure that prev char is actually cleaned (manually tested on Windows) + loop variables when not expanded inside a !foo! construct (other env variables were).
Test program from Bug 29389 works as expected, even if output isn't as nice as on windows, mainly because of conhost refresh rate (BZ#56851).
Side note: this is probably the last MR from the cmd engine rewrite saga. There are still open tickets on cmd.exe but most of the structural work should be ok by now.