protected void StripControlChars(RCArray <string> result) { // So far this only comes into play on Windows when using wsl to execute shell scripts. // This is the output of the bash 'clear' command. // Let's be minimally aggressive to start. if (result.Count > 0 && result[result.Count - 1] == "\u001b[H\u001b[2J") { result.RemoveAt(result.Count - 1); } }