From ad86a8d5373bebc6b7e877769e8cc3a9611fec37 Mon Sep 17 00:00:00 2001 From: ACoolName Date: Sun, 2 Jun 2024 13:05:36 +0300 Subject: [PATCH] test --- src/common.tsx | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/common.tsx b/src/common.tsx index 285131f..411e1fd 100644 --- a/src/common.tsx +++ b/src/common.tsx @@ -270,9 +270,29 @@ export function ActionItem(p: { action: ActionInfo, identifierSubstring?: string if (terminalWindow) { terminalWindow.document.write('
'); terminalWindow.document.title = "Terminal"; - - createRoot(terminalWindow.document.body).render(); + var terminal_root = terminalWindow.document.getElementById('terminal-root')! + + createRoot(terminal_root!).render(); + + const style = terminalWindow.document.createElement('style'); + style.innerHTML = ` + html, body { + width: 100%; + height: 100%; + margin: 0; + padding: 0; + overflow: hidden; + display: flex; + justify-content: center; + align-items: center; + } + `; + terminalWindow.document.head.appendChild(style); + + // Fit the terminal to the new window + terminal_root.style.width = '100%'; + terminal_root.style.height = '100%'; } }