-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MacOSX ARM terminal size always is the default #238
Comments
Yes, that's supposed to work. Maybe the ioct is wrong on ARM? I don't have a mac to test on, but if you have a C compiler, can you try this C code and see what it prints? #include <stdio.h>
#include <sys/ioctl.h>
int main() {
struct winsize sz;
printf("TIOCGWINSZ: 0x%lx\n", TIOCGWINSZ);
printf("TIOCSWINSZ: 0x%lx\n", TIOCSWINSZ);
ioctl(0, TIOCGWINSZ, &sz);
printf("width: %i height: %i\n", sz.ws_col, sz.ws_row);
return 0;
} I'm a little surprised the the JNA module is failing too, since that one shells out to |
I must have bonked the JNA test prior, but FFM definitely does not work. JNA working: (Iterm, Terminal, not Intellij)
while FFM continues to be wrong:
Output of C program in Iterm 2: (same terminal as above FFM test)
Terminal:
Intellij terminal:
Warp:
same terminal back to back:
|
Ok, I thought it was the gradle generated build script, but it's not. Running the resulting class by hand with the classpath has the same affect of being the default size. I removed all other command line arguments to the JVM. I don't think another dependency could affect this since you are calling directly via FFM. |
Created a test project with only Mordant, so it is not the dependencies. |
Thanks for the investigation! So the ioctl you shared is indeed different than the one being used in the FFM module; I updated the constant in #239, so once if you can, give that a try and if it still doesn't work we can reopen this issue. |
crashes. |
trying this in C:
results in:
seems to match, no? |
Also |
Ok, found the problem. whew! This function
needs to add effectively:
but probably better to pass it in for some other way. |
and for MAC it should always be |
result:
|
@ajalt you can re-open? |
tested, works fine here. |
Mordant 3.0.0
In default Terminal, ITerm2, and Intellij terminal on my ARM Mac, I always end up with terminal size of 79x24.
This program shows a bit more:
terminal size is 79x24 default, and the FFM interface returns
null
.In FFM
getTerminalSize
the code returns 0,0 forval size = MacosCLibrary.winsize(arena)
and theioctl
check is false.The JNA version also returns
null
forgetTerminalSize()
This is intended to work, no?
The text was updated successfully, but these errors were encountered: