简体   繁体   中英

c++ get terminal size using ansi

I'm trying to get the terminal size using ansi escape codes. I found some help in How do I determine size of ANSI terminal? but i cannot understand how to get the response from DSR6 to get the row / column of the bottom right corner. Thank you. I need this because im trying to align some text in the middle of the terminal.

I don't have a solution using ansi escape codes, but this solution here gives you the terminal size in both Windows and Linux: https://stackoverflow.com/a/62485211/9178992

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM