Re: Get current cursor row as ASCII #
2007-05-18, 07:59(+00), Bill Marcum:
[...]
> stty -echo; echo -n $'\e[6n'; read -d R x; stty echo; echo ${x#??}
>
> "read -d" works in bash or zsh; see the manual for other shells.
>
> I would use tput instead of echo, but terminfo doesn't seem to have a
> name for the \e[6n sequence.
[...]
It's sometimes found in u7.
$ tput u7 | od -c
0000000 033 [ 6 n
0000004
--
Stéphane
|