Skip to content

Commit

Permalink
fix(maximize): fix invisible data in other panes
Browse files Browse the repository at this point in the history
Fixes #41
  • Loading branch information
chabou committed Dec 31, 2018
1 parent 4612d1d commit 7f0c766
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ const ROOT_FRAME = {
h: 1
};

const hiddenTerms = {};

// For each rootGroup, it sorts its children
function getSortedSessionGroups(termGroups) {
return getRootGroups(termGroups).reduce(
Expand Down Expand Up @@ -327,6 +329,14 @@ exports.middleware = store => next => action => {
}
}
break;
case 'SESSION_PTY_DATA': {
// Hyper doesn't send data if Term is unmounted
const term = hiddenTerms[action.uid];
if (term) {
term.write(action.data);
}
break;
}
}
return next(action);
};
Expand Down Expand Up @@ -630,6 +640,15 @@ exports.decorateTerm = (Term, {React}) => {
}
}

componentWillUnmount() {
// Keep reference to hidden terms to write PTY data.
// Hyper doesn't send them if Term is unmounted
hiddenTerms[this.props.uid] = this.term.term;
}
componentDidMount() {
hiddenTerms[this.props.uid] = null;
}

render() {
const props = {
onDecorated: this.onDecorated
Expand Down

0 comments on commit 7f0c766

Please sign in to comment.