]> git.proxmox.com Git - mirror_xterm.js.git/blobdiff - src/Viewport.ts
Merge pull request #746 from Tyriar/745_colon_word_sep
[mirror_xterm.js.git] / src / Viewport.ts
index aaafbc5f9726d6a415777508303870632f610a7e..82f748eada09d43584f843e85260f24ff7484930 100644 (file)
@@ -35,7 +35,8 @@ export class Viewport {
     this.terminal.on('resize', this.syncScrollArea.bind(this));
     this.viewportElement.addEventListener('scroll', this.onScroll.bind(this));
 
-    this.syncScrollArea();
+    // Perform this async to ensure the CharMeasure is ready.
+    setTimeout(() => this.syncScrollArea(), 0);
   }
 
   /**
@@ -56,6 +57,7 @@ export class Viewport {
       if (rowHeightChanged || viewportHeightChanged) {
         this.lastRecordedViewportHeight = this.terminal.rows;
         this.viewportElement.style.height = this.charMeasure.height * this.terminal.rows + 'px';
+        this.terminal.selectionContainer.style.height = this.viewportElement.style.height;
       }
       this.scrollArea.style.height = (this.charMeasure.height * this.lastRecordedBufferLength) + 'px';
     }