@xterm/addon-image 0.10.0-beta.210 → 0.10.0-beta.212
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/addon-image.js +1 -1
- package/lib/addon-image.js.map +1 -1
- package/lib/addon-image.mjs +1 -1
- package/lib/addon-image.mjs.map +2 -2
- package/package.json +3 -3
- package/src/ImageAddon.ts +46 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xterm/addon-image",
|
|
3
|
-
"version": "0.10.0-beta.
|
|
3
|
+
"version": "0.10.0-beta.212",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "The xterm.js authors",
|
|
6
6
|
"url": "https://xtermjs.org/"
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"sixel": "^0.16.0",
|
|
28
28
|
"xterm-wasm-parts": "^0.3.0"
|
|
29
29
|
},
|
|
30
|
-
"commit": "
|
|
30
|
+
"commit": "874e767b4022a85d9bd7f8d9780f0812efe49fb6",
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"@xterm/xterm": "^6.1.0-beta.
|
|
32
|
+
"@xterm/xterm": "^6.1.0-beta.212"
|
|
33
33
|
}
|
|
34
34
|
}
|
package/src/ImageAddon.ts
CHANGED
|
@@ -16,20 +16,61 @@ import { SixelImageStorage } from './SixelImageStorage';
|
|
|
16
16
|
import { IIPImageStorage } from './IIPImageStorage';
|
|
17
17
|
import { ITerminalExt, IImageAddonOptions, IResetHandler } from './Types';
|
|
18
18
|
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Document VT features provided by this addon.
|
|
22
|
+
*
|
|
23
|
+
* @vt: #E[Supported via @xterm/addon-image.] DCS SIXEL "SIXEL Graphics" "DCS Ps ; Ps ; Ps ; q Pt ST" "Draw SIXEL image."
|
|
24
|
+
*
|
|
25
|
+
* Sixel support is provided by the addon @xterm/addon-image with these limitations:
|
|
26
|
+
* - immediate coloring (no shared palette, allows high color settings of `img2sixel`)
|
|
27
|
+
* - max. palette size of 4096 colors
|
|
28
|
+
* - max. pixel width of 16K
|
|
29
|
+
* - max. 25 MB per sixel sequence
|
|
30
|
+
* - VT340 cursor positioning (begin of last sixel data row)
|
|
31
|
+
*
|
|
32
|
+
* See [addon readme](https://github.com/xtermjs/xterm.js/tree/master/addons/addon-image) for more details.
|
|
33
|
+
*
|
|
34
|
+
*
|
|
35
|
+
* @vt: #E[Supported via @xterm/addon-image.] OSC 1337 "iTerm2 Commands" "OSC 1337 ; Pt BEL" "Custom iTerm2 commands."
|
|
36
|
+
*
|
|
37
|
+
* Only the inline image protocol (IIP) is supported by the addon @xterm/addon-image with
|
|
38
|
+
* the following limitations:
|
|
39
|
+
* - sequence:
|
|
40
|
+
* - format: `OSC 1337 ; File=inline=1 ; size=<unencoded size> ; ... : <base64 payload> BEL`
|
|
41
|
+
* - size param must be set and payload may not exceed CEIL(size * 4 / 3)
|
|
42
|
+
* - strict base64 handling as of RFC4648 §4 (standard alphabet, optional padding,
|
|
43
|
+
* no separator bytes allowed)
|
|
44
|
+
* - supported params: size, name, width, height, preserveAspectRatio
|
|
45
|
+
* - image formats: PNG, JPEG and GIF
|
|
46
|
+
* - no animation support (renders first image of a GIF)
|
|
47
|
+
* - no multipart support
|
|
48
|
+
* - VT340 cursor positioning (begin of last sixel data row)
|
|
49
|
+
*
|
|
50
|
+
* See [addon readme](https://github.com/xtermjs/xterm.js/tree/master/addons/addon-image)
|
|
51
|
+
* and [iTerm2 IIP docs](https://iterm2.com/documentation-images.html) for more details.
|
|
52
|
+
*
|
|
53
|
+
*
|
|
54
|
+
* @vt: #E[Supported via @xterm/addon-image.] APC KITTY_GRAPHICS "Kitty Graphics" "APC G Pt ST" "Kitty Graphics Protocol."
|
|
55
|
+
*
|
|
56
|
+
* Kitty graphics support is provided by the addon @xterm/addon-image.
|
|
57
|
+
* Note that while basic image output already works, this is still work in progress.
|
|
58
|
+
*/
|
|
59
|
+
|
|
19
60
|
// default values of addon ctor options
|
|
20
61
|
const DEFAULT_OPTIONS: IImageAddonOptions = {
|
|
21
62
|
enableSizeReports: true,
|
|
22
63
|
pixelLimit: 16777216, // limit to 4096 * 4096 pixels
|
|
23
64
|
sixelSupport: true,
|
|
24
65
|
sixelScrolling: true,
|
|
25
|
-
sixelPaletteLimit:
|
|
26
|
-
sixelSizeLimit:
|
|
66
|
+
sixelPaletteLimit: 4096,
|
|
67
|
+
sixelSizeLimit: 33554432,
|
|
27
68
|
storageLimit: 128,
|
|
28
69
|
showPlaceholder: true,
|
|
29
70
|
iipSupport: true,
|
|
30
|
-
iipSizeLimit:
|
|
71
|
+
iipSizeLimit: 33554432,
|
|
31
72
|
kittySupport: true,
|
|
32
|
-
kittySizeLimit:
|
|
73
|
+
kittySizeLimit: 33554432
|
|
33
74
|
};
|
|
34
75
|
|
|
35
76
|
// max palette size supported by the sixel lib (compile time setting)
|
|
@@ -166,7 +207,7 @@ export class ImageAddon implements ITerminalAddon, IImageApi {
|
|
|
166
207
|
this._disposeLater(
|
|
167
208
|
kittyStorage,
|
|
168
209
|
kittyHandler,
|
|
169
|
-
terminal._core._inputHandler._parser.registerApcHandler(
|
|
210
|
+
terminal._core._inputHandler._parser.registerApcHandler({ final: 'G' }, kittyHandler)
|
|
170
211
|
);
|
|
171
212
|
}
|
|
172
213
|
}
|