Skip to content

Commit

Permalink
Move terminalReady event higher
Browse files Browse the repository at this point in the history
  • Loading branch information
yury committed Oct 29, 2019
1 parent be9e4d0 commit 7b2551e
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions Resources/term.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,26 +92,32 @@ function term_setup() {
t.onTerminalReady = function() {
term_setAutoCarriageReturn(true);
t.setCursorVisible(true);
t.setAccessibilityEnabled(true);

t.io.onTerminalResize = function(cols, rows) {
_postMessage('sigwinch', {cols, rows});
t.prompt.resize();
if (t.prompt) {
t.prompt.resize();
}
};

var size = {
cols: t.screenSize.width,
rows: t.screenSize.height,
};

document.body.style.backgroundColor =
t.scrollPort_.screen_.style.backgroundColor;
var bgColor = _colorComponents(t.scrollPort_.screen_.style.backgroundColor);

_postMessage('terminalReady', {size, bgColor});

t.keyboard.characterEncoding = 'raw'; // we are UTF8. Fix for #507
t.uninstallKeyboard();
window.KeystrokeVisualizer.enable();

_postMessage('terminalReady', {size, bgColor});

if (window.KeystrokeVisualizer) {
window.KeystrokeVisualizer.enable();
}
t.setAccessibilityEnabled(true);
};

t.decorate(document.getElementById('terminal'));
Expand Down

0 comments on commit 7b2551e

Please sign in to comment.