I'm trying to build a high-level TUI framework for JavaScript using Clay that ideally would not require any native compilation or FFI. Currently, I am compiling to wasm, and this allows it to trivially run on Node, Deno, and Bun without any headaches, but it means that I have to write my renderer by hand in JavaScript. I learned recently though that there is already a termbox2 renderer for Clay which would be amazing to be able to use. However, it does require compiling Termbox2 to WASM-WASI which I haven't had so much luck with.
The rub is that WASI has limited support for signals and no support for termios.h at all and so I'm wondering if there is a way forward.
Node, Deno and Bun do support signal handling as well as setting streams into raw mode from JavaScript, so would it be possible to allow somehow allowing for inverting control and delegating configuration of the terminal to the host environment?
Here is an example repository I have set up demonstrating the issue. https://github.com/cowboyd/termbox2-wasm-test
Any thoughts on if this would be possible?
I'm trying to build a high-level TUI framework for JavaScript using Clay that ideally would not require any native compilation or FFI. Currently, I am compiling to wasm, and this allows it to trivially run on Node, Deno, and Bun without any headaches, but it means that I have to write my renderer by hand in JavaScript. I learned recently though that there is already a termbox2 renderer for Clay which would be amazing to be able to use. However, it does require compiling Termbox2 to WASM-WASI which I haven't had so much luck with.
The rub is that WASI has limited support for signals and no support for
termios.hat all and so I'm wondering if there is a way forward.Node, Deno and Bun do support signal handling as well as setting streams into raw mode from JavaScript, so would it be possible to allow somehow allowing for inverting control and delegating configuration of the terminal to the host environment?
Here is an example repository I have set up demonstrating the issue. https://github.com/cowboyd/termbox2-wasm-test
Any thoughts on if this would be possible?