hterm: Fix cursor blink on soft reset.

When the terminal receives a soft reset, it should keep the current
blink setting.

To test, you can use the following:

(with cursor-blink preference off)
$ printf '\e[1 q'  # Turns on blink.
$ printf '\e[!p'  # Soft reset -- cursor should still blink.
$ printf '\ec'  # Hard reset -- cursor should stop blinking.

(with cursor-blink preference on)
$ printf '\e[2 q'  # Turns off blink.
$ printf '\e[!p'  # Soft reset -- cursor should still not blink.
$ printf '\ec'  # Hard reset -- cursor should start blinking.

Change-Id: I370b86f2e66236d99956744b74b87764b1d3f30f
Reviewed-on: https://chromium-review.googlesource.com/260476
Reviewed-by: Rob Ginda <rginda@chromium.org>
Tested-by: Rob Ginda <rginda@chromium.org>
diff --git a/hterm/js/hterm_terminal.js b/hterm/js/hterm_terminal.js
index 4cdd4ae..4fe47b8 100644
--- a/hterm/js/hterm_terminal.js
+++ b/hterm/js/hterm_terminal.js
@@ -1050,6 +1050,9 @@
   // Reset terminal options to their default values.
   this.options_ = new hterm.Options();
 
+  // We show the cursor on soft reset but do not alter the blink state.
+  this.options_.cursorBlink = !!this.timeouts_.cursorBlink;
+
   // Xterm also resets the color palette on soft reset, even though it doesn't
   // seem to be documented anywhere.
   this.primaryScreen_.textAttributes.resetColorPalette();