processInput method
Processes an input string containing text and ANSI sequences.
Updates the terminal buffer and cursor position accordingly.
Implementation
void processInput(String data) {
for (int i = 0; i < data.length; i++) {
String char = data[i];
_handleCharacterByState(char);
}
}