hterm 1.44: 'cursor-blink-cycle', bracketed paste, other fixes

* Fix Firefox detection in hterm.ScrollPort..decorate.
* Implement bracketed paste, BUG=chromium:393622
* Fix flash on paste, BUG=chromium:390357, BUG=chromium:394568
* Fix hollow-cursor-after-paste issue, BUG=chromium:390357
* Fix reverse-wrap.
* Add a 'cursor-blink-cycle' preference which can be a number or a two-number
  array.  If two numbers are provided, the first is how long a blinking cursor
  should be on, the second is how long it should be off.  If a single number is
  given it's used for both on and off.  Anything else results in a fast
  blinking cursor.  BUG=chromium:366206
* Hide terminal cursor when mouse cursor is over it, BUG=chromium:365910

Change-Id: I4f71ecb106a31d5481488943abda130e905eeb5a
Reviewed-on: https://chromium-review.googlesource.com/209450
Reviewed-by: Robert Ginda <rginda@chromium.org>
Tested-by: Robert Ginda <rginda@chromium.org>
nassh 0.8.27.10: Update to hterm 1.44.

Change-Id: Ic59216cfe79295f64ebdeda686e30be5ed43b6e5
Reviewed-on: https://chromium-review.googlesource.com/209581
Reviewed-by: Robert Ginda <rginda@chromium.org>
Tested-by: Robert Ginda <rginda@chromium.org>
hterm 1.45: Fix overlay position on Firefox.

* Add the trailing 'px' in the css top/left property.  Chrome is ok without it
  but it's required on Firefox.

Change-Id: I7d51aed509bffb957a7523b36836f50911489e21
Reviewed-on: https://chromium-review.googlesource.com/209582
Reviewed-by: Edoardo Spadolini <kerio00@gmail.com>
Tested-by: Edoardo Spadolini <kerio00@gmail.com>
Reviewed-by: Robert Ginda <rginda@chromium.org>
Tested-by: Robert Ginda <rginda@chromium.org>
hterm 1.46: Fix right-click paste issues.

* Version 1.44 introduced an issue with right-click paste where focusing the
  paste target would force the page to scroll 1000px past the end of the
  terminal.  Now we place the paste target within the visible bounds of the
  terminal, but nehind it in z-index.

BUG=chromium:397182

Change-Id: I5f5aab56afb8fc9a4c39281b8f03a0639da96bef
Reviewed-on: https://chromium-review.googlesource.com/209748
Reviewed-by: Rob Spies <wilford@google.com>
Commit-Queue: Rob Spies <wilford@google.com>
Reviewed-by: Robert Ginda <rginda@chromium.org>
Tested-by: Robert Ginda <rginda@chromium.org>
nassh 0.8.27.11: Update to hterm 1.46.

Change-Id: I5ba26c293f0c16a82ee0f03f456fbcf739fade89
Reviewed-on: https://chromium-review.googlesource.com/209782
Reviewed-by: Robert Ginda <rginda@chromium.org>
Tested-by: Robert Ginda <rginda@chromium.org>
hterm: Move default preferences to a property.

* Moved the definition of the default preferences to a property on
  hterm.PreferenceManager rather than an object literal in the constructor.
  This lets embedders adjust default values before the terminal is initialized.

Change-Id: I76e4b3c5213f2547ca7bf94e22dcb8521fcb3b39
Reviewed-on: https://chromium-review.googlesource.com/209820
Reviewed-by: Edoardo Spadolini <kerio00@gmail.com>
Tested-by: Edoardo Spadolini <kerio00@gmail.com>
Reviewed-by: Robert Ginda <rginda@chromium.org>
hterm: Fix tests to account for fratctional pixels

* Chrome 38 returns fractional dimensions for nodes that were
  set to a fractional size, where previous versions did not.
  However, a node contained by such a node whose width is set to
  '100%' returns only the integer portion of the width.  This patch
  makes us round up rather than set a fractional terminal width, and
  adjusts the test to exepect this behavior.

Change-Id: Ia9f0d01de85fa58c9ff98b3d22b41dccdbdc1ab0
Reviewed-on: https://chromium-review.googlesource.com/209821
Reviewed-by: Robert Ginda <rginda@chromium.org>
Tested-by: Robert Ginda <rginda@chromium.org>
hterm: Always restore the selection after a copy

* Always restore the selection after a copy operation, if we can.
  The clearSelectionAfterCopy option shouldn't come in to play here.
  We should only be clearing the selection after a delay, which means
  we'll always need to restore after a copy.

Change-Id: I21f653e8b995ceb1cf4d1b9a3ab1ed73eb0303ff
Reviewed-on: https://chromium-review.googlesource.com/210008
Reviewed-by: Rob Spies <wilford@google.com>
Commit-Queue: Rob Spies <wilford@google.com>
Reviewed-by: Robert Ginda <rginda@chromium.org>
Tested-by: Robert Ginda <rginda@chromium.org>
hterm 1.47, nassh 0.8.27.12: changelogs

Change-Id: If24521c6fdee3cd6df733104799f74a7a5f50c43
Reviewed-on: https://chromium-review.googlesource.com/210041
Reviewed-by: Robert Ginda <rginda@chromium.org>
Tested-by: Robert Ginda <rginda@chromium.org>
Zooms the terminal on mac with apple +/-, as that is the default behaviour for mac browsers.

Change-Id: Ie686cebbef8e833d1a0094be429c94bb816b7670
Reviewed-on: https://chromium-review.googlesource.com/209882
Reviewed-by: Robert Ginda <rginda@chromium.org>
Tested-by: Robert Ginda <rginda@chromium.org>
nassh: Don't reload while windows are open.

Handle the chrome.runtime.onUpdateAvailable event so that we're
not automatically reloaded when there's a pending update.

When we notice an update available we show a unicode up-arrow in
each terminal window.  When all windows are closed we'll apply the
update.  Users can dismiss the update notification by clicking on
it.

Change-Id: I943abd63709fc08d0d2c702a4b3a27a2b5cec5c7
Reviewed-on: https://chromium-review.googlesource.com/210538
Reviewed-by: Antony Sargent <asargent@chromium.org>
Tested-by: Robert Ginda <rginda@chromium.org>
Put the ruler text in a span and measure the span instead of the div.

It's needed to work around what I assume is a bug in Firefox (or perhaps
just a quirk?): using a square font, the height of the ruler div is
sometimes two or three pixels higher than the text itself - measuring a
span that contains the text seems to work fine, without any other changes;
the behaviour in Chrome is unchanged.

Change-Id: I78ee2db9fde6eaa51500ddb413b3582a25de0c4a
Reviewed-on: https://chromium-review.googlesource.com/210863
Reviewed-by: Edoardo Spadolini <kerio00@gmail.com>
Tested-by: Edoardo Spadolini <kerio00@gmail.com>
Reviewed-by: Robert Ginda <rginda@chromium.org>
Tested-by: Robert Ginda <rginda@chromium.org>
Some more keycode changes to better support Firefox on Mac

The cmd+0 (meta+0) combination should reset zoom, on Mac, and Firefox
has different keycodes for -_ and += than Chrome; as a bonus, the
keycode for +* with the italian keyboard layout in Firefox wasn't
accounted for (but the key itself worked fine even before this change)

Change-Id: I0183e37306b9d395e18cd14f4a4287d38048d432
Reviewed-on: https://chromium-review.googlesource.com/210910
Tested-by: Edoardo Spadolini <kerio00@gmail.com>
Reviewed-by: Robert Ginda <rginda@chromium.org>
Tested-by: Robert Ginda <rginda@chromium.org>
Fix CSI u to actually restore the cursor position

Change-Id: I2817e1c51bfeb957fa91def7746fe2623828bc85
Reviewed-on: https://chromium-review.googlesource.com/211390
Reviewed-by: Edoardo Spadolini <kerio00@gmail.com>
Commit-Queue: Edoardo Spadolini <kerio00@gmail.com>
Tested-by: Edoardo Spadolini <kerio00@gmail.com>
Reviewed-by: Robert Ginda <rginda@chromium.org>
Tested-by: Robert Ginda <rginda@chromium.org>
Disable the underscore font workarounds

Change-Id: I5f4a5203c240d2239eab80bce54c99d1cc1f0a64
Reviewed-on: https://chromium-review.googlesource.com/210860
Reviewed-by: Edoardo Spadolini <kerio00@gmail.com>
Tested-by: Edoardo Spadolini <kerio00@gmail.com>
Reviewed-by: Robert Ginda <rginda@chromium.org>
Tested-by: Robert Ginda <rginda@chromium.org>
Add vt_tiledata support.

See http://nethackwiki.com/wiki/Vt_tiledata for details.

Change-Id: Id402fde590eca355039acb5b6d4d60f92c1d2e1a
Reviewed-on: https://chromium-review.googlesource.com/211500
Reviewed-by: Edoardo Spadolini <kerio00@gmail.com>
Tested-by: Edoardo Spadolini <kerio00@gmail.com>
Reviewed-by: Robert Ginda <rginda@chromium.org>
Tested-by: Robert Ginda <rginda@chromium.org>
hterm: cursor hiding fixes

* Disable terminal cursor hiding when the host app is consuming
  mouse events.  It's not necessary since the terminal cursor only
  interferes with local selection, and local selection is disabled
  in this mode.
* Re-show the cursor if it is repositioned out from under the
  mouse cursor.

Change-Id: I1722f41766240b7a671747b80bb237c8ad51c3b3
Reviewed-on: https://chromium-review.googlesource.com/211871
Reviewed-by: Daniel Erat <derat@chromium.org>
Tested-by: Robert Ginda <rginda@chromium.org>
hterm: Allow double-click selection to start with '~' or '.'

Change-Id: I1c824d44ad314dd9fda1d7764b26024959ae0c5b
Reviewed-on: https://chromium-review.googlesource.com/211870
Reviewed-by: Marvelous Marius <mschilder@chromium.org>
Reviewed-by: Robert Ginda <rginda@chromium.org>
Tested-by: Robert Ginda <rginda@chromium.org>
Updated HACK.md instructions on getting commit-msg hook

Change-Id: I61676c0edc7cea4387834975dc2ac3d46624822c
Reviewed-on: https://chromium-review.googlesource.com/212130
Reviewed-by: Robert Ginda <rginda@chromium.org>
Tested-by: Robert Ginda <rginda@chromium.org>
hterm 1.48: update changelog

Change-Id: I7d2c054fa10121f6eb17004ada6826173b236f3e
Reviewed-on: https://chromium-review.googlesource.com/212268
Reviewed-by: Robert Ginda <rginda@chromium.org>
Tested-by: Robert Ginda <rginda@chromium.org>