1
0
mirror of https://github.com/bingohuang/docker-labs.git synced 2025-07-14 01:57:32 +08:00

Fix race conditions when initially resizing terminal

Race conditions could happen if the Terminal container did not have the correct size during initialization.

Signed-off-by: Antonis Kalipetis <akalipetis@gmail.com>
This commit is contained in:
Antonis Kalipetis 2016-11-18 12:48:49 +02:00
parent 5aa6f52292
commit 7628864058
No known key found for this signature in database
GPG Key ID: 15691170DA0396BB

View File

@ -204,9 +204,11 @@
});
term.open(terminalContainer);
term.fit();
$scope.resize(term.proposeGeometry());
// Set geometry during the next tick, to avoid race conditions.
setTimeout(function() {
$scope.resize(term.proposeGeometry());
}, 4);
term.on('data', function(d) {
$scope.socket.emit('terminal in', instance.name, d);