Closed
Description
Hey, I was trying to compile libreadline to JavaScript, but to no avail. Upon successful compilation and inclusion, the program using libreadline fails to load due to an unimplemented syscall -- syscall 0x00005414
, usually implemented in /usr/include/asm-generic/termios.h
. Screenshot relevant and attached.
If this is my fault compiling readline incorrectly, please point me in the right direction or close this ticket.
Activity
kripken commentedon Apr 20, 2018
Doing a grep for that ioctl code in our system code (under
system/
), looks like it'sTIOCSWINSZ
, and reading some online docs for that, it seems to be setting the window size?We don't have much terminal window support right now, but in principle we could add it. The first question is what does "window" mean here - our default html contains a textarea, which I suppose would be the natural thing to refer it to? Then the question is whether HTML textareas support is enough for this purpose (or would we need a canvas?). Once that's figured out, the main implementation for this would go in
src/library_syscall.js
, see for example #6466 for a recent PR implementing another syscall thing.[-]ioctl() syscall 0x00005414 not implemented[/-][+]ioctl() terminal window syscalls not implemented[/+]DataKinds commentedon Apr 21, 2018
I'll try and get on this once I get a minute tonight. Is there anything special I have to be aware of when using
emsdk
with a custom version of emscripten?DataKinds commentedon Apr 21, 2018
Not 100% sure how GitHub works with PRs and all that so I'm going to link the PR here as well. Here's a fix for this issue by adding
TIOCSWINSZ
(which is defined insystem/lib/libc/musl/arch/emscripten/bits/ioctl.h
) tostruct_info
and handling the terminal window corner case inside ofioctl()
. #6468stale commentedon Sep 19, 2019
This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 7 days. Feel free to re-open at any time if this issue is still relevant.
xloem commentedon Mar 19, 2020
I'm working on terminal support for things like this a little at https://github.com/xloem/emterm.git