@@ -390,7 +390,7 @@ hterm.Terminal.prototype.setProfile = function(profileId, opt_callback) {
390390 } ,
391391
392392 'enable-blink' : function ( v ) {
393- terminal . syncBlinkState ( ) ;
393+ terminal . setTextBlink ( ! ! v ) ;
394394 } ,
395395
396396 'enable-clipboard-write' : function ( v ) {
@@ -771,6 +771,20 @@ hterm.Terminal.prototype.setCssVar = function(name, value,
771771 `${ opt_prefix } ${ name } ` , value ) ;
772772} ;
773773
774+ /**
775+ * Get a CSS variable.
776+ *
777+ * Normally this is used to get variables in the hterm namespace.
778+ *
779+ * @param {string } name The variable to read.
780+ * @param {string? } opt_prefix The variable namespace/prefix to use.
781+ * @return {string } The current setting for this variable.
782+ */
783+ hterm . Terminal . prototype . getCssVar = function ( name , opt_prefix = '--hterm-' ) {
784+ return this . document_ . documentElement . style . getPropertyValue (
785+ `${ opt_prefix } ${ name } ` ) ;
786+ } ;
787+
774788/**
775789 * Set the font size for this terminal.
776790 *
@@ -862,11 +876,14 @@ hterm.Terminal.prototype.syncBoldSafeState = function() {
862876} ;
863877
864878/**
865- * Enable or disable blink based on the enable-blink pref.
879+ * Control text blinking behavior.
880+ *
881+ * @param {boolean= } state Whether to enable support for blinking text.
866882 */
867- hterm . Terminal . prototype . syncBlinkState = function ( ) {
868- this . setCssVar ( 'node-duration' ,
869- this . prefs_ . get ( 'enable-blink' ) ? '0.7s' : '0' ) ;
883+ hterm . Terminal . prototype . setTextBlink = function ( state ) {
884+ if ( state === undefined )
885+ state = this . prefs_ . get ( 'enable-blink' ) ;
886+ this . setCssVar ( 'blink-node-duration' , state ? '0.7s' : '0' ) ;
870887} ;
871888
872889/**
0 commit comments