I’m using some Ruby code that shells out to stty size to get the size of the terminal, but I’m running on Windows. What is the Windows equivalent?
I’m using some Ruby code that shells out to stty size to get the
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The MODE command will report the size of the window buffer but not the actual window size.
You may have to write a utility to get the window size using GetConsoleScreenBufferInfo.
See: https://learn.microsoft.com/en-us/windows/console/getconsolescreenbufferinfo