@volter/supercode-terminal 0.2.50 → 0.2.51

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volter/supercode-terminal",
3
- "version": "0.2.50",
3
+ "version": "0.2.51",
4
4
  "type": "module",
5
5
  "description": "Optional leak-safe terminal and tmux host adapter for Volter Harness frontends",
6
6
  "exports": {
package/substrate/tmux.js CHANGED
@@ -62,8 +62,13 @@ export async function createSession({ command, cwd, env, name, owner, ownerOptio
62
62
  const bootstrapDirectories = [];
63
63
  const paneBootstrapArgs = (pane) => {
64
64
  const commandArgs = command === undefined ? [] : [command.program, ...(command.arguments ?? [])];
65
- if (Object.keys(sessionEnv).length === 0)
66
- return commandArgs;
65
+ // With neither command nor overrides, retain tmux's default-shell and
66
+ // default-command behavior rather than choosing a shell for it.
67
+ if (command === undefined && Object.keys(sessionEnv).length === 0)
68
+ return [];
69
+ // The complete command rides the private bootstrap file as well as its
70
+ // environment. tmux's command message is bounded (roughly 16 KiB), much
71
+ // smaller than a native CLI's legal initial prompt.
67
72
  const directory = mkdtempSync(join(tmpdir(), "tmux-session-env-"));
68
73
  bootstrapDirectories.push(directory);
69
74
  const shell = process.env.SHELL ?? "/bin/sh";
@@ -408,10 +413,10 @@ function writeSessionEnvironmentBootstrap(directory, pane, environment, command)
408
413
  "set +a",
409
414
  'rm -f -- "$environment_path" "$0"',
410
415
  'rmdir -- "$(dirname -- "$0")" 2>/dev/null || true',
411
- 'exec "$@"',
416
+ `exec ${command.map(shellQuote).join(" ")}`,
412
417
  ""
413
418
  ].join("\n"), { flag: "wx", mode: 0o700 });
414
- return [wrapperPath, environmentPath, ...command];
419
+ return [wrapperPath, environmentPath];
415
420
  }
416
421
  function shellQuote(value) {
417
422
  return `'${value.replaceAll("'", `'"'"'`)}'`;