Fix initial cursor blinking (#2614)

* Fix initial cursor blinking

This is a workaround for https://github.com/xtermjs/xterm.js/issues/1194

Fixes #2596

* Add related issue comment
This commit is contained in:
CHaBou 2018-01-16 15:44:29 +01:00 committed by Albin Ekblom
parent f56ea10fb0
commit 88c7b536a4

View file

@ -75,6 +75,8 @@ export default class Term extends PureComponent {
this.term = props.term || new Terminal(this.termOptions); this.term = props.term || new Terminal(this.termOptions);
this.term.attachCustomKeyEventHandler(this.keyboardHandler); this.term.attachCustomKeyEventHandler(this.keyboardHandler);
this.term.open(this.termRef); this.term.open(this.termRef);
//This is a workaround for https://github.com/xtermjs/xterm.js/issues/1194
this.term.setOption('cursorBlink', this.termOptions.cursorBlink);
if (props.term) { if (props.term) {
//We need to set options again after reattaching an existing term //We need to set options again after reattaching an existing term
Object.keys(this.termOptions).forEach(option => this.term.setOption(option, this.termOptions[option])); Object.keys(this.termOptions).forEach(option => this.term.setOption(option, this.termOptions[option]));