Bump version to 0.3.26 and fix terminal resize issues
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "textual-webterm"
|
name = "textual-webterm"
|
||||||
version = "0.3.25"
|
version = "0.3.26"
|
||||||
description = "Serve terminal sessions over the web"
|
description = "Serve terminal sessions over the web"
|
||||||
authors = ["Will McGugan <will@textualize.io>"]
|
authors = ["Will McGugan <will@textualize.io>"]
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -59,7 +59,6 @@ class WebTerminal {
|
|||||||
private reconnectAttempts = 0;
|
private reconnectAttempts = 0;
|
||||||
private maxReconnectAttempts = 5;
|
private maxReconnectAttempts = 5;
|
||||||
private reconnectDelay = 1000;
|
private reconnectDelay = 1000;
|
||||||
private resizeEventsEnabled = false;
|
|
||||||
|
|
||||||
constructor(container: HTMLElement, wsUrl: string, config: TerminalConfig = {}) {
|
constructor(container: HTMLElement, wsUrl: string, config: TerminalConfig = {}) {
|
||||||
this.element = container;
|
this.element = container;
|
||||||
@@ -115,9 +114,6 @@ class WebTerminal {
|
|||||||
|
|
||||||
// Handle resize
|
// Handle resize
|
||||||
this.terminal.onResize(({ cols, rows }) => {
|
this.terminal.onResize(({ cols, rows }) => {
|
||||||
if (!this.resizeEventsEnabled) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.send(["resize", { width: cols, height: rows }]);
|
this.send(["resize", { width: cols, height: rows }]);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -183,7 +179,6 @@ class WebTerminal {
|
|||||||
// Important: the PTY hard-wraps output based on its initial cols/rows.
|
// Important: the PTY hard-wraps output based on its initial cols/rows.
|
||||||
// If we send a resize before fonts/layout settle, the initial cols can be
|
// If we send a resize before fonts/layout settle, the initial cols can be
|
||||||
// too small and the shell will wrap permanently.
|
// too small and the shell will wrap permanently.
|
||||||
this.resizeEventsEnabled = false;
|
|
||||||
|
|
||||||
const init = () => {
|
const init = () => {
|
||||||
const fallback = { cols: 132, rows: 45 };
|
const fallback = { cols: 132, rows: 45 };
|
||||||
@@ -203,13 +198,11 @@ class WebTerminal {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.terminal.resize(fallback.cols, fallback.rows);
|
this.terminal.resize(fallback.cols, fallback.rows);
|
||||||
this.resizeEventsEnabled = true;
|
|
||||||
this.send(["resize", { width: fallback.cols, height: fallback.rows }]);
|
this.send(["resize", { width: fallback.cols, height: fallback.rows }]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.terminal.resize(dims.cols, dims.rows);
|
this.terminal.resize(dims.cols, dims.rows);
|
||||||
this.resizeEventsEnabled = true;
|
|
||||||
this.send(["resize", { width: dims.cols, height: dims.rows }]);
|
this.send(["resize", { width: dims.cols, height: dims.rows }]);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user