Run clang-format over the Mosh source tree. This is a large change and
has been factored into its own commit for auditability. Reproduce it
with
find . -name \*.cc -or -name \*.h | while read f; do clang-format -i --style=file $f; done
Previously, mosh used extensive -I flags and all of the mosh-local
makes it really hard to tell what the proper dependency graph is, so
instead remove the -I arguments in favvor of $(top_srcdir) and qualify
the paths wherever they are used.
This change adds autoconf/automake support for building all of mosh
with gcov, and generates an lcov html report. This allows seeing which
parts ofthe source tree have good test coverage, and which can be
shored up. Eventually, it would be good to hook this up to Github
Actions to be generated automatically.
This allows more Resize instructions to be elided. It also keeps the
server from sending empty updates when the screen has been written but
not changed.
Add another round-trip verification. For both original and generated
state, generate a diff from an initial, empty state. Verify that
these two diffs are the same.
The problem was that the round-trip verification code copies the
current state, which may contain intermediate Parser state for
multibyte characters and ANSI escape sequences. It then applies diffs
to that copy, which may appear as badly formed input.
Also removes some dead, never-used code.
* Fix inefficient STL use around Parser::UTF8Parser.
* Reduce typeid() usage, change some of it to a virtual method
* Do multiple-line scrolls as a single move
If subtract is called on itself, prefix and this is the same and the
iterator is invalid after modifying the underlaying object.
Instead just clear everyting.
Closes#354. Closes#355.
clang was spewing warnings about the unrecognized -fno-default-inline. (Oddly,
it warns only with -c, not when compiling directly to an executable.) For
completeness we also check -pipe, even though clang is OK with that one.
It should be fine to omit either flag. gcc -fno-default-inline drops the
implicit 'inline' annotation on functions defined inside a class scope, but
'inline' is only a hint anyway. -fno-default-inline does not change linkage.
-pipe is merely a compile speed optimization.
This turns off -Werror by default except in the Debian package.
-Werror is inherently unportable and breaks things on OS X. While it
can cause problems in Debian too, this is at least a little better.
It also turns off -pedantic in src/protobufs, because apparently
protoc output doesn’t compile with -pedantic on all platforms.
Signed-off-by: Anders Kaseorg <andersk@mit.edu>