plasma-umass / browsix

Browsix is a Unix-like operating system for the browser.
Other
3.15k stars 181 forks source link

[Semi-WIP] Rewrite terminal based on xterm.js; redirecting stdin, using dash #65

Open ids1024 opened 5 years ago

ids1024 commented 5 years ago

https://github.com/plasma-umass/browsix/issues/16

This code works, but there are a couple awkward details.

browsix-xtermjs

Advantages over previous implementation

Disadvantages from previous implementation

Other notes

I made some awkward changes in gulpfile.js to copy the xterm.js library from npm, since it doesn't support bower. I think the bobby/modern-build branch is getting rid of bower? In which case, I (or someone else) can update this once that code is merged.

A fully functional terminal will require some form of pty implementation. There seems to be some initial code for that in the _term3 branch, but that appears to have never been finished.

The line editing code I implemented here isn't strictly correct. In an actual terminal, it seems the left and right arrow keys don't seem to do anything (other than print garbage). Shells like bash (but not dash, it seems) set the tty to non-canonical mode and implement that themselves. So this should probably be removed at some point, but is nice to have until the proper solution is available.

It seems best for me to share this code. I might look into ptys at some point.

tcoulter commented 5 years ago

Hey @ids1024, you seem like you know what you're doing. I'm just getting started with browsix. Do you think you can answer #69 for me?

As background, I'm looking exactly the browsix kernel with an xterm frontend, with one extra command line tool added. What you've built is perfect, and I'd ultimately love to figure out how to contribute.

Thanks in advance!