Add safety checks to control the cursor, add tty cursor position