From 9cff3a7c100544a76283405c65b9000179d472e2 Mon Sep 17 00:00:00 2001 From: Lisa Milne Date: Sat, 11 Nov 2023 17:25:32 +1000 Subject: [PATCH] more playing with tty size pt2 --- clite/core.css | 2 +- clite/core.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/clite/core.css b/clite/core.css index 2e4ef02..3c0a253 100644 --- a/clite/core.css +++ b/clite/core.css @@ -6,7 +6,7 @@ header {padding:10px;} header h1 {line-height:40px; font-size:30px;} section {} section.content {position:relative; overflow:hidden;} -section.content div#terminal {width:100%; min-width: 500px; max-width:1000px; max-height:100%; margin:0 auto; overflow:hidden; overflow-y:auto; scrollbar-width:none;} +section.content div#terminal {width:100%; min-width: 500px; max-width:1000px; max-height:100%; font-size:14px; line-height:20px; margin:0 auto; overflow:hidden; overflow-y:auto; scrollbar-width:none;} section.content div#tty {width:100%; min-width: 500px; max-width:1000px; margin:0 auto; overflow:hidden; overflow-y:auto; scrollbar-width:none; z-index:99; background:#000000;} section.content article {unicode-bidi: embed; white-space: pre-wrap;} section.content form {display:flex;} diff --git a/clite/core.js b/clite/core.js index 5dfe3ee..77e9f75 100644 --- a/clite/core.js +++ b/clite/core.js @@ -913,8 +913,9 @@ clite.term = { var s = document.createElement('span'); s.innerText = 'W'; tty.data.el.appendChild(s); - // TODO: shouldn't need the 0.9 thing, but urgh + // 20 should not be hardcoded tty.lines = parseInt((tty.data.el.offsetHeight/20)-1); + // TODO: shouldn't need the 0.8 thing, but urgh tty.chars = parseInt((tty.data.el.offsetWidth/s.offsetWidth)*0.8); tty.data.el.removeChild(s); clite.events.refocus();