Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support resizing via control codes. #75

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 36 additions & 14 deletions src/term.js
Original file line number Diff line number Diff line change
Expand Up @@ -2209,19 +2209,19 @@ Terminal.prototype.write = function(data) {
// CSI Pt; Pl; Pb; Pr; Ps$ t
// CSI > Ps; Ps t
// CSI Ps SP t
// case 't':
// if (this.postfix === '$') {
// this.reverseAttrInRectangle(this.params);
// } else if (this.postfix === ' ') {
// this.setWarningBellVolume(this.params);
// } else {
// if (this.prefix === '>') {
// this.setTitleModeFeature(this.params);
// } else {
// this.manipulateWindow(this.params);
// }
// }
// break;
case 't':
if (this.postfix === '$') {
this.reverseAttrInRectangle(this.params);
} else if (this.postfix === ' ') {
this.setWarningBellVolume(this.params);
} else {
if (this.prefix === '>') {
this.setTitleModeFeature(this.params);
} else {
this.manipulateWindow(this.params);
}
}
break;

// CSI u Restore cursor (ANSI.SYS).
// CSI Ps SP u
Expand Down Expand Up @@ -2815,6 +2815,7 @@ Terminal.prototype.resize = function(x, y) {
// screen buffer. just set it
// to null for now.
this.normal = null;
this.emit('resize', this.cols, this.rows);
};

Terminal.prototype.updateRange = function(y) {
Expand Down Expand Up @@ -4352,7 +4353,28 @@ Terminal.prototype.savePrivateValues = function(params) {
// Ps = 2 3 ; 2 -> Restore xterm window title from stack.
// Ps >= 2 4 -> Resize to Ps lines (DECSLPP).
Terminal.prototype.manipulateWindow = function(params) {
;
switch (params[0]) {
case 8:
this.resize(params[2], params[1]);
break;
// case 22:
// // We only have a window title, not an icon title.
// if (params[1] == 0 || params[1] == 2) {
// this.titleStack || (this.titleStack = []);
// this.titleStack.push(this.title);
// }
// break;
// case 23:
// // We only have a window title, not an icon title.
// if ((params[1] == 0 || params[1] == 2) && this.titleStack) {
// var title = this.titleStack.pop();
// if (title !== undefined) {
// this.title = title;
// this.handleTitle(this.title);
// }
// }
// break;
}
};

// CSI Pt; Pl; Pb; Pr; Ps$ t
Expand Down