Another code snippet to check out, but this one will not slow things down as much as the previous one:
        buffer.Remove(idx);
        // remove the '>>>>>>' part of the prompt (or whats left of it)
        int cnt = 6; // max 6 '>'
        while (!buffer.empty() && buffer.Last() == _T('>') && cnt--)
            buffer.RemoveLast();
        if (!buffer.empty() && buffer.Last() == _T('\n'))
            buffer.RemoveLast();
        cmd->ParseOutput(buffer.Left(idx));
 Check the first line and then ask yourself why the last line is not cmd->ParseOutput(buffer);
The first line is: Removes all characters from the string starting at idx, but it just returned the modified buffer, so the buffer is not changed. Right?
The last line is: Removes all the characters after the idx, and pass to the ParseOutput function.
So, the first line did nothing?