This field was used during development to measure the
coverage of the ANSI terminal parser against typical
terminal input sequences.
The "handled" field has not been read by any code since
commit 1ee54cd7 (February 2011). Eliminating the field
by popular request (closes#723).
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.
ASCII <-> UTF has trivial mappings. Avoid wcrtomb() and mbrtowc().
ISO-8859-1 is all narrow characters, and cheap to test for. It might
be possible to cheaply test other popular UTF blocks and/or planes as
well.
These two changes get 2-3x faster input processing on Linux and
FreeBSD. Performance improvement in actual usage is more modest but
still significant.
* Refactor put_cell() and parts of new_frame(), and associated state, into put_row().
* Optimize display and line wrap handling code/output.
* Make last_frame a const ref, to eliminate a costly copy of the framebuffer on every screen refresh.
* In new_frame()'s scroll optimization, don't copy rows, use pointers instead.
* Don't check entire frame buffer for scrolling if first line hasn't scrolled.
* Add a generation counter on Row objects to allow quicker/better identification of scroll regions
* Use at() for bounds-checking on framebuffers, because they can be resized.
* Copy and resize scroll buffer on window resize.
* 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
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>
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>
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>
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>
We aren't sure why this change was made, and reverting it appears to help
fix mouse issues in emacs related to text hilighting.
Signed-off-by: Andrew Chin <achin@eminence32.net>