Prevent xterm to emit focus event twice

This commit is contained in:
CHaBou 2017-09-18 22:13:45 +02:00
parent f8c19b0ef2
commit 46173019cd
No known key found for this signature in database
GPG key ID: EF8D073B729A0B33

View file

@ -55,7 +55,12 @@ export default class Term extends PureComponent {
}
if (props.onActive) {
this.term.on('focus', props.onActive);
this.term.on('focus', () => {
// xterm@2 emits this event 2 times. Will be fixed in xterm@3.
if (!this.props.isTermActive) {
props.onActive();
}
});
}
if (props.onData) {