-
Maybe I'm thinking about this all wrong, but is there a way to get the current cursor position (top, left)? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The Keep in mind that the concept of top/left cursor coordinates is only relevant when outputting into some screen/console buffer, and becomes meaningless when console output is being redirected. |
Beta Was this translation helpful? Give feedback.
The
System.Console
class has properties to query this and other information about the cursor: https://learn.microsoft.com/en-us/dotnet/api/system.console#properties (note that cursor position is relative to the console/screen buffer, which can and often is larger than the actual console window. There are also properties that tell which part of the screen buffer is displayed in the console window, so you can translate between screen buffer coordinates and console window coordinates if you need to.)Keep in mind that the concept of top/left cursor coordinates is only relevant when outputting into some screen/console buffer, and becomes meaningless when console output is being redirected.