You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Whenever the term.resize() is called with a number lower than the length of any line, the characters at the end are just popped off, and cannot be recovered.
Here's the offending line in term.js
// resize cols
j = this.cols;
if (j < x) {
ch = [this.defAttr, ' ']; // does xterm use the default attr?
i = this.lines.length;
while (i--) {
while (this.lines[i].length < x) {
this.lines[i].push(ch);
}
}
} else if (j > x) {
i = this.lines.length;
while (i--) {
while (this.lines[i].length > x) {
this.lines[i].pop();
}
}
}
That last line is just popping off the data! Unless I'm resizing it wrong, how am I supposed to prevent this? My current workaround is to not reduce the col number past 80.
The text was updated successfully, but these errors were encountered:
I am pretty sure the issue is something else. How are you doing the resize? Just on the client side with term.resize()? If so that is definitely the issue. You also need to resize on the server side, otherwise your pty won't be in sync with your web term instance. Try this:
Client side:
Whenever the term.resize() is called with a number lower than the length of any line, the characters at the end are just popped off, and cannot be recovered.
Here's the offending line in term.js
// resize cols
j = this.cols;
if (j < x) {
ch = [this.defAttr, ' ']; // does xterm use the default attr?
i = this.lines.length;
while (i--) {
while (this.lines[i].length < x) {
this.lines[i].push(ch);
}
}
} else if (j > x) {
i = this.lines.length;
while (i--) {
while (this.lines[i].length > x) {
this.lines[i].pop();
}
}
}
That last line is just popping off the data! Unless I'm resizing it wrong, how am I supposed to prevent this? My current workaround is to not reduce the col number past 80.
The text was updated successfully, but these errors were encountered: