storymode-cli 1.3.6 → 1.3.7

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/cli.mjs +7 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "storymode-cli",
3
- "version": "1.3.6",
3
+ "version": "1.3.7",
4
4
  "description": "Play AI-animated pixel art characters in your terminal",
5
5
  "type": "module",
6
6
  "bin": {
package/src/cli.mjs CHANGED
@@ -253,16 +253,18 @@ export async function run(args) {
253
253
  // iTerm2 (not in tmux): use native split to keep HD working.
254
254
  // iTerm2 inline images can't be cleared through tmux passthrough,
255
255
  // so we avoid tmux entirely and use AppleScript to split the pane.
256
+ // Use "write text" instead of "command" — the latter uses execve directly
257
+ // (no shell, no PATH, no env vars). "write text" types into the new
258
+ // pane's shell, which inherits everything.
256
259
  if (renderMode.protocol === 'iterm2' && !renderMode.inTmux) {
257
260
  try {
258
- // Wrap in bash -c: iTerm2's "command" uses execve directly (no shell),
259
- // so env vars and || operators won't work without an explicit shell.
260
- const wrappedCmd = `bash -c '${companionCmd} || { echo; echo " Companion crashed. Press enter to close."; read; }'`;
261
- const escapedCmd = wrappedCmd.replace(/"/g, '\\"');
262
261
  execSync(`osascript -e '
263
262
  tell application "iTerm2"
264
263
  tell current session of current tab of current window
265
- set newSession to split vertically with default profile command "${escapedCmd}"
264
+ set newSession to split vertically with default profile
265
+ tell newSession
266
+ write text "${companionCmd.replace(/"/g, '\\"')}"
267
+ end tell
266
268
  end tell
267
269
  end tell
268
270
  '`, { stdio: 'ignore' });