@seamnet/client 0.14.3 → 0.14.5
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/bin/seam.js +13 -4
- package/package.json +1 -1
package/bin/seam.js
CHANGED
|
@@ -398,9 +398,12 @@ function ccGetSessions() {
|
|
|
398
398
|
const self = execSync(`ps -o comm= -p ${panePid} 2>/dev/null`, {
|
|
399
399
|
encoding: 'utf8', timeout: 3000,
|
|
400
400
|
}).trim();
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
401
|
+
let child = '';
|
|
402
|
+
try {
|
|
403
|
+
child = execSync(`ps -o comm= --ppid ${panePid} 2>/dev/null`, {
|
|
404
|
+
encoding: 'utf8', timeout: 3000,
|
|
405
|
+
}).trim().split('\n').pop() || '';
|
|
406
|
+
} catch {}
|
|
404
407
|
ccRunning = ['claude', 'claude-code'].includes(self) ||
|
|
405
408
|
['claude', 'claude-code'].includes(child);
|
|
406
409
|
} catch {}
|
|
@@ -454,8 +457,14 @@ async function cmdCc(subAction, restArgs) {
|
|
|
454
457
|
if (!target) output(false, `session "${values.session}" not found`);
|
|
455
458
|
if (!target.cc) output(false, `session "${values.session}": CC not running`);
|
|
456
459
|
try {
|
|
460
|
+
// 分两步:先发文本(literal),再单独发 Enter
|
|
461
|
+
// CC 用 raw terminal mode,合在一起发会丢回车
|
|
462
|
+
execSync(
|
|
463
|
+
`tmux send-keys -t "${values.session}" -l ${JSON.stringify(values.text)}`,
|
|
464
|
+
{ timeout: 5000 }
|
|
465
|
+
);
|
|
457
466
|
execSync(
|
|
458
|
-
`tmux send-keys -t "${values.session}"
|
|
467
|
+
`tmux send-keys -t "${values.session}" Enter`,
|
|
459
468
|
{ timeout: 5000 }
|
|
460
469
|
);
|
|
461
470
|
output(true, { session: values.session, sent: values.text });
|