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:
parent
5aa6f52292
commit
7628864058
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user