Skip to content

Commit 45e3296

Browse files
committed
Fixed Safari terminal window height bug #1986
1 parent 5cb3a00 commit 45e3296

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

client/app/scripts/components/terminal.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,9 @@ class Terminal extends React.Component {
271271
const innerNode = ReactDOM.findDOMNode(this.innerFlex);
272272
// scrollbar === 16px
273273
const width = innerNode.clientWidth - (2 * 8) - 16;
274-
const height = innerNode.clientHeight - (2 * 8);
274+
// #1986 Safari doesn't calculate clientHeight like Chrome.
275+
// Use the parent's height and pad the bottom with 50px;
276+
const height = innerNode.offsetParent.clientHeight - (2 * 8) - 50;
275277
const cols = Math.floor(width / this.state.characterWidth);
276278
const rows = Math.floor(height / this.state.characterHeight);
277279

client/app/styles/main.less

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,7 @@ h2 {
992992
// overflow hiddened.
993993
padding: 10px 0 10px 10px;
994994
flex: 1;
995-
overflow-x: hidden;
995+
overflow: hidden;
996996
}
997997

998998
&-animation-wrapper {
@@ -1007,6 +1007,7 @@ h2 {
10071007
height: 100%;
10081008
border: 0px solid #000000;
10091009
color: #f0f0f0;
1010+
background-color: #000000;
10101011
}
10111012

10121013
&-header {
@@ -1059,13 +1060,14 @@ h2 {
10591060
&-inner {
10601061
cursor: text;
10611062
font-family: @mono-font;
1062-
position: absolute;
10631063
bottom: 0;
10641064
left: 0;
10651065
right: 0;
10661066
background-color: rgba(0, 0, 0, 0.93);
10671067
padding: 8px;
10681068
border-radius: 0 0 0 4px;
1069+
//Fix for 1968. Chrome wasn't respecting this overflow rule, but Safari was.
1070+
overflow: visible !important;
10691071

10701072
.terminal {
10711073
background-color: transparent !important;

0 commit comments

Comments
 (0)