Fix chunking for large data, allow pixels

This commit is contained in:
Anthony Kim
2026-01-27 17:21:38 -08:00
parent 5e95ef652d
commit 1442f84e4e
3 changed files with 192 additions and 23 deletions
+6 -2
View File
@@ -327,7 +327,9 @@ function createTerminal(): Terminal {
}
const cols = size.cols;
const rows = size.rows;
const url = '/terminals/' + pid + '/size?cols=' + cols + '&rows=' + rows;
const pixelWidth = Math.round(term.dimensions?.css?.canvas?.width ?? 0);
const pixelHeight = Math.round(term.dimensions?.css?.canvas?.height ?? 0);
const url = '/terminals/' + pid + '/size?cols=' + cols + '&rows=' + rows + '&pixelWidth=' + pixelWidth + '&pixelHeight=' + pixelHeight;
fetch(url, { method: 'POST' });
});
@@ -378,7 +380,9 @@ function createTerminal(): Terminal {
if (useRealTerminal instanceof HTMLInputElement && !useRealTerminal.checked) {
runFakeTerminal();
} else {
const res = await fetch('/terminals?cols=' + term.cols + '&rows=' + term.rows, { method: 'POST' });
const pixelWidth = Math.round(term.dimensions?.css?.canvas?.width ?? 0);
const pixelHeight = Math.round(term.dimensions?.css?.canvas?.height ?? 0);
const res = await fetch('/terminals?cols=' + term.cols + '&rows=' + term.rows + '&pixelWidth=' + pixelWidth + '&pixelHeight=' + pixelHeight, { method: 'POST' });
const processId = await res.text();
pid = processId;
socketURL += processId;