mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-16 18:03:50 +00:00
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:
parent
df1d5c40ea
commit
fbd6b7f9ba
3 changed files with 26 additions and 22 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue