@xterm/addon-image 0.10.0-beta.268 → 0.10.0-beta.269
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/README.md +9 -9
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -90,7 +90,7 @@ terminal.loadAddon(imageAddon);
|
|
|
90
90
|
therefore palette animations cannot be used.
|
|
91
91
|
|
|
92
92
|
- **SIXEL Raster Attributes Handling**
|
|
93
|
-
If raster attributes were found in the SIXEL data (level 2), the image will always be truncated to the given height/width
|
|
93
|
+
If raster attributes were found in the SIXEL data (level 2), the image will always be truncated to the given height/width extent. We deviate here from the specification on purpose, as it allows several processing optimizations. For level 1 SIXEL data without any raster attributes the image can freely grow in width and height up to the last data byte, which has a much higher processing penalty. In general encoding libraries should not create level 1 data anymore and should not produce pixel information beyond the announced height/width extent. Both is discouraged by the >30 years old specification.
|
|
94
94
|
|
|
95
95
|
Currently the SIXEL implementation of the addon does not take custom pixel sizes into account, a SIXEL pixel will map 1:1 to a screen pixel.
|
|
96
96
|
|
|
@@ -149,9 +149,9 @@ The addon provides the following API endpoints to retrieve raw image data as can
|
|
|
149
149
|
|
|
150
150
|
### Memory Usage
|
|
151
151
|
|
|
152
|
-
The addon does most image processing in
|
|
153
|
-
-
|
|
154
|
-
`term.write` might
|
|
152
|
+
The addon does most image processing in JavaScript and therefore can occupy a rather big amount of memory. To get an idea where the memory gets eaten, let's look at the data flow and processing steps:
|
|
153
|
+
- Incoming image data chunk at `term.write` (terminal)
|
|
154
|
+
`term.write` might stack up incoming chunks. To circumvent this, you will need proper flow control (see xterm.js docs). Note that with image output it is more likely to run into this issue, as it can create lots of MBs in very short time.
|
|
155
155
|
- Sequence Parser (terminal)
|
|
156
156
|
The parser operates on a buffer containing up to 2^17 codepoints (~0.5 MB).
|
|
157
157
|
- Sequence Handler - Chunk Decoding (addon)
|
|
@@ -177,18 +177,18 @@ const totalActive = storageBytes + decodingBytes;
|
|
|
177
177
|
```
|
|
178
178
|
|
|
179
179
|
Note that browsers have offloading tricks for rarely touched memory segments, esp. `storageBytes` might not directly translate into real memory usage. Usage peaks will happen during active decoding of multiple big images due to the need of 2 full pixel buffers at the same time, which cannot be offloaded. Thus you may want to keep an eye on `pixelLimit` under limited memory conditions.
|
|
180
|
-
Further note that the formulas above do not respect the
|
|
180
|
+
Further note that the formulas above do not respect the JavaScript object's overhead. Compared to the raw buffer needs the bookkeeping by these objects is rather small (<<5%).
|
|
181
181
|
|
|
182
182
|
_Why should I care about memory usage at all?_
|
|
183
|
-
Well you don't have to, and it probably will just work fine with the addon defaults. But for bigger integrations, where much more data is held in the
|
|
183
|
+
Well you don't have to, and it probably will just work fine with the addon defaults. But for bigger integrations, where much more data is held in the JavaScript context (like multiple terminals on one page), it is likely to hit the engine's memory limit sooner or later under decoding and/or storage pressure.
|
|
184
184
|
|
|
185
185
|
_How can I adjust the memory usage?_
|
|
186
186
|
- `pixelLimit`
|
|
187
|
-
A constructor setting, thus you would have to anticipate, whether (multiple) terminals in your page gonna do lots of concurrent decoding. Since this is normally not the case and the memory usage
|
|
187
|
+
A constructor setting, thus you would have to anticipate, whether (multiple) terminals in your page gonna do lots of concurrent decoding. Since this is normally not the case and the memory usage only peaks temporarily, a rather high value should work even with multiple terminals in one page.
|
|
188
188
|
- `storageLimit`
|
|
189
|
-
A constructor and a runtime setting. In conjunction with `storageUsage` you can do runtime checks and adjust the limit to your needs. If you have to lower the limit below the current usage, images will be removed in FIFO order and may turn into a placeholder in the terminal's scrollback (if `showPlaceholder` is set). When adjusting keep in mind to leave enough room for memory
|
|
189
|
+
A constructor and a runtime setting. In conjunction with `storageUsage` you can do runtime checks and adjust the limit to your needs. If you have to lower the limit below the current usage, images will be removed in FIFO order and may turn into a placeholder in the terminal's scrollback (if `showPlaceholder` is set). When adjusting keep in mind to leave enough room for peak memory use during decoding.
|
|
190
190
|
- `sixelSizeLimit | iipSizeLimit | kittySizeLimit`
|
|
191
|
-
Constructor settings. This has only a small impact on
|
|
191
|
+
Constructor settings. This has only a small impact on peak memory during decoding. It is meant to avoid processing of overly big or broken image sequences at an earlier phase, thus may stop the invoked decoders from entering memory intensive tasks for potentially invalid data.
|
|
192
192
|
|
|
193
193
|
|
|
194
194
|
### Terminal Interaction
|
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.269",
|
|
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.4.1"
|
|
29
29
|
},
|
|
30
|
-
"commit": "
|
|
30
|
+
"commit": "0b6fd2e8b2ee5bdaf6607076f6fae3b2e4ea0d44",
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"@xterm/xterm": "^6.1.0-beta.
|
|
32
|
+
"@xterm/xterm": "^6.1.0-beta.269"
|
|
33
33
|
}
|
|
34
34
|
}
|