Open segeljakt opened 4 years ago
(Missclick)
Thanks for reaching out! I think there are a couple of interesting directions that could be taken in that space:
Terminal
impl that targets xterm-js so that apps that target termwiz can render to xterm-jswezterm
frontend that can target the browser, which might be something of an alternative to xterm-js-rs
I'm open to seeing something happen in either or both areas, but I personally lack the time to own that effort or to really dig in and become an expert with web assembly in order to maintain it. I will happily discuss design considerations and review PRs in this area if you (or someone else!) has the bandwidth to own and drive that work for a while to get it in a good place. I will be looking to make sure that PRs in that area have sufficient automated test coverage that they don't regress because I'm concerned about supporting a feature set in an unfamiliar area!
Thank you for the response, I am not so good at frontend development but I think I could help out with the first option. From what I recall, xterm-js
has most of what the Terminal
trait requires, but I need to check how the raw
and cooked
modes are handled.
Compiling to WebAssembly is in my experience not too tricky as long as the program does not depend on OS-specific things like IO and paths. By conditionally compiling to Windows and Unix already, WebAssembly support is hopefully as easy as adding another target.
I have published a crate named
xterm-js-rs
which leverages bindings to thexterm-js
Javascript library. With it, you can implement web-based terminals running at the client-side in WebAssembly.You can see an example of it in action here: https://segeljakt.github.io/xterm-js-rs/
The source code for the example can be viewed here also: https://github.com/segeljakt/xterm-js-rs/blob/master/example/src/lib.rs
Would you be interested in adding a backend for web-based terminals?