开发者

Request terminal size [C - Linux]

开发者 https://www.devze.com 2023-01-13 17:42 出处:网络
I\'m trying to make a nice looking terminal game, but a lot of the things 开发者_Go百科i\'d like to do need a constant screen size. So i need the program to request a certain size every time it is ran

I'm trying to make a nice looking terminal game, but a lot of the things 开发者_Go百科i'd like to do need a constant screen size. So i need the program to request a certain size every time it is ran. Is this possible, if so how?


The ncurses library has functionality for handling terminal sizes. This has been answered here and here regarding terminal dimensions.


You can only get the existing size, but you can't ask for a specific size. This terminal stuff was invented in a time where these sizes where hardcoded to be the physical size of the screen.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号