Fix backend typescript issues

This commit is contained in:
Louis Lam
2023-11-18 15:43:53 +08:00
parent 2cca168d39
commit f9761daefc
17 changed files with 144 additions and 105 deletions

View File

@@ -54,7 +54,9 @@ export class Terminal {
try {
this.ptyProcess?.resize(this.cols, this.rows);
} catch (e) {
log.debug("Terminal", "Failed to resize terminal: " + e.message);
if (e instanceof Error) {
log.debug("Terminal", "Failed to resize terminal: " + e.message);
}
}
}
@@ -67,7 +69,9 @@ export class Terminal {
try {
this.ptyProcess?.resize(this.cols, this.rows);
} catch (e) {
log.debug("Terminal", "Failed to resize terminal: " + e.message);
if (e instanceof Error) {
log.debug("Terminal", "Failed to resize terminal: " + e.message);
}
}
}
@@ -85,7 +89,7 @@ export class Terminal {
// On Data
this._ptyProcess.onData((data) => {
this.buffer.push(data);
this.buffer.pushItem(data);
if (this.server.io) {
this.server.io.to(this.name).emit("terminalWrite", this.name, data);
}