Commit Graph

206 Commits

Author SHA1 Message Date
Anders Kaseorg 553918d3f2 Connection: Support IPv6 addresses
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2013-08-17 09:02:44 -04:00
Anders Kaseorg c1f96b37a1 Connection: Store the port number as a string
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2013-08-17 08:26:30 -04:00
Anders Kaseorg 9187e307c6 mosh-client: Print exceptions after the client is shut down
Otherwise the printed exception may be immediately hidden when the
terminal exits alternate screen mode.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2013-08-17 08:26:30 -04:00
Keith Winstein 45bba44c83 mosh-server: Allow startup without PTY 2013-07-15 11:20:07 -04:00
Timo J. Rinne f960a8bcf5 mosh-client: Make terminal escape character configurable
Uses environment variable MOSH_ESCAPE_KEY. Defaults to current Ctrl-^
which is somewhat problematic for many non-US keyboards.

Signed-off-by: Timo J. Rinne <tri@iki.fi>

Closes #425. Closes #215.
2013-05-17 15:05:33 -04:00
Alexander Chernyakhovsky 172b1e5cef Cast time_elapsed to int before calling human_readable_duration
When attempting to build againt EPEL 5, it was noticed that
human_readable_duration expects an int, but time_elapsed is an
integer.  Explicitly static_cast<int>( time_elapsed ) to appease older
compilers.
2013-03-27 02:15:25 -04:00
Keith Winstein 61c6ee6011 Send SIGSTOP to whole process group on suspend (closes #401) 2013-03-27 00:26:59 -04:00
Keith Winstein abf240768f Cleanups when suspending/resuming with smcup/rmcup 2013-03-11 01:25:18 -04:00
Keith Winstein 093bbc9111 Detached warning: Omit spurious utmp entries (generated by screen) 2013-03-10 16:31:37 -04:00
Anders Kaseorg a54e6d1661 STMClient::still_connecting: Make const
Found by cppcheck.

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

Closes #390.
2013-03-10 15:48:12 -04:00
Anders Kaseorg d0eeabb51e human_readable_duration, Terminal::appendstring: Pass strings by reference
Found by cppcheck.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2013-03-10 15:48:08 -04:00
Anders Kaseorg e2abb8524f Catch exceptions by reference
Found by cppcheck.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2013-03-10 15:48:08 -04:00
Anders Kaseorg 03217ddb5a Move Emulator::{open,close} to Display
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2013-03-10 15:46:38 -04:00
Anders Kaseorg ba8d013609 main: Don’t leak desired_ip memory
Signed-off-by: Anders Kaseorg <andersk@mit.edu>

Closes #385.
2013-03-10 15:45:52 -04:00
Anders Kaseorg b9763b6997 serve: Remove dead store of bytes_read
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2013-03-10 15:45:47 -04:00
Anders Kaseorg d6ff754a9a get_SSH_IP: Don’t leak SSH_writable memory
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2013-03-10 15:45:47 -04:00
Anders Kaseorg 2686b7c634 main: Don’t leak shell_name memory
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2013-03-10 15:45:47 -04:00
Alexander von Gernler ebe7ae96f6 fix a perror() message in mosh-server
A perror() message flanking an open() call was reading "dup2" where it
should read "open".

[closes #377]
2013-01-18 11:51:28 -05:00
Anton Lundin 438d0d8b9a Use the right term.h
When ncurses is in a separate include dir, we need to take the term.h
from there to match with the [n]curses.h
2012-12-16 17:30:14 +01:00
Keith Winstein 1fe6799092 Don't leak extra /dev/null fd (thanks to Julien Cristau) 2012-12-12 19:05:24 -05:00
Keith Winstein 1034f7092a Wrap termio.h include in guard 2012-12-12 18:03:15 -05:00
Anton Lundin 55eb2759c0 use unistd.h instead of getopt.h
getopt.h doesn't exist on AIX and getopt is in unistd.h
2012-12-01 14:49:29 +01:00
Anton Lundin 73d39980f4 Solaris term.h needs both termio.h and termios.h
On solaris, the term.h pulls in termio.h and termios.h if it detects
that they are not loaded. Because stmclient.h pulls in termios.h that
breaks type definitions in term.h that needs termio.h.
2012-12-01 12:53:29 +01:00
Anton Lundin 993abf57f1 Rework curses detection
Detect diffrent variants of curses and use them.
2012-12-01 12:53:28 +01:00
Keith Winstein a2da17d48a Don't immediately clear network exceptions, even when problem solved 2012-11-26 04:19:56 -05:00
Keith Winstein e2b40fcaa7 Show infobar when Ctrl-^ is typed. 2012-11-26 04:03:04 -05:00
Keith Winstein 5eafc209ea Allow suspend by keystroke (Ctrl-^ Ctrl-Z)
(based on patch by Nickolai Zeldovich)
2012-11-26 03:34:14 -05:00
Keith Winstein 1c2b48abc6 mosh-server warning on unattached servers checks that device exists 2012-11-26 03:06:11 -05:00
Keith Winstein 2f8a67acc7 Adjust timeouts so server dies quicker, updates utmp slower 2012-11-26 02:21:06 -05:00
Keith Winstein 486325e76b mosh-server: Fix bug where spins forever if process dies while disconnected 2012-11-26 02:14:48 -05:00
Keith Winstein b018e3a1ab Make "elapsed time" human readable even when other error is displayed 2012-11-05 22:02:46 -05:00
Keith Winstein cdd00fee42 Simplify implementation of human_readable_duration() 2012-11-05 21:57:02 -05:00
Kevin Ballard efbe9b2bab Make the 'lost contact' string more human-readable
Teach the 'lost contact' warning string about time units larger than
seconds. After 60 esconds it will switch over to using a time display
that looks like 1:23, or 1:02:34.

Fixes #321.

Signed-off-by: Kevin Ballard <kevin@sb.org>
2012-11-05 18:39:09 -08:00
Keith Winstein 28ed30c356 Allow stopping (via kill -STOP) and "fg" to resume session 2012-11-04 13:07:24 -05:00
Luke Mewburn 141ec239da Support port range as -p/--port PORT[:HIGHPORT].
Extend mosh and mosh-server to support parsing a high port from
the desired_port argument.  The first (low) port must not be
greater than the second (high) port.
If only one value is provided, behaviour is as before; bind
to one port.  Also tweak the formatting in mosh-server(1) synopsis
to be consistent.

This resolves mosh issue # 296.

Signed-off-by: Luke Mewburn <luke@mewburn.net>
2012-10-29 14:59:28 -04:00
Keith Winstein da18a8c7ea Detect edge case when argc == 0 2012-10-20 14:17:19 -04:00
Ira Cooper deecf6bb2f Add limits.h to allow for illumos to compile.
Closes #331
2012-10-05 04:02:11 -04:00
Keith Winstein c0092a6e7e Hop new ports, but keep the old [for a minute, and up to 10 at a time]
(One is silver and the other gold...)
2012-10-05 02:51:25 -04:00
Keith Winstein d17fb7824b Reset fd sets every time we poll (because network.fd() can now change) 2012-10-05 00:06:37 -04:00
Keith Winstein f621f9f001 Grammar fix on ssh -t message 2012-09-28 20:17:58 -04:00
Keith Winstein 0311365810 Read utmpx directly instead of using "who", and prettify detached warning 2012-09-28 20:06:04 -04:00
Xi Wang f0d9cb3db3 Avoid null pointer dereference in chdir_homedir()
Return if pw is NULL, to avoid dereferencing it at pw->pw_dir.
2012-09-26 22:27:24 -04:00
Keith Winstein bf8a29f783 Improve rendition-matching prediction heuristic. 2012-08-14 07:40:50 -04:00
Keith Winstein 63e66e9855 Add heuristic to match predicted rendition based on char to the left 2012-08-13 10:56:50 -04:00
Keith Winstein 89da6105aa When not connected, (1) client hops port numbers (2) server stops sending. 2012-08-13 11:19:25 +03:00
Timo Sirainen 9296ffbed7 Don't reopen stdio. It's not needed, and it doesn't compile with Solaris.
Signed-off-by: Timo Sirainen <tss@iki.fi>
2012-08-11 17:14:45 -04:00
Timo Sirainen 9cade23616 It's safer to close stdin/out/err by replacing their fd with /dev/null.
Otherwise the next opened fds are 0/1/2, and any code writing to
stdout/stderr might break things by writing to an unintentional fd.

Signed-off-by: Timo Sirainen <tss@iki.fi>
2012-08-11 17:14:45 -04:00
Timo Sirainen b245ed00ca Don't call setsid(), forkpty() does it anyway. This fixes a failing ioctl(TIOCSCTTY) in Solaris.
Signed-off-by: Timo Sirainen <tss@iki.fi>
2012-08-11 17:14:45 -04:00
Timo Sirainen 0c5307f345 Added forkpty() and cfmakeraw() fallback implementations if they don't exist.
Signed-off-by: Timo Sirainen <tss@iki.fi>
2012-08-11 17:14:44 -04:00
Keith Winstein 894a190f06 Revert creation of utmp entry to avoid uninitialized "master" 2012-08-11 17:13:43 -04:00