TerminalEmulator: Add cursor movement support