Skip to content

fix(terminal): configure ImageAddon with memory-safe defaults#4367

Merged
gregpriday merged 2 commits intodevelopfrom
feature/issue-4363-configure-imageaddon-memory
Mar 28, 2026
Merged

fix(terminal): configure ImageAddon with memory-safe defaults#4367
gregpriday merged 2 commits intodevelopfrom
feature/issue-4363-configure-imageaddon-memory

Conversation

@gregpriday
Copy link
Copy Markdown
Collaborator

Summary

  • ImageAddon was being instantiated with bare new ImageAddon() at both the initial setup and unhibernate callsites, leaving the defaults at 128 MB storage and 16M pixel limit per terminal
  • Configured both callsites with conservative values: pixelLimit: 2_000_000 and storageLimit: 8 (MB), capping per-terminal image cache at 8 MB
  • Added unit tests covering both default and custom configurations

Resolves #4363

Changes

  • src/services/terminal/TerminalAddonManager.ts — pass memory-safe options to ImageAddon in setupTerminalAddons and createImageAddon
  • src/services/terminal/__tests__/TerminalAddonManager.test.ts — new test file verifying addon configuration

Testing

Unit tests added and passing. The fix applies to both terminal creation and post-hibernation restore paths.

- Add IMAGE_ADDON_OPTIONS constant with pixelLimit: 2_000_000 and storageLimit: 8
- Apply to both setupTerminalAddons and createImageAddon callsites
- Add unit tests asserting constructor receives memory-safe options
- Run prettier on TerminalAddonManager.test.ts
@gregpriday gregpriday force-pushed the feature/issue-4363-configure-imageaddon-memory branch from c516be6 to 24020fc Compare March 28, 2026 00:50
@gregpriday gregpriday merged commit 478c3a7 into develop Mar 28, 2026
4 checks passed
@gregpriday gregpriday deleted the feature/issue-4363-configure-imageaddon-memory branch March 28, 2026 00:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Configure ImageAddon with memory-safe defaults

1 participant