triflux 6.0.4 → 6.0.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/hub/team/headless.mjs +15 -10
- package/hub/team/psmux.mjs +11 -2
- package/package.json +1 -1
package/hub/team/headless.mjs
CHANGED
|
@@ -171,7 +171,9 @@ export async function runHeadless(sessionName, assignments, opts = {}) {
|
|
|
171
171
|
};
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
-
|
|
174
|
+
// dispatch 시 확정된 logPath를 전달 — 셸이 pane 타이틀 변경해도 캡처 로그 매칭 유지
|
|
175
|
+
if (d.logPath) pollOpts.logPath = d.logPath;
|
|
176
|
+
const completion = await waitForCompletion(sessionName, d.paneId || d.paneName, d.token, timeoutSec, pollOpts);
|
|
175
177
|
|
|
176
178
|
const output = completion.matched
|
|
177
179
|
? readResult(d.resultFile, d.paneId)
|
|
@@ -247,6 +249,8 @@ export function applyTrifluxTheme(sessionName) {
|
|
|
247
249
|
["pane-border-style", "fg=#45475a"],
|
|
248
250
|
// Status bar 위치
|
|
249
251
|
["status-position", "bottom"],
|
|
252
|
+
// 셸이 pane 타이틀을 변경하는 것 방지 (캡처 로그 경로 안정성)
|
|
253
|
+
["allow-rename", "off"],
|
|
250
254
|
];
|
|
251
255
|
for (const [key, value] of opts) {
|
|
252
256
|
try { psmuxExec(["set-option", "-t", sessionName, key, value]); } catch { /* 무시 */ }
|
|
@@ -272,18 +276,19 @@ export function autoAttachTerminal(sessionName, opts = {}) {
|
|
|
272
276
|
return false; // wt.exe 미설치 — 사용자에게 수동 attach 안내 필요
|
|
273
277
|
}
|
|
274
278
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
} catch {
|
|
279
|
+
// PowerShell 래핑 — wt가 psmux를 파일로 인식하는 문제 방지
|
|
280
|
+
// pwsh.exe (PS7) 우선, 없으면 powershell.exe (PS5.1) fallback
|
|
281
|
+
const shells = ["pwsh.exe", "powershell.exe"];
|
|
282
|
+
for (const shell of shells) {
|
|
280
283
|
try {
|
|
281
|
-
execFileSync("wt.exe", [
|
|
284
|
+
execFileSync("wt.exe", [
|
|
285
|
+
"nt", shell, "-NoExit", "-Command",
|
|
286
|
+
`psmux attach -t ${sessionName}`,
|
|
287
|
+
], { stdio: "ignore" });
|
|
282
288
|
return true;
|
|
283
|
-
} catch {
|
|
284
|
-
return false;
|
|
285
|
-
}
|
|
289
|
+
} catch { /* 다음 shell 시도 */ }
|
|
286
290
|
}
|
|
291
|
+
return false;
|
|
287
292
|
}
|
|
288
293
|
|
|
289
294
|
/**
|
package/hub/team/psmux.mjs
CHANGED
|
@@ -667,7 +667,10 @@ export async function waitForPattern(sessionName, paneNameOrTarget, pattern, tim
|
|
|
667
667
|
}
|
|
668
668
|
|
|
669
669
|
const paneName = pane.title || paneNameOrTarget;
|
|
670
|
-
|
|
670
|
+
// opts.logPath: dispatch 시 확정된 캡처 로그 경로 직접 지정 (타이틀 변경 내성)
|
|
671
|
+
const logPath = (opts.logPath && existsSync(opts.logPath))
|
|
672
|
+
? opts.logPath
|
|
673
|
+
: getCaptureLogPath(sessionName, paneName);
|
|
671
674
|
if (!existsSync(logPath)) {
|
|
672
675
|
throw new Error(`캡처 로그가 없습니다. 먼저 startCapture(${sessionName}, ${paneName})를 호출하세요.`);
|
|
673
676
|
}
|
|
@@ -679,7 +682,13 @@ export async function waitForPattern(sessionName, paneNameOrTarget, pattern, tim
|
|
|
679
682
|
while (Date.now() <= deadline) {
|
|
680
683
|
// E4 크래시 복구: capture 실패 시 세션 생존 체크
|
|
681
684
|
try {
|
|
682
|
-
|
|
685
|
+
if (opts.logPath) {
|
|
686
|
+
// logPath 직접 지정 시 — 셸 타이틀 변경과 무관하게 올바른 파일에 기록
|
|
687
|
+
const snapshot = psmuxExec(["capture-pane", "-t", pane.paneId, "-p"]);
|
|
688
|
+
writeFileSync(logPath, snapshot, "utf8");
|
|
689
|
+
} else {
|
|
690
|
+
refreshCaptureSnapshot(sessionName, pane.paneId);
|
|
691
|
+
}
|
|
683
692
|
} catch {
|
|
684
693
|
if (!psmuxSessionExists(sessionName)) {
|
|
685
694
|
return {
|