Add error message when child exits whit error

Master proccess was not showing any error message when the child
died with an error, and it was very confusing for the user (for
example with incorrect -e command).
Unset mode when clearing regions

tclearregion() was clearing regions using spaces and the current
attributes of the terminal. It was correct with all the modes excepct
underline, because they didn't affect the space character, but in
the case of underline it was a problem. A easy way of seeing this
problem is writing this in the last line of the terminal:

	tput smul ; echo first; tput rmul; echo second; echo third

Fist was underlined, and second and third were not underlined, but
the spaces at the right of second was underlined becuause in the
previous scrool underline mode was set.
Remove ul capability

This capability indicates that underscore '_' overstrike current
letter under the cursor. It means that you can generate a
underline 'b' using 'b^H_', because it writes a 'b' then backward
one characther and then overstrike '_'. St has not such behaviour,
so it is an error to have this capability.
tresize return value is not used

Signed-off-by: Roberto E. Vargas Caballero <k0ga@shike2.com>
Don't set dirty all lines because tswapcreen do it

Signed-off-by: Roberto E. Vargas Caballero <k0ga@shike2.com>
Fix portability problem in techo()

ISCONTROL chechks if a value is between 0 and 0x1f or
between 0x80 and 0x9f. Char signess depends of architecture
and compiler, so in some environment the second case is
always false (and wrong), Techo() calls ISCONTROL with a
char variable, whose type cannot be changed because tpuc()
expects a pointer to char, so the solution is to insert a
cast in the call to ISCONTROL.
Convert VT102ID to a config variable

VT102ID is the sequence that the terminal returns when it is inquired
to identify itself. This value should be configurable in the same
way that another st parameters.
Fix man page and usage()

Man page was repeating -f option, the second time instead of -i,
and this option was lost in usage() message. This patch also indent
the output of usage().
Simplify README

The term 'virtual terminal emulator' was broken. There is nothing
virtual about it, it's a terminal emulator.

Signed-off-by: Alexander Huemer <alexander.huemer@xx.vu>
Signed-off-by: Roberto E. Vargas Caballero <k0ga@shike2.com>
simplify loop in tresize

Signed-off-by: Roberto E. Vargas Caballero <k0ga@shike2.com>
reset the alt screen in treset

Signed-off-by: Roberto E. Vargas Caballero <k0ga@shike2.com>
Make useful DEL in application mode

DEL key has to generate the sequence ^[P in application mode,
because such sequence means delete current character. It implies
that the character sent in keypad mode must be ^? (DEL character).
Fix definition of CONTROLC0

DEL character is not thecnically talking a C0 control character,
although it has some common properties with them, so it is useful
for us consider it as C0. Before this patch DEL (\177), was not
ignored as it ought to be.
Improve execsh() and don't allow anonymous shells

This patch improves the shell selection on execsh and forbid
shell with users don't registered in the passwd file.
Add eschandle()

We already have a csihandle() function, where is located code about
CSI sequences, so it is logical do the same with ESC sequences.
This change helps to simplify tcontrol(), which has a complex flow
and should be rewritten.
Improve readability of enum members

The 'left shift from one' notation of power of two integers is more
expressive than the result.

Signed-off-by: Alexander Huemer <alexander.huemer@xx.vu>
Signed-off-by: Roberto E. Vargas Caballero <k0ga@shike2.com>
Move calls to selsnap into selnormalize

This simplifies getbuttoninfo() and bpress(), and fixes a bug which made word
snapping behave incorrectly when a delimiter was at the beginning or end of
line.

Signed-off-by: Roberto E. Vargas Caballero <k0ga@shike2.com>
Change the behavior of word snapping on delimiters

This makes any sequence of identical delimiters be considered a single
word in word-snapping mode. This seems more coherent for this mode and
is similar to what xterm does.

Signed-off-by: Roberto E. Vargas Caballero <k0ga@shike2.com>
Removing wrapping newlines from selection

When getting selected text, lines that were wrapped because of length
ought not include the wrapping newline in the selection.

This comes up, for example, when copying a bash command that is long
enough to wrap from the console and pasting it back into the console.
The extra newline breaks it.

Similiarly, changes behavior when trimming whitespace from the end of a
physical line to only do so if the line does not wrap. Otherwise we are
trimming whitespace from the middle of a logical line, which may change
its meaning.

Signed-off-by: Roberto E. Vargas Caballero <k0ga@shike2.com>
Remove indentation level in xdrawcursor