RosettaCodeData/Task/Terminal-control-Cursor-movement/Tcl/terminal-control-cursor-movement.tcl
Ingy döt Net 68f8f3e56b all tasks
2013-04-11 01:07:29 -07:00

18 lines
624 B
Tcl

# Simplification wrapper for when we're actually affecting the terminal
proc tput args {
exec tput {*}$args >@stdout <@stdin
}
tput cub1; # one position to the left
tput cuf1; # one position to the right
tput cuu1; # up one line
tput cud1; # down one line
tput cr; # beginning of line
tput home; # top left corner
# For line ends and bottom, we need to determine size of terminal
set width [exec tput cols]
set height [exec tput lines]
tput hpa $width; # end of line
tput cpu $height $width; # bottom right corner