@seamnet/client 0.14.2 → 0.14.4
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 +11 -3
- package/package.json +1 -1
package/bin/seam.js
CHANGED
|
@@ -394,10 +394,18 @@ function ccGetSessions() {
|
|
|
394
394
|
const panePid = execSync(`tmux display-message -t "${name}" -p '#{pane_pid}'`, {
|
|
395
395
|
encoding: 'utf8', timeout: 3000,
|
|
396
396
|
}).trim();
|
|
397
|
-
|
|
397
|
+
// pane 进程本身可能就是 claude(tmux 直接启动时),也可能是 bash 的子进程
|
|
398
|
+
const self = execSync(`ps -o comm= -p ${panePid} 2>/dev/null`, {
|
|
398
399
|
encoding: 'utf8', timeout: 3000,
|
|
399
|
-
}).trim()
|
|
400
|
-
|
|
400
|
+
}).trim();
|
|
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 {}
|
|
407
|
+
ccRunning = ['claude', 'claude-code'].includes(self) ||
|
|
408
|
+
['claude', 'claude-code'].includes(child);
|
|
401
409
|
} catch {}
|
|
402
410
|
return { session: name, cc: ccRunning };
|
|
403
411
|
});
|