more playing with tty size pt2

This commit is contained in:
Lisa Milne 2023-11-11 17:25:32 +10:00
parent ac0662b21c
commit 9cff3a7c10
2 changed files with 3 additions and 2 deletions

View file

@ -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;}

View file

@ -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();