fix(tui): prevent image ID collisions between modules
- allocateImageId() now returns random IDs instead of sequential - Static images no longer auto-allocate IDs (transient display) - Only explicit imageId usage (like DOSBox) gets tracked IDs - Suppress emulators exit logging in DOSBox dispose Fixes image replacement bug when extension and main app both allocated sequential IDs starting at 1.
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import {
|
||||
deleteKittyImage,
|
||||
getCapabilities,
|
||||
getImageDimensions,
|
||||
type ImageDimensions,
|
||||
@@ -102,15 +101,4 @@ export class Image implements Component {
|
||||
|
||||
return lines;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete the terminal image. Call this when done with the image
|
||||
* to free terminal resources.
|
||||
*/
|
||||
dispose(): void {
|
||||
if (this.imageId !== undefined) {
|
||||
process.stdout.write(deleteKittyImage(this.imageId));
|
||||
this.imageId = undefined;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user