Add diagnostic logging for canvas/container dimensions
- Log canvas element and dimensions after terminal.open() - Log container dimensions - Log canvas state after fit() completes - Helps debug blank terminal issues v0.6.6
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "textual-webterm"
|
name = "textual-webterm"
|
||||||
version = "0.6.5"
|
version = "0.6.6"
|
||||||
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
@@ -463,9 +463,41 @@ class WebTerminal {
|
|||||||
|
|
||||||
/** Initialize event handlers and connect */
|
/** Initialize event handlers and connect */
|
||||||
private initialize(): void {
|
private initialize(): void {
|
||||||
|
console.log("[webterm:init] initialize() called");
|
||||||
|
|
||||||
|
// Check canvas state immediately
|
||||||
|
const canvas = this.element.querySelector("canvas");
|
||||||
|
console.log("[webterm:init] Canvas element:", canvas);
|
||||||
|
if (canvas) {
|
||||||
|
console.log("[webterm:init] Canvas dimensions:", {
|
||||||
|
width: canvas.width,
|
||||||
|
height: canvas.height,
|
||||||
|
clientWidth: canvas.clientWidth,
|
||||||
|
clientHeight: canvas.clientHeight,
|
||||||
|
style: canvas.style.cssText
|
||||||
|
});
|
||||||
|
}
|
||||||
|
console.log("[webterm:init] Container dimensions:", {
|
||||||
|
clientWidth: this.element.clientWidth,
|
||||||
|
clientHeight: this.element.clientHeight
|
||||||
|
});
|
||||||
|
|
||||||
// Wait for fonts to load before fitting to ensure correct measurements
|
// Wait for fonts to load before fitting to ensure correct measurements
|
||||||
this.waitForFonts().then(() => {
|
this.waitForFonts().then(() => {
|
||||||
|
console.log("[webterm:init] Fonts loaded, calling fit()...");
|
||||||
this.fit();
|
this.fit();
|
||||||
|
console.log("[webterm:init] fit() completed");
|
||||||
|
|
||||||
|
// Check canvas state after fit
|
||||||
|
const canvasAfterFit = this.element.querySelector("canvas");
|
||||||
|
if (canvasAfterFit) {
|
||||||
|
console.log("[webterm:init] Canvas after fit:", {
|
||||||
|
width: canvasAfterFit.width,
|
||||||
|
height: canvasAfterFit.height,
|
||||||
|
clientWidth: canvasAfterFit.clientWidth,
|
||||||
|
clientHeight: canvasAfterFit.clientHeight
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Setup resize observer (we use our own fit method, not FitAddon's)
|
// Setup resize observer (we use our own fit method, not FitAddon's)
|
||||||
|
|||||||
Reference in New Issue
Block a user