Closed empath-75 closed 1 year ago
If you are willing to "lie" about the cursor being the cursor and instead do the highlighting yourself (by setting the background color and watching where the user moves the cursor) you can simulate what you're trying to do. We do this at https://gitlab.com/ttyperacer/terminal-typeracer for a slightly different purpose.
The solution isn't perfectly clean, but it works if you need something.
It's worth noting there may be a better answer, but I am unaware of any.
Let's say I have some text I want to the user to be able to select in a long paragraph. I've figured out how to move the cursor around and scroll, but I can't figure out how to tell what is currently in the view port under a cursor -- is there any function that returns that?