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>
Run tests with ‘make check’

The configure --enable-tests flag is no longer needed because
check_PROGRAMS are not built until you run ‘make check’.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Add OCB test program to ‘make check’

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

Closes #392.
Base64::Base64: Fix exception safety

Found by cppcheck.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
PRNG: Read input using C++

In the old code, cppcheck complained about throwing in the destructor,
but like, seriously?

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
src/examples/{encrypt,decrypt}: Read input using C++

cppcheck found an exception safety bug in the old code, but like,
really now.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Connection::recv: Rethrow the original exception instead of a copy

Found by cppcheck.

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

Found by cppcheck.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
human_readable_duration, Terminal::appendstring: Pass strings by reference

Found by cppcheck.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Socket::operator=: Return non-const reference

Found by cppcheck.

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