-
Notifications
You must be signed in to change notification settings - Fork 178
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
Rustyline in the web #377
Comments
I have created these bindings for |
I think more than coupling rustyline to any web-specific interface... it'd be better if rustyline could be configured to read from and write to arbitrary streams, instead of hardcoding the use of stdin and stdout (which don't seem to be available in the WASM target). That way, (Actually came to this bug tracker today to file this specific feature request and found this existing bug, so thought I'd comment.) |
@jmmv sounds excellent to me 👍 I can fix it on my end if Rustyline intends to use it |
That's just a drive-by comment though ;) I'm not involved with this project. But I was considering giving a try to what I proposed because... well, I need it for a project I'm working on, and your |
Alright, I created the bindings for the purpose of a programming language I have been working on https://github.com/segeljakt/arc-script |
I'm also interested! @segeljakt did you eventually fork rustyline or went with another solution? |
@dlight I did not have time to work on it but it would be really cool to see it running. Eventually I will get to it. Otherwise, if someone wants to give it a shot I could help out on the side. |
I have a project (https://github.com/jmmv/endbasic/) where I used rustyline for the command line interface. In porting this to the web, I had to scrape the rustyline dependency because it wouldn't work with it. Last week, I spent some time trying to unify the CLI (still using rustyline) and the web UI, and the way I had to go about it was to create an abstraction layer to read keys from a console. The key part is making such interface |
There are ways to shim stdout for the web, like wasm-glue and this nightly-only feature. I'm not finding how to shim stdin right now, at least not for wasm32-unknown-unknown, but it should be possible - after all, many C programs with stdin were ported to the web, and whatever works for C should work for Rust with a little Perhaps a workaround is to use the wasm32-unknown-emscripten backend and use usual the emscripten ways to configure stdin. |
This is probably a long shot, but have you considered integrating
rustyline
with web-based terminals? For example, https://github.com/xtermjs/xterm.js/.The text was updated successfully, but these errors were encountered: