fix(remote): leave the remote-history PATH bootstrap out of this PR

Merge-time fix for #645: the PATH bootstrap for remote history reads
(src/remote-pane-history.ts, src/remote-hosts.ts and its test) is a
separate fix from the scroll work. On its own it does not reach a host
whose tmux lives only under /opt/homebrew/bin, because the link
precheck, the launch, the alive probe and discovery still run a bare
tmux through the same non-interactive ssh shell. It belongs in a
follow-up PR that routes every remote tmux call through one wrapper.
These files are restored to the PR's merge base; every scroll change
stays.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Codeman maintainer committed 2026-10-22 19:03:04 +02:00
1 parent 242bbfcd31
commit 71bf7288e0
3 files changed
+3 -54

No files matched your search

-8
View File
@@ -89,14 +89,6 @@ export function remoteLoginShellCommand(command: string): string {
return `exec ${REMOTE_LOGIN_SHELL} -i -l -c ${shellescape(command)}`;
}
/** Standard CLI locations missing from non-interactive SSH shells (notably Homebrew). */
export const REMOTE_PATH_BOOTSTRAP =
'export PATH=$HOME/.opencode/bin:$HOME/.local/bin:$HOME/bin:/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:$PATH';
export function withRemotePathBootstrap(command: string): string {
return `${REMOTE_PATH_BOOTSTRAP}; ${command}`;
}
/**
* The CLI text a location overlay should launch for `mode`, or null when this build has no
* entry for it. `overlays.<location>.command` when the entry names one, otherwise the bare
+2 -11
View File
@@ -48,13 +48,7 @@ import { exec } from 'node:child_process';
import { randomBytes } from 'node:crypto';
import { promisify } from 'node:util';
import type { SessionRemote } from './types/session.js';
import {
buildSshConnectionArgs,
classifyRemoteAliveExit,
remoteSshTarget,
shellescape,
withRemotePathBootstrap,
} from './remote-hosts.js';
import { buildSshConnectionArgs, classifyRemoteAliveExit, remoteSshTarget, shellescape } from './remote-hosts.js';
import { RemoteSshSlotTimeoutError, runWithRemoteSshLimit } from './remote-ssh-limiter.js';
import { remoteTmuxLocation } from './tmux-manager.js';
@@ -159,10 +153,7 @@ export function buildRemoteScrollbackCommand(
marker: string
): string {
const { socket, sessionName } = remoteTmuxLocation(remote, sessionId);
// Non-interactive macOS shells omit Homebrew and other per-user CLI paths.
const script = withRemotePathBootstrap(
buildRemoteScrollbackScript(socket, sessionName, historyLines, tailBytes, marker)
);
const script = buildRemoteScrollbackScript(socket, sessionName, historyLines, tailBytes, marker);
// `exec` so a timeout kill reaches ssh itself, not only the local `sh -c`.
return ['exec', ...buildSshConnectionArgs(remote), remoteSshTarget(remote), shellescape(script)].join(' ');
}