Downloading and building

Getting the DomTerm source code

The sources are in a GitHub repository. To download the sources do:

git clone


(Please help out with instructions for other platforms, especially Debian/Ubuntu, MacOS, *BSD, and Windows 10.)


On Fedora, you need to first:

sudo dnf install gcc make automake autoconf texinfo patch libwebsockets libwebsockets-devel json-c json-c-devel openssl-devel file-devel libcap-devel asciidoctor

If configuring --with-qtwebengine (recommended), also do:

sudo dnf install gcc-c++ qt5-qtbase-devel qt5-qtwebengine-devel qt5-qtwebchannel-devel

If configuring with --enable-compiled-in-resources (for xxd - only needed at build time):

sudo dnf install vim-common

For Java classes, do:

sudo dnf install java-1.8.0-openjdk-devel

(You can also use Oracle JDK, version 8 or 9.)

Building from source

The core part of DomTerm is the JavaScript code terminal.js, which defines the DomTerm class. You can use terminal.js in your own application. However, there is also some utility code, include standalone terminal emulator applications.

The best terminal emulator experience at this time is probably the combination of libwebsockets 2.2 with the Electron front-end.

Another good application is qtdomterm. It uses the C++-based Qt toolkit including QtWebEngine. Needed packages are included with Fedora 27. (Reports of attempt to build or use qtdomterm on other platforms would be welcome.)

Building the sample applications and libraries is a two-part process:

If building from the git respository, first do:


This runs the GNU autotools (aclocal, autoconf, and automake).

Then run the configure script:

./configure configure-options

where configure-options can be:


Build the C application ldomterm, which uses libwebsockets. If lws-build is specified, it should be the path to the build subdirectory of the libwebsockets compiled source tree. (The files lws-build/lib/libwebsockets.a and lws-build/include/libwebsockets.h should exist.)

Libwebsockets version 2.2 or newer is required, as older versions do not support flow control or paging.

This is the recommended “backend” and the default.


Build a WebSocket server, using Java WebSockets, which allows using any modern browser as a front-end. This server is no longer recommended or enabled by default.

This options adds the classes in java_websocket.jar to domterm.jar.


Generates help and man pages using AsciiDoctor. The default is to do so if asciidoctor is in the path.


Compile support for PTYs (pseudo-teletypes). This allows character mode: sending individual characters (rather than lines) from the front-end to the back-end. This is the default, except on Windows (which doesn’t support PTYs).


Use JavaFX to run standalone applications. The library-name does not need to be specified if using Java SE 8. It may be needed for OpenJDK or Java SE 7, in which case it is either a path to jfxrt.jar, or (for convenience if using Java SE 7) the JAVA_HOME.


Disable building anything that depends on Java.


Use Qt and QtWebEngine to build qtdomterm, an advanced front-end that supports multiple tabs, screen re-sizing, and other nice features.

For this you need the Qt development tools including QtWebEngine installed.

For Fedora, you also need:

sudo dnf install qt5-qtbase-devel  qt5-qtwebchannel-devel qt5-qtwebengine-devel

Use Google Closure Compiler to minimize the size of the JavaScript. (Current only the “simple optimizations” are done. Using the “advanced optimizations” would reduce the JavaScript file size further, but causes some not-yet-resolved problems.)


This feature causes the html, JavaScript and css files needed by DomTerm to be compiled into the executable. Otherwise, they are served from the compressed domterm.jar.


This is an experimental feature to preload a library to interpose some system functions. Most importantly it overrides tcgetattr so that DomTerm gets notified on term terminal mode changes.

Then just:


To test it, you can try either:




Either starts up a useable terminal emulator in a fresh window. The former starts up a bash shell, running in a PTY, with a libwebsockets server. It also starts a stripped-down browser window, using that for the input and output of the bash shell. The latter (obviously) runs qtdomterm.

The qtdomterm executable has no external dependencies (besides the Qt libraries), and you can copy to wherever you want it.