triflux 6.0.9 → 6.0.11
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 +22 -10
- package/package.json +1 -1
package/hub/team/headless.mjs
CHANGED
|
@@ -280,7 +280,7 @@ export function applyTrifluxTheme(sessionName) {
|
|
|
280
280
|
* 반투명 + 비포커스 시 더 투명 + Catppuccin 테마.
|
|
281
281
|
* @returns {boolean} 성공 여부
|
|
282
282
|
*/
|
|
283
|
-
export function ensureWtProfile() {
|
|
283
|
+
export function ensureWtProfile(workerCount = 2) {
|
|
284
284
|
const settingsPaths = [
|
|
285
285
|
join(process.env.LOCALAPPDATA || "", "Packages/Microsoft.WindowsTerminal_8wekyb3d8bbwe/LocalState/settings.json"),
|
|
286
286
|
join(process.env.LOCALAPPDATA || "", "Microsoft/Windows Terminal/settings.json"),
|
|
@@ -302,11 +302,11 @@ export function ensureWtProfile() {
|
|
|
302
302
|
icon: "\u{1F53A}", // 🔺
|
|
303
303
|
tabTitle: "triflux",
|
|
304
304
|
suppressApplicationTitle: true,
|
|
305
|
-
opacity:
|
|
305
|
+
opacity: 40,
|
|
306
306
|
useAcrylic: true,
|
|
307
|
-
unfocusedAppearance: { opacity:
|
|
307
|
+
unfocusedAppearance: { opacity: 20 },
|
|
308
308
|
colorScheme: "One Half Dark",
|
|
309
|
-
font: { size:
|
|
309
|
+
font: { size: Math.max(6, 9 - Math.floor(workerCount / 2)) },
|
|
310
310
|
hidden: true, // 프로필 목록에는 숨김 (triflux에서만 사용)
|
|
311
311
|
};
|
|
312
312
|
|
|
@@ -334,7 +334,7 @@ export function ensureWtProfile() {
|
|
|
334
334
|
* @param {string} [opts.position] — "right" | "left" | 없으면 기본 위치
|
|
335
335
|
* @returns {boolean} 성공 여부
|
|
336
336
|
*/
|
|
337
|
-
export function autoAttachTerminal(sessionName, opts = {}) {
|
|
337
|
+
export function autoAttachTerminal(sessionName, opts = {}, workerCount = 2) {
|
|
338
338
|
try {
|
|
339
339
|
// Windows Terminal이 설치되어 있는지 확인
|
|
340
340
|
execSync("where wt.exe", { stdio: "ignore" });
|
|
@@ -342,11 +342,23 @@ export function autoAttachTerminal(sessionName, opts = {}) {
|
|
|
342
342
|
return false; // wt.exe 미설치 — 사용자에게 수동 attach 안내 필요
|
|
343
343
|
}
|
|
344
344
|
|
|
345
|
-
// triflux WT 프로필 확보 (투명도 + 테마)
|
|
346
|
-
ensureWtProfile();
|
|
345
|
+
// triflux WT 프로필 확보 (투명도 + 테마 + 폰트 크기)
|
|
346
|
+
ensureWtProfile(workerCount);
|
|
347
347
|
|
|
348
|
-
// PowerShell 래핑 + "--" 구분자 + 포커스 비탈취
|
|
349
348
|
const shells = ["pwsh.exe", "powershell.exe"];
|
|
349
|
+
// 방법 1: split-pane — 같은 WT 창에서 가로 분할 (하단 40%)
|
|
350
|
+
if (process.env.WT_SESSION) {
|
|
351
|
+
for (const shell of shells) {
|
|
352
|
+
try {
|
|
353
|
+
execSync(
|
|
354
|
+
`wt.exe -w 0 sp -H --size 0.4 --profile triflux --title triflux -- ${shell} -Command "psmux attach -t ${sessionName}"`,
|
|
355
|
+
{ stdio: "ignore", timeout: 5000 },
|
|
356
|
+
);
|
|
357
|
+
return true;
|
|
358
|
+
} catch { /* 다음 shell */ }
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
// 방법 2 fallback: 새 탭 (WT_SESSION 없거나 sp 실패 시)
|
|
350
362
|
for (const shell of shells) {
|
|
351
363
|
try {
|
|
352
364
|
execSync(
|
|
@@ -354,7 +366,7 @@ export function autoAttachTerminal(sessionName, opts = {}) {
|
|
|
354
366
|
{ stdio: "ignore", shell: true, timeout: 5000 },
|
|
355
367
|
);
|
|
356
368
|
return true;
|
|
357
|
-
} catch { /* 다음 shell
|
|
369
|
+
} catch { /* 다음 shell */ }
|
|
358
370
|
}
|
|
359
371
|
return false;
|
|
360
372
|
}
|
|
@@ -420,7 +432,7 @@ export async function runHeadlessInteractive(sessionName, assignments, opts = {}
|
|
|
420
432
|
runOpts.onProgress = (event) => {
|
|
421
433
|
if (autoAttach && event.type === "session_created" && !terminalAttached) {
|
|
422
434
|
terminalAttached = true;
|
|
423
|
-
autoAttachTerminal(sessionName);
|
|
435
|
+
autoAttachTerminal(sessionName, {}, assignments.length);
|
|
424
436
|
}
|
|
425
437
|
if (userOnProgress) userOnProgress(event);
|
|
426
438
|
};
|