@@ -8,7 +8,6 @@ import { ImageRenderer } from './ImageRenderer';
8
8
import { ImageStorage , CELL_SIZE_DEFAULT } from './ImageStorage' ;
9
9
import { SixelHandler } from './SixelHandler' ;
10
10
import { ITerminalExt , IImageAddonOptions , IResetHandler } from './Types' ;
11
- import { WorkerManager } from './WorkerManager' ;
12
11
13
12
14
13
// default values of addon ctor options
@@ -53,14 +52,11 @@ export class ImageAddon implements ITerminalAddon {
53
52
private _renderer : ImageRenderer | undefined ;
54
53
private _disposables : IDisposable [ ] = [ ] ;
55
54
private _terminal : ITerminalExt | undefined ;
56
- private _workerManager : WorkerManager ;
57
55
private _handlers : Map < String , IResetHandler > = new Map ( ) ;
58
56
59
57
constructor ( workerPath : string , opts : Partial < IImageAddonOptions > ) {
60
58
this . _opts = Object . assign ( { } , DEFAULT_OPTIONS , opts ) ;
61
59
this . _defaultOpts = Object . assign ( { } , DEFAULT_OPTIONS , opts ) ;
62
- this . _workerManager = new WorkerManager ( workerPath , this . _opts ) ;
63
- this . _disposeLater ( this . _workerManager ) ;
64
60
}
65
61
66
62
public dispose ( ) : void {
@@ -130,7 +126,7 @@ export class ImageAddon implements ITerminalAddon {
130
126
131
127
// SIXEL handler
132
128
if ( this . _opts . sixelSupport ) {
133
- const sixelHandler = new SixelHandler ( this . _opts , this . _storage , terminal , this . _workerManager ) ;
129
+ const sixelHandler = new SixelHandler ( this . _opts , this . _storage ! , terminal ) ;
134
130
this . _handlers . set ( 'sixel' , sixelHandler ) ;
135
131
this . _disposeLater (
136
132
terminal . _core . _inputHandler . _parser . registerDcsHandler ( { final : 'q' } , sixelHandler )
@@ -145,10 +141,9 @@ export class ImageAddon implements ITerminalAddon {
145
141
this . _opts . sixelPaletteLimit = this . _defaultOpts . sixelPaletteLimit ;
146
142
// also clear image storage
147
143
this . _storage ?. reset ( ) ;
148
- // reset worker and protocol handlers
149
- this . _workerManager . reset ( ) ;
150
- for ( const value of this . _handlers . values ( ) ) {
151
- value . reset ( ) ;
144
+ // reset protocol handlers
145
+ for ( const handler of this . _handlers . values ( ) ) {
146
+ handler . reset ( ) ;
152
147
}
153
148
return false ;
154
149
}
@@ -222,7 +217,7 @@ export class ImageAddon implements ITerminalAddon {
222
217
// 4 - SIXEL support
223
218
// 9 - charsets
224
219
// 22 - ANSI colors
225
- if ( this . _opts . sixelSupport && ! this . _workerManager . failed ) {
220
+ if ( this . _opts . sixelSupport ) {
226
221
this . _report ( `\x1b[?62;4;9;22c` ) ;
227
222
return true ;
228
223
}
@@ -243,11 +238,6 @@ export class ImageAddon implements ITerminalAddon {
243
238
if ( params . length < 2 ) {
244
239
return true ;
245
240
}
246
- if ( this . _workerManager . failed ) {
247
- // on worker error report graphics caps as not supported
248
- this . _report ( `\x1b[?${ params [ 0 ] } ;${ GaStatus . ITEM_ERROR } S` ) ;
249
- return true ;
250
- }
251
241
if ( params [ 0 ] === GaItem . COLORS ) {
252
242
switch ( params [ 1 ] ) {
253
243
case GaAction . READ :
@@ -256,8 +246,10 @@ export class ImageAddon implements ITerminalAddon {
256
246
case GaAction . SET_DEFAULT :
257
247
this . _opts . sixelPaletteLimit = this . _defaultOpts . sixelPaletteLimit ;
258
248
this . _report ( `\x1b[?${ params [ 0 ] } ;${ GaStatus . SUCCESS } ;${ this . _opts . sixelPaletteLimit } S` ) ;
259
- // also reset default palette colors for now
260
- this . _workerManager . reset ( ) ;
249
+ // also reset protocol handlers for now
250
+ for ( const handler of this . _handlers . values ( ) ) {
251
+ handler . reset ( ) ;
252
+ }
261
253
return true ;
262
254
case GaAction . SET :
263
255
if ( params . length > 2 && ! ( params [ 2 ] instanceof Array ) && params [ 2 ] <= MAX_SIXEL_PALETTE_SIZE ) {
0 commit comments