Improves 679b819216 to make it simpler to
ignore mosh-client from OS X Terminal.app's "Ask before closing" process
list. (See: http://superuser.com/a/254647)
Moreover, the command displayed from ps is a completely functional one,
which was not the case in the previous approach, that mangles `argv[0]`.
Fixes#742.
* A resize action could be applied to the framebuffer but discarded
before being applied to termios, causing them to be out of sync.
* Only every second action was skipped, instead of skipping
consecutive resize actions, as intended.
Found by inspection, not seen in actual usage or by the window-resize
test.
* Reduce the size of Terminal::Cell.
* Change colors and attributes in Terminal::Rendition to bitfields/bitmask.
* Change Cells to use UTF-8 strings instead of vector<wchar_t>. Store Rows in a vector instead of a deque.
* Add various Framebuffer::append() methods for more efficient passing of single and repeated characters.
* Change title/icon strings from deques to a vector typedef-- this is more for tidiness than any real performance.
* 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
Fixes warning: ‘Overlay::NotificationEngine::escape_key_string’ should
be initialized in the member initialization list.
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
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>
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>
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>
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.
Otherwise the printed exception may be immediately hidden when the
terminal exits alternate screen mode.
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
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.
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.