How do I save the cursor position into a variable in TCL ?
The best I can come up with is:
set tty [open /dev/tty w]
puts $tty "\033\[6n"
close $tty
set position [read stdin]
puts $position
but I cannot capture the output.
I have also tried using ::term::ansi::send::qcp
from Tcllib but get the same problem.
(FYI I tried to model the above TCL on a PHP answer from How to get cursor position with PHP-CLI?).