diff --git a/cli/package.json b/cli/package.json index 2a0014a3..e381f009 100644 --- a/cli/package.json +++ b/cli/package.json @@ -1,6 +1,6 @@ { "name": "@openrouter/spawn", - "version": "0.6.14", + "version": "0.6.15", "type": "module", "bin": { "spawn": "cli.js" diff --git a/cli/src/aws/aws.ts b/cli/src/aws/aws.ts index c7f6a243..83277056 100644 --- a/cli/src/aws/aws.ts +++ b/cli/src/aws/aws.ts @@ -745,7 +745,8 @@ export async function uploadFile(localPath: string, remotePath: string): Promise } export async function interactiveSession(cmd: string): Promise { - const fullCmd = `export PATH="$HOME/.npm-global/bin:$HOME/.claude/local/bin:$HOME/.local/bin:$HOME/.bun/bin:$PATH" && ${cmd}`; + const term = process.env.TERM || "xterm-256color"; + const fullCmd = `export TERM=${term} PATH="$HOME/.npm-global/bin:$HOME/.claude/local/bin:$HOME/.local/bin:$HOME/.bun/bin:$PATH" && exec bash -l -c ${JSON.stringify(cmd)}`; const escapedCmd = fullCmd.replace(/'/g, "'\\''"); const proc = Bun.spawn( ["ssh", ...SSH_OPTS, "-t", `${SSH_USER}@${instanceIp}`, `bash -c '${escapedCmd}'`], diff --git a/cli/src/daytona/daytona.ts b/cli/src/daytona/daytona.ts index a3dc2f18..edfed4eb 100644 --- a/cli/src/daytona/daytona.ts +++ b/cli/src/daytona/daytona.ts @@ -423,7 +423,8 @@ export async function uploadFile( } export async function interactiveSession(cmd: string): Promise { - const fullCmd = `export PATH="$HOME/.local/bin:$HOME/.bun/bin:$PATH" && ${cmd}`; + const term = process.env.TERM || "xterm-256color"; + const fullCmd = `export TERM=${term} PATH="$HOME/.local/bin:$HOME/.bun/bin:$PATH" && exec bash -l -c ${JSON.stringify(cmd)}`; // Interactive mode — drop BatchMode so the PTY works const args = [ diff --git a/cli/src/digitalocean/digitalocean.ts b/cli/src/digitalocean/digitalocean.ts index 034a8ef8..55907c08 100644 --- a/cli/src/digitalocean/digitalocean.ts +++ b/cli/src/digitalocean/digitalocean.ts @@ -884,7 +884,8 @@ export async function interactiveSession( ip?: string, ): Promise { const serverIp = ip || doServerIp; - const fullCmd = `export PATH="$HOME/.local/bin:$HOME/.bun/bin:$PATH" && ${cmd}`; + const term = process.env.TERM || "xterm-256color"; + const fullCmd = `export TERM=${term} PATH="$HOME/.local/bin:$HOME/.bun/bin:$PATH" && exec bash -l -c ${JSON.stringify(cmd)}`; const proc = Bun.spawn( ["ssh", ...SSH_OPTS, "-t", `root@${serverIp}`, fullCmd], diff --git a/cli/src/fly/fly.ts b/cli/src/fly/fly.ts index 82f94610..847d31a3 100644 --- a/cli/src/fly/fly.ts +++ b/cli/src/fly/fly.ts @@ -795,7 +795,8 @@ export async function uploadFile( } export async function interactiveSession(cmd: string): Promise { - const fullCmd = `export PATH="$HOME/.local/bin:$HOME/.bun/bin:$PATH" && ${cmd}`; + const term = process.env.TERM || "xterm-256color"; + const fullCmd = `export TERM=${term} PATH="$HOME/.local/bin:$HOME/.bun/bin:$PATH" && exec bash -l -c ${JSON.stringify(cmd)}`; // Shell-quote the command for -C const escapedCmd = fullCmd.replace(/'/g, "'\\''"); const flyCmd = getCmd()!; diff --git a/cli/src/gcp/gcp.ts b/cli/src/gcp/gcp.ts index 5cafe60d..de6170af 100644 --- a/cli/src/gcp/gcp.ts +++ b/cli/src/gcp/gcp.ts @@ -651,7 +651,8 @@ export async function uploadFile(localPath: string, remotePath: string): Promise export async function interactiveSession(cmd: string): Promise { const username = resolveUsername(); - const fullCmd = `export PATH="$HOME/.npm-global/bin:$HOME/.claude/local/bin:$HOME/.local/bin:$HOME/.bun/bin:$PATH" && ${cmd}`; + const term = process.env.TERM || "xterm-256color"; + const fullCmd = `export TERM=${term} PATH="$HOME/.npm-global/bin:$HOME/.claude/local/bin:$HOME/.local/bin:$HOME/.bun/bin:$PATH" && exec bash -l -c ${JSON.stringify(cmd)}`; const proc = Bun.spawn( ["ssh", ...SSH_OPTS.split(" "), "-t", `${username}@${gcpServerIp}`, `bash -c ${shellQuote(fullCmd)}`], diff --git a/cli/src/hetzner/hetzner.ts b/cli/src/hetzner/hetzner.ts index 24d5018c..92836e01 100644 --- a/cli/src/hetzner/hetzner.ts +++ b/cli/src/hetzner/hetzner.ts @@ -515,7 +515,8 @@ export async function interactiveSession( ip?: string, ): Promise { const serverIp = ip || hetznerServerIp; - const fullCmd = `export PATH="$HOME/.local/bin:$HOME/.bun/bin:$PATH" && ${cmd}`; + const term = process.env.TERM || "xterm-256color"; + const fullCmd = `export TERM=${term} PATH="$HOME/.local/bin:$HOME/.bun/bin:$PATH" && exec bash -l -c ${JSON.stringify(cmd)}`; const proc = Bun.spawn( ["ssh", ...SSH_OPTS, "-t", `root@${serverIp}`, fullCmd],