fix(terminal) rows and cols

This commit is contained in:
coderaiser 2018-04-19 18:25:08 +03:00
parent 05af6770b2
commit 9fe2bdee0a
3 changed files with 8 additions and 7 deletions

View file

@ -2,6 +2,8 @@
/* global CloudCmd, gritty */ /* global CloudCmd, gritty */
require('../../css/terminal.css');
const exec = require('execon'); const exec = require('execon');
const load = require('../dom/load'); const load = require('../dom/load');
const DOM = require('../dom'); const DOM = require('../dom');
@ -46,7 +48,6 @@ function TerminalProto() {
} }
module.exports.show = show; module.exports.show = show;
module.exports.hide = hide; module.exports.hide = hide;
function hide () { function hide () {
@ -75,8 +76,6 @@ function create(callback) {
const {socket, terminal} = gritty(Element, options); const {socket, terminal} = gritty(Element, options);
terminal.focus();
Terminal = terminal; Terminal = terminal;
terminal.on('key', (char, {keyCode, shiftKey}) => { terminal.on('key', (char, {keyCode, shiftKey}) => {
@ -86,7 +85,6 @@ function create(callback) {
}); });
socket.on('connect', exec.with(authCheck, socket)); socket.on('connect', exec.with(authCheck, socket));
exec(callback); exec(callback);
} }
@ -104,10 +102,8 @@ function show(callback) {
CloudCmd.View.show(Element, { CloudCmd.View.show(Element, {
afterShow: () => { afterShow: () => {
if (Terminal) { if (Terminal)
Terminal.fit(); // lines corrupt without
Terminal.focus(); Terminal.focus();
}
exec(callback); exec(callback);
} }

View file

@ -5,4 +5,5 @@
@import './help.css'; @import './help.css';
@import './query.css'; @import './query.css';
@import './supports.css'; @import './supports.css';
@import './terminal.css';

4
css/terminal.css Normal file
View file

@ -0,0 +1,4 @@
.terminal {
height: 100%;
}