dvtm

dvtm brings the concept of tiling window management, popularized by X11-window managers like dwm to the console. As a console window manager it tries to make it easy to work with multiple console based programs like vim, mutt, cmus or irssi.

News

Download

dvtm is packaged by various distributions, see the links below.

Development

You can always fetch the current codebase from the git repository.

git clone git://repo.or.cz/dvtm.git

If you have comments, suggestions, ideas, a bug report, a patch or something else related to dvtm then write to the dwm maling list (the list members don't mind) or contact me directly mat[at]brain-dump.org.

Installation

In order to use dvtm you will need a curses library, for example libncurses.

Download the latest version of dvtm and extract it. Edit config.mk to match your local setup (dvtm is installed into the /usr/local namespace by default). Customize config.h as you see fit, see the configuration section for further information.

If you are on a system with utf8 locales (if unsure check $LANG and the output of locale) you probably want dvtm to be linked against libncursesw so type make unicode otherwise plain make should suffice.

$EDITOR config.mk
$EDITOR config.h
make
# or on a utf8 aware system 
# make unicode
make install

You should now be able to start dvtm, redirect stderr to a file or /dev/null (just in case something goes wrong you will see it there).

./dvtm 2> log

Configuration

The configuration of dvtm is done by creating a custom config.h and (re)compiling the source code. See the default config.h as an example adapting it to your preference should be straightforward. You basically define a set of layouts and keys which dvtm will use. There are some pre defined macros to ease configuration.

Command line options

dvtm only contains 3 simple command line options.

#!/bin/sh

FIFO="/tmp/dvtm-status.$$"

[ -e "$FIFO" ] || mkfifo "$FIFO"
chmod 600 $FIFO

while true; do
	date +%H:%M
	sleep 60
done > $FIFO &

STATUS_PID=$!
./dvtm -s $FIFO 2> /dev/null
kill $STATUS_PID
rm $FIFO

FAQ

Below are some explanations to topics which were asked quite frequently.

Detach / reattach functionality

If you just want to be able to detach and later reattach dvtm sessions i would suggest to use dtach.

dtach -c /tmp/dvtm-session -r winch dvtm

If you additionaly want something similiar to workspaces try running multiple dvtm sessions in different screen windows.

Some characters are displayed like garbage

Make sure you compile dvtm with make unicode if you are in an unicode environment (check whether your locale contains UTF-8).

Copy / Paste doesn't work in X

If you have mouse support enabled, which is the case with the default settings, you need to hold down shift while selecting and inserting text. In case you don't like this behaviour remove CONFIG_MOUSE from the CFLAGS in config.mk you will however no longer be able to perform other mouse actions like selecting windows etc.

The numeric keypad doesn't work with Putty

Disable application keypad mode in the Putty configuration under Terminal => Features => Disable application keypad mode.

Unicode characters don't work within Putty

You have to tell Putty in which character encoding the received data is. Set the dropdown box under Window => Translation to UTF-8. In order to get proper line drawing characters you proabably also want to set the TERM environment variable to putty or putty-256color. If that still doesn't do the trick then try running dvtm with the following ncurses related environment variable set NCURSES_NO_UTF8_ACS=1.

Problems with some readline keybindings

Pressing CTRL+j j/k to view the command line history doesn't work, it behaves like ENTER. This is the case for all curses applications because curses uses the keybindings as defined by terminfo and CTRL+j is normally configured to match the ENTER behaviour. This can be verified with infocmp.

infocmp $TERM | grep '\^J'
   cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C,
   il=\E[%p1%dL, il1=\E[L, ind=^J, is1=\E[?47l\E=\E[?1l,

As you can see ^J is mapped to cud1 and ind which acorrding to terminfo(5) means line down respectively scroll text up. This means dvtm will never see CTRL+j but instead allways receive KEY_ENTER.

Layouts

dvtm currently includes 4 standard layouts, below is a schema of each one. These layouts are mostly adapted from dwm (the grid layout is enhanced to always use the whole screen). Porting a layout from dwm should be relatively easy.


    +----------+----------+ +----------+----------+
    |          |          | |          |          | 
    |          |          | |          |          |
    |          |          | |          |          |
    |          |          | |          +----------+
    |          |          | |          |          |
    |          |          | |          |          |
    |          |          | |          |          |
    +---------------------+ +---------------------+
          2 windows               3 windows

    +----------+----------+ +----------+----------+
    |          |          | |          |          | 
    |          |          | |          +----------+
    |          +----------+ |          |          |
    |          |          | |          +----------+
    |          +----------+ |          |          |
    |          |          | |          +----------+
    |          |          | |          |          |
    +---------------------+ +---------------------+
          4 windows               5 windows
			

    +----------+----------+ +----------+----------+
    |                     | |                     | 
    |                     | |                     |
    |                     | |                     |
    +---------------------+ +---------------------+
    |                     | |          |          |
    |                     | |          |          |
    |                     | |          |          |
    +---------------------+ +---------------------+
          2 windows               3 windows

    +---------------------+ +---------------------+
    |                     | |                     | 
    |                     | |                     |
    |                     | |                     |
    +------+-------+------+ +----+-----+-----+----+
    |      |       |      | |    |     |     |    |
    |      |       |      | |    |     |     |    |
    |      |       |      | |    |     |     |    |
    +------+-------+------+ +----+-----+-----+----+
          4 windows               5 windows
			

    +----------+----------+ +----------+----------+
    |          |          | |          |          | 
    |          |          | |          |          |
    |          |          | |          |          |
    |          |          | +----------+----------+
    |          |          | |                     |
    |          |          | |                     |
    |          |          | |                     |
    +---------------------+ +---------------------+
          2 windows               3 windows

    +----------+----------+ +------+-------+------+
    |          |          | |      |       |      |
    |          |          | |      |       |      |
    |          |          | |      |       |      |
    +----------+----------+ +------+---+---+------+
    |          |          | |          |          |
    |          |          | |          |          |
    |          |          | |          |          |
    +---------------------+ +---------------------+
          4 windows               5 windows
		    

The fullscreen layout displays only the currently selected window.

Screenshots

Below are a few screenshots which show dvtm in action.

Links

Below are some links which are in one way or another related to dvtm.

License

dvtm reuses some code of dwm and is released under the same MIT/X11 license. madtty which is used for the terminal emulation is licensed under the GNU LGPL.