-
-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get x, y from the result of cursorGetPosition #22
Comments
https://stackoverflow.com/questions/8343250/how-can-i-get-position-of-cursor-in-terminal We should indeed document this better. |
And so? I tried to listen |
Yeah have the same question as @lebaphi. How do I use this with provided API? In my case I need to fully redraw what's on the terminal "screen" but without removing history, so I came up with idea to remember initial cursor position and set it before |
To be completely fair and honest, I've never personally gotten this escape code to work. Supposedly, you're supposed to read from stdin after issuing this code. This, however, has never worked for me. I've not seen a program actually use this before and I've always kind of assumed it's a dead escape code lost to the sands of time, lol. If you want my domain-expert opinion, don't use this escape code. Find a better way to do it. |
aight, thanks. Know some library for my needs? I mean "redrawing" what's in terminal without clearing history |
@carljohnesan Check out |
This seemed to work for me decently well. https://github.com/bubkoo/get-cursor-position/blob/master/index.js |
I get the result from
cursorGetPosition
is: ^[[12;1R. So how can to parse or convert this to x, y then I can use other API likescursorMove
?The text was updated successfully, but these errors were encountered: