@@ -60,9 +60,8 @@ export class Terminal implements ITerminalApi {
6060 public get cols ( ) : number { return this . _core . cols ; }
6161 public get buffer ( ) : IBufferNamespaceApi {
6262 this . _checkProposedApi ( ) ;
63- this . _core . reset ( ) ;
6463 if ( ! this . _buffer ) {
65- this . _buffer = new BufferNamespaceApi ( this . _core . buffers ) ;
64+ this . _buffer = new BufferNamespaceApi ( this . _core ) ;
6665 }
6766 return this . _buffer ;
6867 }
@@ -251,21 +250,21 @@ class BufferNamespaceApi implements IBufferNamespaceApi {
251250 private _onBufferChange = new EventEmitter < IBufferApi > ( ) ;
252251 public get onBufferChange ( ) : IEvent < IBufferApi > { return this . _onBufferChange . event ; }
253252
254- constructor ( private _buffers : IBufferSet ) {
255- this . _normal = new BufferApiView ( this . _buffers . normal , 'normal' ) ;
256- this . _alternate = new BufferApiView ( this . _buffers . alt , 'alternate' ) ;
257- this . _buffers . onBufferActivate ( ( ) => this . _onBufferChange . fire ( this . active ) ) ;
253+ constructor ( private _core : ITerminal ) {
254+ this . _normal = new BufferApiView ( this . _core . buffers . normal , 'normal' ) ;
255+ this . _alternate = new BufferApiView ( this . _core . buffers . alt , 'alternate' ) ;
256+ this . _core . buffers . onBufferActivate ( ( ) => this . _onBufferChange . fire ( this . active ) ) ;
258257 }
259258 public get active ( ) : IBufferApi {
260- if ( this . _buffers . active === this . _buffers . normal ) { return this . normal ; }
261- if ( this . _buffers . active === this . _buffers . alt ) { return this . alternate ; }
259+ if ( this . _core . buffers . active === this . _core . buffers . normal ) { return this . normal ; }
260+ if ( this . _core . buffers . active === this . _core . buffers . alt ) { return this . alternate ; }
262261 throw new Error ( 'Active buffer is neither normal nor alternate' ) ;
263262 }
264263 public get normal ( ) : IBufferApi {
265- return this . _normal . init ( this . _buffers . normal ) ;
264+ return this . _normal . init ( this . _core . buffers . normal ) ;
266265 }
267266 public get alternate ( ) : IBufferApi {
268- return this . _alternate . init ( this . _buffers . alt ) ;
267+ return this . _alternate . init ( this . _core . buffers . alt ) ;
269268 }
270269}
271270
0 commit comments