Skip to content
This repository was archived by the owner on Oct 22, 2021. It is now read-only.

Commit bb25313

Browse files
committed
🐛 Fix #302
1 parent f85334c commit bb25313

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/classes/terminal.class.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,23 @@ class Terminal {
161161

162162
this.fit = () => {
163163
this.term.fit();
164+
165+
// Apply custom fixes based on screen ratio, see #302
166+
let w = screen.width;
167+
let h = screen.height;
168+
let x = 1;
169+
let y = 0;
170+
171+
function gcd(a, b) {
172+
return (b == 0) ? a : gcd(b, a%b);
173+
}
174+
let d = gcd(w, h);
175+
let ratio = `${w/d}:${h/d}`;
176+
177+
if (ratio === "16:9") y = 1;
178+
164179
setTimeout(() => {
165-
this.resize(this.term.cols+1, this.term.rows+1);
180+
this.resize(this.term.cols+x, this.term.rows+y);
166181
}, 50);
167182
};
168183

0 commit comments

Comments
 (0)