Commit Graph

558 Commits

Author SHA1 Message Date
John Hood 01749be642 Add test for behavior at column 80. 2015-10-14 23:28:21 -04:00
John Hood fb76563d33 Add multiline-scroll regression test 2015-10-14 23:28:21 -04:00
John Hood 14ae25ee2a Add test for unicode combining fallback assert, issue 667 2015-10-14 23:28:12 -04:00
John Hood 307b241f0d End to end test suite for Mosh sessions.
For original messy development history, see
https://github.com/cgull/mosh/tree/localhost
or
https://github.com/cgull/mosh/commit/e7feed48a4a271e2977f714f58acfa04cdaa5cca
2015-10-14 23:27:29 -04:00
John Hood 5959342ac7 mosh-client: return meaningful exitstatus on network setup/teardown or other failure 2015-10-03 03:43:18 -04:00
John Hood 7fb542c874 Change SSH_CONNECTION fallback to allow IPv6 2015-10-03 03:43:18 -04:00
Keith Winstein 7ec19a5bed terminal.cc: Remove overly-strong assertion on Unicode fallback
Fixes #667
2015-08-24 09:52:39 -07:00
John Hood 310b899a23 Support older getaddrinfo() missing AI_NUMERICSERV
Define this flag as 0 if unavailable.
This is needed for my OS X 10.5 system.

Signed-off-by: John Hood <cgull@glup.org>
2015-06-21 16:14:41 -04:00
Anders Kaseorg 10dd74c016 NotificationEngine: Fix -Weffc++ warning
Fixes warning: ‘Overlay::NotificationEngine::escape_key_string’ should
be initialized in the member initialization list.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2015-06-11 01:16:52 -04:00
John Hood d0db0968b1 Enable altivec on ppc64el
From http://launchpadlibrarian.net/171225681/mosh_1.2.4a-1build1_1.2.4a-1ubuntu1.diff.gz

Fixes #615.
2015-06-11 00:55:12 -04:00
John Hood fc80eaaecf Show the escape key properly when server unavailable.
Fixes #624.

Signed-off-by: John Hood <cgull@glup.org>
2015-06-11 00:49:06 -04:00
John Hood 8acee95c02 Resolve Coverity issue with Parser::Transition's ownership of Action *.
This commit is somewhat subtle; it informs Coverity that
Parser::Transition only holds an Action* temporarily, and should never
create/delete one.  I believe runtime checkers should also understand
this OK.

Signed-off-by: John Hood <cgull@glup.org>
2015-06-10 23:52:25 -04:00
John Hood 6f4a59e20f Resolve Coverity issues
Signed-off-by: John Hood <cgull@glup.org>
2015-06-10 23:51:42 -04:00
John Hood 026a3f0346 Resolve cppcheck issues.
Signed-off-by: John Hood <cgull@glup.org>
2015-06-10 23:50:56 -04:00
Keith Winstein 2e4e601468 mosh-server.cc: compare like types.
Fixes #626 (resize not working) introduced by 543f346a
2015-06-09 15:17:48 -07:00
John Hood dd58a398de ocb.cc: Mark local functions as static
This fixes the broken i386 build (aka generic code).
Untested on __ALTIVEC__ and __ARM_NEON__.

Signed-off-by: John Hood <cgull@glup.org>
2015-06-07 17:06:40 -04:00
Anders Kaseorg 90965f175f benchmark: Swap misleading width and height variables
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2015-06-06 13:53:05 -04:00
John Hood 543f346ac7 Fix various new compiler warnings.
terminalfunctions.cc: set_if_available() was undeclared.
Fix printf() wint_t/wchar_t warnings.
mosh-server.cc: Fix warning for side effects inside typeid().

Signed-off-by: John Hood <cgull@glup.org>
2015-06-06 13:12:32 -04:00
Anders Kaseorg b604a7d7c2 Respect HOME environment variable if set
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2015-06-05 22:53:31 -04:00
Anders Kaseorg 9019f62bf6 Respect SHELL environment variable if set
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2015-06-05 22:53:31 -04:00
John Hood 8a91e78349 termemu: respect $SHELL and exec argv if given
Signed-off-by: John Hood <cgull@glup.org>
2015-06-05 22:41:21 -04:00
John Hood 73fd6442c5 Add command line parameters for benchmark. 2015-06-05 22:41:21 -04:00
John Hood 67c22e5065 issue #507: fix/simplify parsing of colors 2015-06-05 00:12:01 -04:00
Anders Kaseorg cd2ae36f36 Mark local functions as static
This helps to catch unused functions like the former mosh_read_line,
allows the compiler to make better inlining decisions, and reduces the
binary size a bit.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2015-06-04 23:52:03 -04:00
Anders Kaseorg a52b095f50 mosh-server: Remove unused mosh_read_line function
This function is buggy.  feof(file) does not become true until after
we’ve tried to read past the last character; it should instead be
checking the getc return value for EOF (which is distinct from any
unsigned char).  Really it should just be replaced by istream
&std::getline(istream &is, string &str).  Fortunately, it’s unused so
we can just delete it.

Resolves a truncated stdio return value issue found by Coverity Scan
service.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2015-06-04 23:50:40 -04:00
Anders Kaseorg 0824e6549a base64: Make base64_encode declaration consistent with its definition
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2015-06-04 23:50:40 -04:00
Anders Kaseorg 8f6b226d8b Base64Key: Deduplicate PRNG code
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2015-06-04 23:50:40 -04:00
Anders Kaseorg c03bacd0c9 mosh-server: Catch exception for parsing nonintegral number of colors
Print a real error message instead of abnormally aborting.  Found by
Coverity Scan service.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2015-06-04 23:50:40 -04:00
Anders Kaseorg 23f0eedb8c Parser::UTF8Parser::input: Remove dead code for negative size_t
size_t is unsigned.  Fixes two issues found by the Coverity Scan
service, one about the dead code and one about the std::string
exception being uncaught by mosh-server.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2015-06-04 23:50:40 -04:00
Geoffrey Thomas a38b6f61d5 STMClient::process_network_input: Return void, instead of always true
This function has never in its history had a codepath returning false.
2015-06-04 23:47:32 -04:00
Geoffrey Thomas 4b75bcfdd9 terminaldisplay: Make a for loop's boundary better match its body
Both f and frame.last_frame must have the same number of rows here, but
since we're iterating over frame.last_frame's rows, make that more
explicit.
2015-06-04 23:47:32 -04:00
Geoffrey Thomas b5ac92491c Throw std::exception subclasses instead of std::strings
Now everything we throw or catch ourselves is a subclass of
std::exception.
2015-06-04 23:47:32 -04:00
Geoffrey Thomas aeffb71cfc Style cleanup: "foo &x", not "foo& x" 2015-06-04 23:47:32 -04:00
Geoffrey Thomas 9e9919c941 UTF8Parser::input: size_t is unsigned, so it can't be negative 2015-06-04 23:47:31 -04:00
Geoffrey Thomas 5721b392ab Make all exception classes inherit from std::exception
This refactors out a very common pattern of formatting "%s: %s" with
e.function.c_str() and strerror( e.the_errno ) into just the what()
method of NetworkException. It's also a prerequisite for making cleaner
public API for any exceptions we throw, and allows us to more easily
get exceptions passed back to us to handle.
2015-06-04 23:47:31 -04:00
Anders Kaseorg ebecb9bd3a Remove trailing commas from enums
I do sympathize with the motivation for these trailing commas, but
they cause silly build failures with --enable-compile-warnings=error
(which is used at least by the Debian/Ubuntu package).

  CXX      parseraction.o
In file included from terminal.h:42:0,
                 from parseraction.cc:37:
terminalframebuffer.h:200:39: error: comma at end of enumerator list [-Werror=pedantic]
       MOUSE_REPORTING_ANY_EVENT = 1003,
                                       ^
terminalframebuffer.h:210:34: error: comma at end of enumerator list [-Werror=pedantic]
       MOUSE_ENCODING_URXVT = 1015,
                                  ^
cc1plus: all warnings being treated as errors
Makefile:354: recipe for target 'parseraction.o' failed

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2015-06-04 08:43:48 -04:00
John Hood 8af7473cc4 Reset XTerm mouse modes on suspend/exit. 2015-05-31 22:50:17 -04:00
Louis Kruger c4236c6762 Fix xterm mouse support. 2015-05-31 18:18:30 -04:00
john hood f3073bbe5d Add git commit version info 2015-05-25 03:46:48 -04:00
Anton Lundin 3f38a10a2e Implement CTTY grabbing when TIOCSCTTY is missing
AIX is missing TIOCSCTTY, so we assign us a ctty via a open of the slave
device.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
2015-05-25 02:22:21 -04:00
John Hood 814a2ae55d clang/arm fixup for FreeBSD-CURRENT 2015-05-25 02:17:25 -04:00
john hood 060061aa21 Fix forkpty() for FreeBSD 10. 2015-05-25 02:17:24 -04:00
John Hood 30c09b4613 Comply with new C++11 token pasting rules 2015-05-25 02:17:24 -04:00
John Hood fdf8e427c3 OpenBSD: Use snprintf, not sprintf (PORT) 2015-05-25 02:17:24 -04:00
Anders Kaseorg e52d22b6da Timestamp: Prevent integer overflow on Darwin PPC 32-bit
A Darwin PPC 32-bit user observes huge values numer == 1000000000 and
denom == 18431683 returned from mach_timebase_info().  For these
values, mach_absolute_time() * numer overflows uint64_t every 1000.82
seconds, and 1000000 * denom always overflows uint32_t, with the
effect of making time run backwards at -11190660 times its usual
speed.

This bug was masked on Darwin x86 64-bit, where numer == denom == 1.

Fix it by doing the conversion with double arithmetic instead.

Closes #479.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2015-05-25 02:14:53 -04:00
cgull cfc29387ae Merge pull request #581 from tigeli/master
ocb: fix gcc4.8 compiling problem with __ARM_NEON__
2015-05-21 01:31:31 -04:00
cgull 78134f20d4 Merge pull request #514 from rpwoodbu/mosh-nacl
Conditionally rename main to mosh_main for building under NaCl.
2015-05-21 01:29:44 -04:00
Pasi Sjöholm ff84425885 ocb: fix gcc4.8 compiling problem with __ARM_NEON__
Fixes following problem when compiling mosh with gcc4.8 and
__ARM_NEON__ defined by using -121 instead of 135.

ocb.cc: In function 'block double_block(block)':
ocb.cc:263:56: error: narrowing conversion of '135' from
'int' to '__builtin_neon_qi' inside { } is ill-formed in
C++11 [-Werror=narrowing]

Signed-off-by: Pasi Sjöholm <pasi.sjoholm@jollamobile.com>
2015-02-03 11:21:46 +02:00
Keith Winstein c6cd99ba97 terminalfunctions.cc: Refactor out set_if_available() 2014-12-15 21:04:08 -08:00
Andrew Chin e115f05f0d Clear other mouse modes if 1000 or 1002 are set
I'm not sure if this is correct, but tmux does this!

Signed-off-by: Andrew Chin <achin@eminence32.net>
2014-12-15 20:55:28 -08:00