How to detect if the program is run in a ConPTY terminal or in a regular CMD? #19702
Unanswered
Konstantin Kompan (trexxet)
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
It's surprising that Microsoft has not implemented an API call for such an important question - CMD and ConPTY have different line numbering!
Currently, I'm doing it by comparing the buffer size with the window size:
conpty = (csbi.dwSize.Y == csbi.srWindow.Bottom - csbi.srWindow.Top + 1);I'm not sure if that's a reliable method, so I'm asking for a proper directions.
All reactions