diff --git a/notebook/static/terminal/js/main.js b/notebook/static/terminal/js/main.js index 838e6ffe8..e30f86b52 100644 --- a/notebook/static/terminal/js/main.js +++ b/notebook/static/terminal/js/main.js @@ -29,13 +29,6 @@ requirejs([ var common_config = new configmod.ConfigSection('common', common_options); common_config.load(); - var login_widget = new loginwidget.LoginWidget('span#login_widget', common_options); - - // Test size: 25x80 - // var termRowHeight = function(){ return 1.00 * $("#dummy-screen")[0].offsetHeight / 25;}; - // 1.02 here arrived at by trial and error to make the spacing look right - // var termColWidth = function() { return 1.02 * $("#dummy-screen-rows")[0].offsetWidth / 80;}; - var base_url = utils.get_body_data('baseUrl').replace(/\/?$/, '/'); var ws_path = utils.get_body_data('wsPath'); var ws_url = utils.get_body_data('wsUrl'); @@ -45,17 +38,6 @@ requirejs([ } ws_url = ws_url + base_url + ws_path; - // var header = $("#header")[0]; - - // function calculate_size() { - // var height = $(window).height() - header.offsetHeight; - // var width = $('#terminado-container').width(); - // var rows = Math.min(1000, Math.max(20, Math.floor(height/termRowHeight())-1))-7; - // var cols = Math.min(1000, Math.max(40, Math.floor(width/termColWidth())-1))-7; - // console.log("resize to :", rows , 'rows by ', cols, 'columns'); - // return {rows: rows, cols: cols}; - // } - page.show_header(); // var size = calculate_size(); @@ -68,10 +50,6 @@ requirejs([ window.onresize = function() { terminal.term.fit(); - // var geom = calculate_size(); - // terminal.term.resize(geom.cols, geom.rows); - // terminal.socket.send(JSON.stringify(["set_size", geom.rows, geom.cols, - // $(window).height(), $(window).width()])); }; // Expose terminal for fiddling with in the browser diff --git a/notebook/static/terminal/js/terminado.js b/notebook/static/terminal/js/terminado.js index b190f80d3..6da4fb4c7 100644 --- a/notebook/static/terminal/js/terminado.js +++ b/notebook/static/terminal/js/terminado.js @@ -2,14 +2,9 @@ define (["xterm", "xtermjs-fit"], function(Terminal, fit) { "use strict"; function make_terminal(element, ws_url) { var ws = new WebSocket(ws_url); - Terminal.applyAddon(fit); // Apply the `fit` addon - var term = new Terminal({ - // cols: size.cols, - // rows: size.rows - }); + Terminal.applyAddon(fit); + var term = new Terminal(); ws.onopen = function(event) { - // ws.send(JSON.stringify(["set_size", size.rows, size.cols, - // window.innerHeight, window.innerWidth])); term.on('data', function(data) { ws.send(JSON.stringify(['stdin', data])); }); diff --git a/notebook/static/terminal/less/terminal.less b/notebook/static/terminal/less/terminal.less index de893f6e4..167772847 100644 --- a/notebook/static/terminal/less/terminal.less +++ b/notebook/static/terminal/less/terminal.less @@ -15,12 +15,9 @@ padding: @code_padding; border-radius: @border-radius-base; .box-shadow(@global-shadow-dark); + line-height: 1em; + font-size: @notebook_font_size; - &, dummy-screen { - line-height: 1em; - font-size: @notebook_font_size; - } - .xterm-rows { padding: 10px; }