Skip to content

How do I get and set the cursor position? Where is the buffer? #16

Answered by alexrp
Thraka asked this question in Questions
Discussion options

You must be logged in to vote

I'm unsure though how I get/set the cursor to a specific position.

Setting the cursor position is done with the MoveCursor* family of methods on Terminal.

The only cursor tracking currently supported is via the SaveCursorPosition/RestoreCursorPosition methods on Terminal, which use DECSC and DECSR.

The reason that there isn't a more general CursorPosition property is that it's actually really complicated to do in VT100. You have to write a DECXCPR and then read a response. That sounds simple enough on the surface until you realize that there can be arbitrary data coming in on standard input between sending the query and getting the response. That data then has to be put into a buffer of…

Replies: 4 comments

Comment options

alexrp
May 2, 2020
Maintainer Sponsor

You must be logged in to vote
0 replies
Answer selected by alexrp
Comment options

You must be logged in to vote
0 replies
Comment options

alexrp
May 8, 2020
Maintainer Sponsor

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #16 on December 26, 2020 11:24.