storymode-cli 1.3.7 → 1.3.8

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/player.mjs +11 -12
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "storymode-cli",
3
- "version": "1.3.7",
3
+ "version": "1.3.8",
4
4
  "description": "Play AI-animated pixel art characters in your terminal",
5
5
  "type": "module",
6
6
  "bin": {
package/src/player.mjs CHANGED
@@ -439,19 +439,18 @@ export async function playReactiveCompanion(animMap, opts = {}) {
439
439
  const delSeq = `\x1b_Ga=d,d=a\x1b\\`;
440
440
  stdout.write(hdInTmux ? wrapForTmux(delSeq) : delSeq);
441
441
  writeKitty(currentPngFrames[idx], null, imageRows || undefined, hdInTmux);
442
- } else {
443
- // iTerm2: clear to release previous images from memory
444
- stdout.write(fullscreen ? '\x1b[2J\x1b[H' : '\x1b8');
445
- if (!fullscreen) {
446
- // Clear the image area to release old images
447
- for (let i = 0; i < maxLines; i++) stdout.write('\x1b[K\n');
448
- stdout.write(fullscreen ? '\x1b[H' : '\x1b8');
442
+ // Kitty needs explicit cursor positioning after image
443
+ if (imageRows > 0) {
444
+ stdout.write(`\x1b[${imageRows + 1};1H`);
449
445
  }
450
- writeIterm2(currentPngFrames[idx], null, imageRows || undefined, hdInTmux);
451
- }
452
- // Move cursor below the image area for text rendering
453
- if (imageRows > 0) {
454
- stdout.write(`\x1b[${imageRows}B`);
446
+ } else {
447
+ // iTerm2: clear screen to release previous inline images from memory,
448
+ // then render new image. Cursor advances past the image automatically.
449
+ stdout.write('\x1b[2J\x1b[H');
450
+ // Use width=pane columns, let preserveAspectRatio size the height
451
+ const paneCols = process.stdout.columns || 80;
452
+ writeIterm2(currentPngFrames[idx], paneCols, null, hdInTmux);
453
+ stdout.write('\n'); // ensure cursor is on next line after image
455
454
  }
456
455
  } else {
457
456
  // --- ANSI fallback path ---