This project of mine implements a browser-based "compute environment" with a virtual file system and terminal emulator (web shell). This setup acts as a virtual machine that emulates a Unix-like operating system and runs fully in the browser.
You can view and edit the files and create directories using the file explorer-like UI and run commands in the terminal. I built both the file explorer and terminal UI myself, with the goal to make them mobile- and touch-friendly (unlike e.g. xterm.js).
The terminal supports multiple tabs which lets you run multiple commands simultaneously. The commands are executed fully client-side and each in a separate web worker, to prevent blocking the UI thread. All tabs share the same file system which itself runs in a separate web worker.
Since the WASM builds often use synchronous APIs to interact with the file system, I implemented the inter-worker communication using SharedArrayBuffer and Atomics.
My goal is to make this project a powerful in-browser VM that can be used to run many command-line applications with no installation required.
Go ahead and try it out below!
Today, you can already run the following commands in the terminal:
|change directory (built-in command)|