A4 is a terminal multiplexer / terminal manager. A4 is for use by people who perform system support, software development, and other work in terminals. It has features that make it ideal for people who login to several differnt machines, possibly using several different accounts. A4 will make you more productive at your job.

It is a partial rewrite of dvtm, which in turn is a text-based implementation of dwm. It is written in C and is currently about 3000 lines of code.

Distinguishing Features

The Layouts

        zoom_left         zoom_right          zoom_top         zoom_bottom
    ┌───────┬───────┐  ┌───────┬───────┐  ┌───────────────┐  ┌────┬────┬─────┐
    │ a4    │       │  │       │ a4    │  │ a4            │  │    │    │     │
    │       ├───────┤  ├───────┤       │  │               │  │    │    │     │
    │       │       │  │       │       │  ├────┬────┬─────┤  ├────┴────┴─────┤
    │       ├───────┤  ├───────┤       │  │    │    │     │  │ a4            │
    │       │       │  │       │       │  │    │    │     │  │               │
    └───────┴───────┘  └───────┴───────┘  └────┴────┴─────┘  └───────────────┘
    ┌───────────────┐  ┌───────┬───────┐  ┌───────────────┐  ┌────┬────┬─────┐
    │ a4            │  │ a4    │       │  │ a4            │  │ a4 │    │     │
    │               │  │       │       │  ├───────────────┤  │    │    │     │
    │               │  ├───────┼───────┤  │               │  │    │    │     │
    │               │  │       │       │  ├───────────────┤  │    │    │     │
    │               │  │       │       │  │               │  │    │    │     │
    └───────────────┘  └───────┴───────┘  └───────────────┘  └────┴────┴─────┘
       fullscreen            grid               rows             columns

All window layouts are dynamic; a4 is a terminal window manager as well as a terminal window multiplexer. There are four tiling and four non-tiling layouts. Each tiling layout divides the screen into two sections, one for the zoomed terminal windows and the other for the stack of non-zoomed terminal windows. The default is to have just one terminal window in the zoomed area (zoomnum) and for that area to take up 50% of the screen (zoomsize). These defaults can be changed in the configuration file, and can also be changed on the fly while the program is running. The name of each tiling layout indicates the location of the zoomed terminal window area: zoom_left, zoom_right, zoom_top, and zoom_bottom.

The fullscreen layout does just what it says and takes the full screen to display a single terminal window at a time. The grid layout displays all terminal windows in a grid of rows and columns, while rows layout displays them all as full-width rows, and columns layout displays them all as full-height columns.

    zoom_left layout with zoomnum = 2, zoomsize = 60%
    ┌─────────┬─────┐
    │ a4      │     │
    │         ├─────┤
    ├─────────┤     │
    │         ├─────┤
    │         │     │
    └─────────┴─────┘

Some Technical Details

While a4 is similar to dvtm, it has some important differences. A4 replaces ncurses with libtickit for text drawing and keyboard and mouse input processing. Instead of reimplementing terminal processing code, a4 uses the libvterm library of functions.

Instead of requiring compile-time configuration in a config.h file, a4 uses the inih package to implement run-time configuration file processing.

Todo and known bugs

Related Projects and Resources

A size illustration2

https://waxandwane.org