mirror of
https://github.com/wavetermdev/backup.git
synced 2026-08-05 13:57:07 -07:00
send window:resize command
This commit is contained in:
@@ -280,11 +280,23 @@ class ScreenWindow {
|
|||||||
term.updatePtyData(ptyMsg.ptypos, data);
|
term.updatePtyData(ptyMsg.ptypos, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isActive() : boolean {
|
||||||
|
let activeScreen = GlobalModel.getActiveScreen();
|
||||||
|
if (activeScreen == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return (this.sessionId = activeScreen.sessionId) && (this.screenId == activeScreen.screenId);
|
||||||
|
}
|
||||||
|
|
||||||
colsCallback(cols : number) : void {
|
colsCallback(cols : number) : void {
|
||||||
|
if (!this.isActive()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
console.log("cols set", cols);
|
console.log("cols set", cols);
|
||||||
for (let cmdid in this.terms) {
|
for (let cmdid in this.terms) {
|
||||||
this.terms[cmdid].resizeCols(cols);
|
this.terms[cmdid].resizeCols(cols);
|
||||||
}
|
}
|
||||||
|
GlobalCommandRunner.resizeWindow(this.windowId, cols);
|
||||||
}
|
}
|
||||||
|
|
||||||
setWidth(width : number) : void {
|
setWidth(width : number) : void {
|
||||||
@@ -1740,6 +1752,10 @@ class CommandRunner {
|
|||||||
closeScreen(screen : string) {
|
closeScreen(screen : string) {
|
||||||
GlobalModel.submitCommand("screen", "close", [screen], {"nohist": "1"}, false);
|
GlobalModel.submitCommand("screen", "close", [screen], {"nohist": "1"}, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resizeWindow(windowId : string, cols : number) {
|
||||||
|
GlobalModel.submitCommand("window", "resize", null, {"nohist": "1", "window": windowId, "cols": String(cols)}, false);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
let GlobalModel : Model = null;
|
let GlobalModel : Model = null;
|
||||||
|
|||||||
@@ -204,7 +204,6 @@ class TermWrap {
|
|||||||
if (ptyOffsetStr != null && !isNaN(parseInt(ptyOffsetStr))) {
|
if (ptyOffsetStr != null && !isNaN(parseInt(ptyOffsetStr))) {
|
||||||
ptyOffset = parseInt(ptyOffsetStr);
|
ptyOffset = parseInt(ptyOffsetStr);
|
||||||
}
|
}
|
||||||
console.log("set ptyoffset", ptyOffset);
|
|
||||||
return resp.arrayBuffer()
|
return resp.arrayBuffer()
|
||||||
}).then((buf) => {
|
}).then((buf) => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user