[PATCH 1/6] test: Make handling of shell prompts with escapes a little more reliable