mirror of
https://github.com/tiennm99/ccs.git
synced 2026-09-05 00:18:05 +00:00
refactor(teams): use spawnSync array args instead of execSync string
Avoids shell interpretation of env values by passing args as array to spawnSync instead of interpolating into a shell command string.
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
* Cross-platform shell execution utilities for CCS.
|
* Cross-platform shell execution utilities for CCS.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { spawn, ChildProcess, execSync } from 'child_process';
|
import { spawn, spawnSync, ChildProcess } from 'child_process';
|
||||||
import { ErrorManager } from './error-manager';
|
import { ErrorManager } from './error-manager';
|
||||||
import { getWebSearchHookEnv } from './websearch-manager';
|
import { getWebSearchHookEnv } from './websearch-manager';
|
||||||
|
|
||||||
@@ -89,7 +89,7 @@ export function execClaude(
|
|||||||
for (const key of tmuxPropagateVars) {
|
for (const key of tmuxPropagateVars) {
|
||||||
if (envVars[key]) {
|
if (envVars[key]) {
|
||||||
try {
|
try {
|
||||||
execSync(`tmux setenv ${key} ${JSON.stringify(envVars[key])}`, { stdio: 'ignore' });
|
spawnSync('tmux', ['setenv', key, envVars[key] ?? ''], { stdio: 'ignore' });
|
||||||
} catch {
|
} catch {
|
||||||
// tmux setenv can fail if not in a tmux session; safe to ignore
|
// tmux setenv can fail if not in a tmux session; safe to ignore
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user