From a166ecc92c41f0a9a94cc8a401798aa790da6daa Mon Sep 17 00:00:00 2001 From: Simon Howe Date: Mon, 14 Dec 2015 17:27:38 +0100 Subject: [PATCH] Tidying up a little bit. --- client/app/scripts/components/terminal.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/client/app/scripts/components/terminal.js b/client/app/scripts/components/terminal.js index a9565491b..3594c4bc3 100644 --- a/client/app/scripts/components/terminal.js +++ b/client/app/scripts/components/terminal.js @@ -13,8 +13,8 @@ const wsProto = location.protocol === 'https:' ? 'wss' : 'ws'; const wsUrl = wsProto + '://' + location.host + basePath(location.pathname); const log = debug('scope:terminal'); -const DEFAULT_COLS = 1; -const DEFAULT_ROWS = 1; +const DEFAULT_COLS = 80; +const DEFAULT_ROWS = 24; // Unicode points can be used in html and document.title // html shorthand codes (×) don't work in document.title. const TIMES = '\u00D7'; @@ -28,10 +28,11 @@ function ab2str(buf) { function terminalCellSize(wrapperNode, rows, cols) { const height = wrapperNode.clientHeight; - const firstRow = wrapperNode.querySelector('.terminal div'); // Guess the width of the row. let width = wrapperNode.clientWidth; + // Now try and measure the first row we find. + const firstRow = wrapperNode.querySelector('.terminal div'); if (!firstRow) { log("ERROR: Couldn't find first row, resizing might not work very well."); } else {