Features and screenshots

The goal of DomTerm is to be both a great terminal emulator as well as great environment for REPLs.

This OpenSource.org article provides an overview of DomTerm’s functionality. (It should be merged into the following.)

Full-featured terminal emulator

DomTerm window running mc (Midnight Commander)

DomTerm includes the functionality what you’d expect from modern terminal-emulator.

Here you see the mc (Midnight Commander) file browser running in the stand-alone DomTerm application. Emacs (shown later) and GNU readline also work well.

images/dt-graphemes

Handles Unicode. Good CJK (Chinese, Japanese, Korean) support: double-width characters (including Emoiji) really are two columns wide. Handles extended Grapheme Clusters, including Emoji composition and modifiers, depending on browser support.

Rich output and images

images/domterm-polygon-1

A back-end can “print” images, graphics, and rich text. Here you can see evaluating and “printing” Paintable objects, which are graphical objects such as filled polygons. from the Kawa REPL.

The front page screenshot shows “printing” HTML for images and rich text. (The expressions starting with #< are XML literals, which evaluate to Element objects. “Printing” an Element inserts its HTML representation in the DomTerm output.)

The image later (with the yellow circle) shows printing SVG.

Sixel graphics

images/dt-sixel

You can directly print Sixel images, which is an encoding that some DEC VT terminals supported..

Help and other documentation

images/dt-help1

Displaying inline HTML is very useful for “help” output and other documentation, such as output from pandoc and man pages.

The domterm hcat command is useful for printing formatted html. The domterm help topic command essentially does that.

Python language

images/pyplot

If you use the Python language, check out these Python tips with more screenshots.

Gnuplot

images/dt-gnuplot1

The GnuPlot graphing utility (version 5.1+) supports DomTerm as an output device.

Rich interaction

Pretty-printing

images/dt-pretty1 If you click on the image to right, you get a dynamic saved page: If you resize the screen, the line-breaks in the output are adjusted to pretty-print the data structures to fit the available width. You can also show or hide output by clicking on the triangles.

Smart line-wrapping: Remembers which lines were too wide (and thus were wrapped). The default style add markers to show when wrapping occurred, as seen in the nearby screenshot. Window size re-size will automatically re-do line-breaking. Copying the selection as text will only include hard newlines. Reports window resize to application. Dynamic pretty-printing (Common Lisp style) uses special commands to group logical blocks, and attempts to keep the text of a block on a single line with automatic re-flow on window re-size.

Show/Hide buttons

“Print” hide/show buttons, using certain escape sequences enables text folding. The nearby screenshot shows the output of ls -l being hidden.

Turn URLs and mail adresses in output into links. Filename with line number (as in errors messages) are turned into links for text editors. (You have to hover over them to see them.)

You can customize how links are handled.

Update previous output

An application can print some HTML in an area of the output, and attach a key string to it. Later, that area can be updated (replaced), just by specifing the key, without cursor navigation.

Choose your front-end

images/emacs-in-firefox-1 images/dt-atom1

Most of DomTerm is written in JavaScript and runs in a browser engine. This can be a desktop web browser, such as Chrome or Firefox, or it can be an embedded browser. Using a general web browser works fine, but the user experience isn’t quite as nice, and the security model gets in the way, so using an embedded browser is recommended.

The following are currently supported:

Currently, both the Electron and Qt frontends are quite nice and recommended.

Panes and tabs

A DomTerm window can be sub-divided into panes, each of which can have multiple tabs. You can create new panes with a domterm sub-command (like domterm --below new), a menu button, or a keyboard shortcut (like Ctrl+Shift+A Ctrl+Down).

If using atom-domterm the above commands create a new Atom pane instead.

Shell/REPL integration

images/dt-fish1

If you use a shell or other interactive REPL program with a settable prompt string, inserting special escape sequences in the prompt enables some useful features.

See this article for more discussion and screenshots.

Optional input editing. In character mode, each character is sent to the application, like a traditional terminal. In line mode, the browser does the editing, and sends the input line to the back-end when Enter is typed. A history of previous lines is available, accessible with the Up/Down arrow keys. Automatic mode switches between character mode and line mode depending on whether the back-end is in “canonical mode”.

Miscelleanous

Easily configured as a drop-down” (“Quake-style”) terminal.

User preferences are controlled a CSS stylesheet, which can be changed by an application.

Uses a byte-protocol to communicate with the back-end, so can run in a browser (using web sockets); be embedded in an application; or run as a standard terminal emulator application.

images/domterm-sh-svg

Maintains a clean DOM structure, and thus clean HTML export. Text selections generally give you what you expect.

Move cursor using mouse, even for mouse-unaware programs. Mouse clicks are translated to arrow-key characters.

Optional automatic pagination.

Predictive echo (similar to mosh), which is useful for slow connections.

Nicer password fields.