How can I get position of cursor in terminal?
At ANSI compatible terminals, printing the sequence ESC[6n will report the cursor position to the application as (as though typed at the keyboard) ESC[n;mR, where n is the row and m is the column. Example: ~$ echo -e “\033[6n” EDITED: You should make sure you are reading the keyboard input. The terminal will “type” just … Read more