|
|
|
@ -16,22 +16,12 @@ fathom_cursor() {
|
|
|
|
|
esac |
|
|
|
|
done |
|
|
|
|
|
|
|
|
|
# Get the position of the cursor |
|
|
|
|
|
|
|
|
|
# Save the current terminal state |
|
|
|
|
old_state=$(stty -g) |
|
|
|
|
|
|
|
|
|
# Disable terminal echo and canonical mode |
|
|
|
|
stty -echo -icanon |
|
|
|
|
|
|
|
|
|
# Request the cursor position |
|
|
|
|
printf "\033[6n" |
|
|
|
|
IFS='[;' read -r _ ROW COL |
|
|
|
|
|
|
|
|
|
# Restore the terminal state |
|
|
|
|
stty "$old_state" |
|
|
|
|
|
|
|
|
|
position="$COL;$ROW" |
|
|
|
|
# Get the position of the cursor |
|
|
|
|
printf "\033[6n" |
|
|
|
|
while IFS=';' read -r -d R ROW COL; do |
|
|
|
|
break |
|
|
|
|
done |
|
|
|
|
position=$(printf "%s;%s" "${ROW#*[}" "${COL%%R*}") |
|
|
|
|
|
|
|
|
|
if [ $x = true ] && [ $y = true ]; then |
|
|
|
|
if [ $verbose = true ]; then |
|
|
|
|