@@ -178,12 +178,6 @@ export default class InkTerminal extends PaneItem {
178
178
this . ty = ty
179
179
180
180
this . onData = this . terminal . onData ( data => this . ty . write ( data ) )
181
- this . onResize = this . terminal . onResize ( size => {
182
- if ( this . ty && this . ty . resize ) {
183
- this . ty . resize ( size . cols , size . rows )
184
- }
185
- } )
186
-
187
181
this . ty . on ( 'data' , data => this . terminal . write ( data . toString ( ) ) )
188
182
189
183
if ( this . element . parentElement ) {
@@ -199,10 +193,6 @@ export default class InkTerminal extends PaneItem {
199
193
this . onData . dispose ( )
200
194
this . onData = undefined
201
195
}
202
- if ( this . onResize != undefined ) {
203
- this . onResize . dispose ( )
204
- this . onResize = undefined
205
- }
206
196
207
197
if ( keepTy ) this . ty . destroy ( )
208
198
@@ -219,11 +209,14 @@ export default class InkTerminal extends PaneItem {
219
209
}
220
210
221
211
resize ( ) {
222
- const { cols, rows} = this . fitAddon . proposeDimensions ( )
223
- // resize twice with different sizes to actually force a resize:
212
+ let { cols, rows} = this . fitAddon . proposeDimensions ( )
213
+ // slightly narrower terminal looks better:
214
+ cols -= 1
224
215
if ( this . terminal && ! isNaN ( cols ) && ! isNaN ( rows ) ) {
225
- this . terminal . resize ( cols - 2 , rows )
226
- this . terminal . resize ( cols - 1 , rows )
216
+ this . terminal . resize ( cols , rows )
217
+ if ( this . ty && this . ty . resize ) {
218
+ this . ty . resize ( cols , rows )
219
+ }
227
220
}
228
221
}
229
222
0 commit comments