RosettaCodeData/Task/Terminal-control-Cursor-movement/Mathematica/terminal-control-cursor-movement.math
2023-07-01 13:44:08 -04:00

12 lines
546 B
Text

Run["tput cub1"] (* one position to the left *)
Run["tput cuf1" ] (* one position to the right *)
Run["tput cuu1" ] (* up one line *)
Run["tput cud1"] (* down one line *)
Run["tput cr"] (* beginning of line *)
Run["tput home"] (* top left corner *)
WIDTH=RunThrough["tput cols", ""];
HEIGHT=RunThrough["tput lines", ""];
Run["tput hpa "<>WIDTH] (* end of line *)
Run["tput cup "<>HEIGHT<>" "<> WIDTH] (* bottom right corner *)