David Herman
03/16/2023, 8:27 PMplatform.posix.TIOCGWINSZ
showing up as undefined on macos. But as far as I can tell, that constant should be supported on the mac platform?David Herman
03/16/2023, 8:27 PMDavid Herman
03/16/2023, 8:28 PMval numColumns = memScoped {
val winsize = alloc<winsize>()
ioctl(STDOUT_FILENO, TIOCGWINSZ, winsize.ptr)
winsize.ws_col.toInt()
}
winsize
and ioctl
are found correctly.David Herman
03/16/2023, 8:29 PMposixMain
, not macosMain
or anything more specific, in case that's what's causing the problem?David Herman
03/16/2023, 8:30 PMDavid Herman
03/16/2023, 10:16 PMTIOCGWINSZ
constant provided by Linux is different from TIOCGWINSZ
provided by Mac, so that the intersection stdlib provided at the posixMain
parent layer excludes it.
I am using expect / actual machinery to work around the issue: https://github.com/varabyte/kotter/commit/02174741b1876d16a8640e4067b8cea42c141d62
(☝️ Basically, both macosMain
and linuxMain
provide exactly the same actual val TIOCGWINSZ: ULong = platform.posix.TIOCGWINSZ
code, but K/N can resolve the constant correctly at those lower levels)