mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-24 09:16:29 +00:00
Load @xterm/addon-image in the shared xterm runtime so remote programs can draw real raster images (kitten icat, chafa --format kitty, image previews in file managers and TUIs) instead of ANSI approximations. - domain/terminalInlineImages.ts owns the limits and turns TerminalSettings into addon options; disabled settings resolve to null so the addon is not loaded at all and the terminal keeps advertising no graphics capability. - The addon is loaded right after term.open, before the WebGL renderer, so it patches IRenderService.setRenderer first and its canvas layers survive every DOM <-> WebGL swap (deferred WebGL, soft-hide suspend, context-loss rebuild). It is disposed before term.dispose so bitmaps never outlive their terminal. - Hibernate restores a tab from a text-only snapshot, which cannot carry image data. XTermRuntime.hasInlineImages reads the live image cache, and Terminal degrades such a session to soft-hide: hibernateRuntime takes the soft-hide branch, canFinishHibernate re-checks after every async step, and an eviction request leaves the session soft-hidden. The block lifts by itself once the cache is emptied by a terminal reset or FIFO eviction. - Settings > Terminal > Inline Images exposes the master switch, per-protocol switches (Kitty / SIXEL / iTerm IIP) and the memory limits, translated for en, zh-CN, zh-TW and ru. Protocol switches cloud-sync; the memory limits stay local like the other per-device renderer tuning. Co-authored-by: Wine Fox <fox@ling.plus>