mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-11-22 22:09:33 +01:00
Merge pull request #691: fix(remote): use a shared quoted PATH for all remote tmux operations
This commit is contained in:
commit
2b551541d9
8 files changed
+233
-19
No files matched your search
+18
-3
@@ -84,6 +84,7 @@ import {
|
||||
remoteLoginShellCommand,
|
||||
remoteSshTarget,
|
||||
remoteTmuxSessionAlive,
|
||||
withRemoteTmuxPath,
|
||||
} from './remote-hosts.js';
|
||||
import {
|
||||
buildDockerBaseArgs,
|
||||
@@ -1383,7 +1384,14 @@ export function buildRemoteLaunchCommand(options: {
|
||||
// `ssh -o BatchMode=yes` (preserving the historical token order), then the rest
|
||||
// of the connection args, then the target and the quoted tmux invocation.
|
||||
const [ssh, batchMode, ...connectionArgs] = buildSshConnectionArgs(remote);
|
||||
const sshParts = [ssh, batchMode, '-t', ...connectionArgs, remoteSshTarget(remote), shellescape(tmuxInvocation)];
|
||||
const sshParts = [
|
||||
ssh,
|
||||
batchMode,
|
||||
'-t',
|
||||
...connectionArgs,
|
||||
remoteSshTarget(remote),
|
||||
shellescape(withRemoteTmuxPath(tmuxInvocation)),
|
||||
];
|
||||
return sshParts.join(' ');
|
||||
}
|
||||
|
||||
@@ -1400,7 +1408,7 @@ export function buildRemoteKillCommand(options: { remote: SessionRemote; session
|
||||
const remoteName = remoteTmuxSessionName(sessionId);
|
||||
const killCmd = `tmux -L ${REMOTE_TMUX_SOCKET} kill-session -t ${shellescape(remoteName)}`;
|
||||
const [ssh, ...connectionArgs] = buildSshConnectionArgs(remote);
|
||||
return [ssh, ...connectionArgs, remoteSshTarget(remote), shellescape(killCmd)].join(' ');
|
||||
return [ssh, ...connectionArgs, remoteSshTarget(remote), shellescape(withRemoteTmuxPath(killCmd))].join(' ');
|
||||
}
|
||||
|
||||
// ========== Docker cases (COD-Docker) ==========
|
||||
@@ -1779,7 +1787,14 @@ export function resolveDockerLaunchOptions(
|
||||
export function buildRemoteAttachCommand(remote: SessionRemote, remoteSessionName: string): string {
|
||||
const tmuxInvocation = `tmux -L codeman attach -t ${shellescape(remoteSessionName)}`;
|
||||
const [ssh, batchMode, ...connectionArgs] = buildSshConnectionArgs(remote);
|
||||
const sshParts = [ssh, batchMode, '-t', ...connectionArgs, remoteSshTarget(remote), shellescape(tmuxInvocation)];
|
||||
const sshParts = [
|
||||
ssh,
|
||||
batchMode,
|
||||
'-t',
|
||||
...connectionArgs,
|
||||
remoteSshTarget(remote),
|
||||
shellescape(withRemoteTmuxPath(tmuxInvocation)),
|
||||
];
|
||||
return sshParts.join(' ');
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user