Convert all tabs to 4 whitespaces

Tabs where erronusly introduced in 993abf57
Reintroduce pkg-config based searching for ncurses

Fixes issue rased in #358
Conditional curses detection

Make the whole extra curses/ncurses/ncursesw only check if we didn't
find tinfo the "old" way.
Close some leftover fd's
Have ssh close stdin and forceallocate pty

Somehow we still need to have a real pty on stdin to ssh so
window-size-thingie works.
Replace IO::Pty with pipe

Now when we don't need some fancy pty for sending on window-size and
reading proxy-output from, just use a regular pipe to drop dependency on
IO::Pty

[closes #378]
Remove dependency on IO::Pty
fix a perror() message in mosh-server

A perror() message flanking an open() call was reading "dup2" where it
should read "open".

[closes #377]
Since terminfo is guarded by include guard, need to define HAVE_CURSES_H
Treat empty OSC number as zero.

For interoperability's sake, accept OSCs of the form ESC];title^G
treating them the same as ESC]0;title^G

Signed-off-by: sqweek <sqweek@gmail.com>
Don't touch window title before an OSC is received.

Fixes the "window title being clobbered" issue raised in issue 137.

Signed-off-by: sqweek <sqweek@gmail.com>

Closes #380. Closes #137.
main: Don’t leak shell_name memory

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
get_SSH_IP: Don’t leak SSH_writable memory

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
serve: Remove dead store of bytes_read

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
main: Don’t leak desired_ip memory

Signed-off-by: Anders Kaseorg <andersk@mit.edu>

Closes #385.
Move Emulator::{open,close} to Display

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Display: Abstract terminfo capability functions

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Put the real terminal in alternate screen mode

Closes #2

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
scripts/mosh: Add --no-init option to disable alternate screen mode

Signed-off-by: Anders Kaseorg <andersk@mit.edu>

Closes #384. Closes #2.
tests: Default to quiet

Signed-off-by: Anders Kaseorg <andersk@mit.edu>