vt: set TERM=dvtm[-256color] in emulation

Add an dvtm.info terminfo file based on the one of rxvt,
and use it. This can be overriden at runtime with the
environment variable DVTM_TERM.

Signed-off-by: Marc Andre Tanner <mat@brain-dump.org>
vt: implement DECALN

Signed-off-by: Marc Andre Tanner <mat@brain-dump.org>
vt: remove unused constants

Signed-off-by: Marc Andre Tanner <mat@brain-dump.org>
Improve manual page formatting (thanks Josh)

Also document -c command line option.

Signed-off-by: Marc Andre Tanner <mat@brain-dump.org>
Add -M command line flag to disable mouse support upon startup

Signed-off-by: Marc Andre Tanner <mat@brain-dump.org>
Set dvtm's window title to the one of currently focused window

This has the effect that the dwm statusbar shows the title
of the currently focused window instead of the one of the shell
which started dvtm.

Signed-off-by: Marc Andre Tanner <mat@brain-dump.org>
vt: implement tab handling (HTS, CBT, TBC)

Signed-off-by: Marc Andre Tanner <mat@brain-dump.org>
vt: teach RI (reverse index) to respect scrolling region

Signed-off-by: Marc Andre Tanner <mat@brain-dump.org>
vt: DECSTBM should move the cursor to (1,1) of the scrolling region

Signed-off-by: Marc Andre Tanner <mat@brain-dump.org>
vt: always redraw whole line if dirty

Previously the end of lines with certain multibyte characters
would not get repainted which resulted in artifacts when selecting
text in copymode.

Signed-off-by: Marc Andre Tanner <mat@brain-dump.org>
vt: save/restore terminal mode upon DECSC/DECRC

TODO: determine what exactly needs to be saved on a per
      screen or per buffer basis and convert the bitfield
      mess to an unsigned int with flags.

Signed-off-by: Marc Andre Tanner <mat@brain-dump.org>
vt: implement scroll up/down (SU/SD)

Signed-off-by: Marc Andre Tanner <mat@brain-dump.org>
Make dvtm use the config.def.h convention.

Using this makes it easier possible to follow the dvtm git tree so no
conflicts in the config.h appear.

Signed-off-by: Marc Andre Tanner <mat@brain-dump.org>
Adjust some year numbers to 2013

Signed-off-by: Marc Andre Tanner <mat@brain-dump.org>
vt: fix segfault with COLORS=0

Signed-off-by: Marc Andre Tanner <mat@brain-dump.org>
Include dvtm.info in source tarball

Signed-off-by: Marc Andre Tanner <mat@brain-dump.org>
Use "safer" string functions inorder to please the OpenBSD linker

Signed-off-by: Marc Andre Tanner <mat@brain-dump.org>
vt: handle malloc(0) == NULL case

The C standard section 7.22.3 states that

 "If the size of the space requested is zero, the behavior is
  implementation-defined"

AIX chooses to return a NULL pointer which we wrongly treated
as an allocation failure.

Signed-off-by: Marc Andre Tanner <mat@brain-dump.org>
Handle allocation failures more gracefully

Signed-off-by: Marc Andre Tanner <mat@brain-dump.org>
Ship config.def.h not config.h in source tarball

Signed-off-by: Marc Andre Tanner <mat@brain-dump.org>