Remove scroll-lock, this is now a feature of xterm.js

This commit is contained in:
Simon Howe
2017-02-01 16:57:40 +01:00
committed by jpellizzari
parent ca97cee4dd
commit 9e333d4f4d

View File

@@ -144,12 +144,7 @@ class Terminal extends React.Component {
socket.onmessage = (event) => {
log('pipe data', event.data.size);
const input = ab2str(event.data);
const scrolledToBottom = term.ydisp === term.ybase;
const savedScrollPosition = term.ydisp;
term.write(input);
if (!scrolledToBottom) {
this.scrollTo(savedScrollPosition);
}
};
this.socket = socket;
@@ -161,19 +156,6 @@ class Terminal extends React.Component {
}
}
scrollToBottom() {
this.scrollTo(this.term.ybase);
}
scrollTo(y) {
if (!this.term) {
return;
}
this.term.ydisp = y;
this.term.emit('scroll', y);
this.term.refresh(0, this.term.rows - 1);
}
componentDidMount() {
this.isComponentMounted = true;
if (this.props.connect) {
@@ -192,7 +174,6 @@ class Terminal extends React.Component {
this.term.open(this.innerFlex);
this.term.on('data', (data) => {
this.scrollToBottom();
if (this.socket) {
this.socket.send(data);
}