@@ -390,7 +390,7 @@ hterm.Terminal.prototype.setProfile = function(profileId, opt_callback) {
390
390
} ,
391
391
392
392
'enable-blink' : function ( v ) {
393
- terminal . syncBlinkState ( ) ;
393
+ terminal . setTextBlink ( ! ! v ) ;
394
394
} ,
395
395
396
396
'enable-clipboard-write' : function ( v ) {
@@ -771,6 +771,20 @@ hterm.Terminal.prototype.setCssVar = function(name, value,
771
771
`${ opt_prefix } ${ name } ` , value ) ;
772
772
} ;
773
773
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
+
774
788
/**
775
789
* Set the font size for this terminal.
776
790
*
@@ -862,11 +876,14 @@ hterm.Terminal.prototype.syncBoldSafeState = function() {
862
876
} ;
863
877
864
878
/**
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.
866
882
*/
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' ) ;
870
887
} ;
871
888
872
889
/**
0 commit comments