1
1
Fork 0
mirror of https://github.com/QB64Official/qb64.git synced 2024-05-12 12:00:14 +00:00

Merge pull request #44 from visionmercer/master

_Width and _Height for Linux and Mac console
This commit is contained in:
Cory Smith 2023-01-23 13:55:50 -08:00 committed by GitHub
commit 8f58d73a1b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -145,6 +145,7 @@ void setbits(uint32 bsize,uint8 *base,ptrszint i,int64 val){
#ifdef QB64_UNIX
#include <pthread.h>
#include <libgen.h> //required for dirname()
#include <sys/ioctl.h> //required for terminal width and height
#endif
#ifdef QB64_LINUX
@ -19084,6 +19085,13 @@ void sub_put2(int32 i,int64 offset,void *element,int32 passed){
return cl_bufinfo.srWindow.Right - cl_bufinfo.srWindow.Left + 1;
}
#endif
#ifdef QB64_UNIX
if ((read_page->console && !passed)||i==console_image){
struct winsize w;
ioctl(STDOUT_FILENO, TIOCGWINSZ, &w);
return w.ws_col;
}
#endif
if (passed){
if (i>=0){//validate i
@ -19114,6 +19122,13 @@ void sub_put2(int32 i,int64 offset,void *element,int32 passed){
return cl_bufinfo.dwMaximumWindowSize.Y;
}
#endif
#ifdef QB64_UNIX
if ((read_page->console && !passed)||i==console_image){
struct winsize w;
ioctl(STDOUT_FILENO, TIOCGWINSZ, &w);
return w.ws_row;
}
#endif
if (passed){
if (i>=0){//validate i