@@ -11,6 +11,7 @@ import { FitAddon } from 'xterm-addon-fit';
1111import { WebLinksAddon } from 'xterm-addon-web-links' ;
1212import { WebglAddon } from 'xterm-addon-webgl' ;
1313import 'xterm/css/xterm.css' ;
14+ import '../../common/scrollbar.scss' ;
1415
1516/**
1617 * Represents a tab in the terminal view. Wraps an instance of xtermjs.
@@ -37,6 +38,8 @@ export const TerminalInstance = (props: {
3738 return newTerm ;
3839 } ) ;
3940
41+ let resizeTimeout : NodeJS . Timeout = undefined ;
42+
4043 const setXtermjsTheme = ( fontFamily : string , fontSize : number ) => {
4144 const computedStyle = window . getComputedStyle ( document . body ) ;
4245 const xtermjsTheme : ITheme = {
@@ -162,7 +165,7 @@ export const TerminalInstance = (props: {
162165 } ;
163166 } , [ ] ) ;
164167
165- const handleResize = function ( _e : UIEvent ) {
168+ const performResize = function ( ) {
166169 const dims = fitAddon . proposeDimensions ( ) ;
167170 window . vscodeApi . postMessage ( {
168171 kind : 'resize' ,
@@ -172,6 +175,13 @@ export const TerminalInstance = (props: {
172175 } ,
173176 } ) ;
174177 fitAddon . fit ( ) ;
178+ }
179+
180+ const handleResize = function ( _e : UIEvent ) {
181+ if ( resizeTimeout ) {
182+ clearTimeout ( resizeTimeout ) ;
183+ }
184+ resizeTimeout = setTimeout ( performResize , 200 ) ;
175185 } ;
176186
177187 // resize the terminal when the window is resized
@@ -186,7 +196,7 @@ export const TerminalInstance = (props: {
186196 < Box marginY = "8px" marginX = "16px" width = "100%" height = "100%" overflow = 'scroll' >
187197 < div
188198 { ...{ name : 'terminal-instance' } }
189- style = { { width : '100%' , height : '100%' , display : 'flex' , flexFlow : 'column' } }
199+ style = { { width : '100%' , height : '100%' , display : 'flex' , flexFlow : 'column' , overflow : 'hidden' } }
190200 ref = { termRef }
191201 > </ div >
192202 </ Box >
0 commit comments