electron-nodepty: Using node for background server

The electron-nodepty directory contains an experimental version of DomTerm as a combined frontend and backend using Electron and node.js. This re-uses the JavaScript front-end code, but replaces the lws-term server part with Electron code.


Using node.js may make building and install domterm easier, as there are fewer dependencies, and they can mostly be handled by npm.

The code is more compact and easier to understand than the C code.

Potentially works on plain Windows (without WSL), optionally using the new Windows pty support.

Uses Electron ipc instead of WebSockets.

Can use hidden windows for detached process. Probably easier to implement remote proxy server, using a local hidden window to save state in case connection goes down.


The Electron instance is not daemonized. Could use nohub or daemon node module.

The domterm command (using lws-term) has lots of options and sub-commands. Re-implementing this would be some work. Probably use node net module; see this blog.

No support for auto-input-mode due to missing tcgetattr hook. No way to put process pid and ttyname in DOMTERM environment variable. (Maybe fix by hacking node-pty.)

No support for using other non-Electron front-ends, including using a web-browser. (Could be implemented, of course, by adding server for http and WebSockets.)