oh-my-codex 0.18.13 → 0.18.14
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/Cargo.lock +6 -6
- package/Cargo.toml +1 -1
- package/README.md +31 -11
- package/dist/agents/__tests__/native-config.test.js +25 -0
- package/dist/agents/__tests__/native-config.test.js.map +1 -1
- package/dist/agents/native-config.d.ts.map +1 -1
- package/dist/agents/native-config.js +5 -1
- package/dist/agents/native-config.js.map +1 -1
- package/dist/autopilot/__tests__/fsm.test.js +7 -0
- package/dist/autopilot/__tests__/fsm.test.js.map +1 -1
- package/dist/autopilot/__tests__/planner-routing.test.d.ts +2 -0
- package/dist/autopilot/__tests__/planner-routing.test.d.ts.map +1 -0
- package/dist/autopilot/__tests__/planner-routing.test.js +74 -0
- package/dist/autopilot/__tests__/planner-routing.test.js.map +1 -0
- package/dist/autopilot/__tests__/ralplan-gate.test.js +315 -0
- package/dist/autopilot/__tests__/ralplan-gate.test.js.map +1 -1
- package/dist/autopilot/completion-gate.js +1 -1
- package/dist/autopilot/completion-gate.js.map +1 -1
- package/dist/autopilot/fsm.d.ts +2 -2
- package/dist/autopilot/fsm.d.ts.map +1 -1
- package/dist/autopilot/fsm.js +3 -0
- package/dist/autopilot/fsm.js.map +1 -1
- package/dist/autopilot/planner-routing.d.ts +21 -0
- package/dist/autopilot/planner-routing.d.ts.map +1 -0
- package/dist/autopilot/planner-routing.js +59 -0
- package/dist/autopilot/planner-routing.js.map +1 -0
- package/dist/autopilot/ralplan-gate.d.ts.map +1 -1
- package/dist/autopilot/ralplan-gate.js +30 -0
- package/dist/autopilot/ralplan-gate.js.map +1 -1
- package/dist/autoresearch/goal.d.ts.map +1 -1
- package/dist/autoresearch/goal.js +10 -1
- package/dist/autoresearch/goal.js.map +1 -1
- package/dist/cli/__tests__/autoresearch-goal.test.js +33 -0
- package/dist/cli/__tests__/autoresearch-goal.test.js.map +1 -1
- package/dist/cli/__tests__/codex-plugin-layout.test.js +30 -0
- package/dist/cli/__tests__/codex-plugin-layout.test.js.map +1 -1
- package/dist/cli/__tests__/doctor-artifact-ownership.test.d.ts +2 -0
- package/dist/cli/__tests__/doctor-artifact-ownership.test.d.ts.map +1 -0
- package/dist/cli/__tests__/doctor-artifact-ownership.test.js +158 -0
- package/dist/cli/__tests__/doctor-artifact-ownership.test.js.map +1 -0
- package/dist/cli/__tests__/doctor-spark-routing.test.js +13 -0
- package/dist/cli/__tests__/doctor-spark-routing.test.js.map +1 -1
- package/dist/cli/__tests__/doctor-warning-copy.test.js +1 -0
- package/dist/cli/__tests__/doctor-warning-copy.test.js.map +1 -1
- package/dist/cli/__tests__/index.test.js +5 -0
- package/dist/cli/__tests__/index.test.js.map +1 -1
- package/dist/cli/__tests__/nested-help-routing.test.js +4 -0
- package/dist/cli/__tests__/nested-help-routing.test.js.map +1 -1
- package/dist/cli/__tests__/package-bin-contract.test.js +7 -1
- package/dist/cli/__tests__/package-bin-contract.test.js.map +1 -1
- package/dist/cli/__tests__/performance-goal.test.js +22 -0
- package/dist/cli/__tests__/performance-goal.test.js.map +1 -1
- package/dist/cli/__tests__/resume.test.js +96 -0
- package/dist/cli/__tests__/resume.test.js.map +1 -1
- package/dist/cli/__tests__/session-scoped-runtime.test.js +162 -0
- package/dist/cli/__tests__/session-scoped-runtime.test.js.map +1 -1
- package/dist/cli/__tests__/session-search.test.js +36 -0
- package/dist/cli/__tests__/session-search.test.js.map +1 -1
- package/dist/cli/__tests__/setup-agents-overwrite.test.js +35 -1
- package/dist/cli/__tests__/setup-agents-overwrite.test.js.map +1 -1
- package/dist/cli/__tests__/setup-install-mode.test.js +33 -0
- package/dist/cli/__tests__/setup-install-mode.test.js.map +1 -1
- package/dist/cli/__tests__/team.test.js +17 -3
- package/dist/cli/__tests__/team.test.js.map +1 -1
- package/dist/cli/__tests__/ultragoal.test.js +37 -0
- package/dist/cli/__tests__/ultragoal.test.js.map +1 -1
- package/dist/cli/__tests__/update.test.js +1 -0
- package/dist/cli/__tests__/update.test.js.map +1 -1
- package/dist/cli/autoresearch-goal.d.ts.map +1 -1
- package/dist/cli/autoresearch-goal.js +2 -1
- package/dist/cli/autoresearch-goal.js.map +1 -1
- package/dist/cli/doctor.d.ts +22 -0
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +263 -4
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +65 -4
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/performance-goal.d.ts.map +1 -1
- package/dist/cli/performance-goal.js +4 -2
- package/dist/cli/performance-goal.js.map +1 -1
- package/dist/cli/plugin-marketplace.d.ts +1 -0
- package/dist/cli/plugin-marketplace.d.ts.map +1 -1
- package/dist/cli/plugin-marketplace.js +67 -5
- package/dist/cli/plugin-marketplace.js.map +1 -1
- package/dist/cli/project-runtime-codex-homes.d.ts +2 -0
- package/dist/cli/project-runtime-codex-homes.d.ts.map +1 -1
- package/dist/cli/project-runtime-codex-homes.js +112 -5
- package/dist/cli/project-runtime-codex-homes.js.map +1 -1
- package/dist/cli/setup.d.ts.map +1 -1
- package/dist/cli/setup.js +15 -6
- package/dist/cli/setup.js.map +1 -1
- package/dist/cli/ultragoal.d.ts.map +1 -1
- package/dist/cli/ultragoal.js +5 -1
- package/dist/cli/ultragoal.js.map +1 -1
- package/dist/cli/update.d.ts.map +1 -1
- package/dist/cli/update.js +3 -0
- package/dist/cli/update.js.map +1 -1
- package/dist/config/__tests__/models.test.js +21 -1
- package/dist/config/__tests__/models.test.js.map +1 -1
- package/dist/config/models.d.ts +5 -0
- package/dist/config/models.d.ts.map +1 -1
- package/dist/config/models.js +23 -0
- package/dist/config/models.js.map +1 -1
- package/dist/goal-workflows/codex-goal-snapshot.d.ts +2 -0
- package/dist/goal-workflows/codex-goal-snapshot.d.ts.map +1 -1
- package/dist/goal-workflows/codex-goal-snapshot.js +10 -0
- package/dist/goal-workflows/codex-goal-snapshot.js.map +1 -1
- package/dist/hooks/__tests__/autopilot-skill-contract.test.js +7 -0
- package/dist/hooks/__tests__/autopilot-skill-contract.test.js.map +1 -1
- package/dist/hooks/__tests__/keyword-detector.test.js +46 -0
- package/dist/hooks/__tests__/keyword-detector.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-fallback-watcher.test.js +100 -0
- package/dist/hooks/__tests__/notify-fallback-watcher.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-all-workers-idle.test.js +75 -0
- package/dist/hooks/__tests__/notify-hook-all-workers-idle.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-auto-nudge.test.js +225 -0
- package/dist/hooks/__tests__/notify-hook-auto-nudge.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-team-dispatch.test.js +75 -0
- package/dist/hooks/__tests__/notify-hook-team-dispatch.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-team-leader-nudge.test.js +200 -0
- package/dist/hooks/__tests__/notify-hook-team-leader-nudge.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-team-tmux-guard.test.js +187 -12
- package/dist/hooks/__tests__/notify-hook-team-tmux-guard.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-tmux-heal.test.js +225 -0
- package/dist/hooks/__tests__/notify-hook-tmux-heal.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-tmux-scrollback.test.js +0 -0
- package/dist/hooks/__tests__/notify-hook-tmux-scrollback.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-worker-idle.test.js +75 -0
- package/dist/hooks/__tests__/notify-hook-worker-idle.test.js.map +1 -1
- package/dist/hooks/keyword-detector.d.ts.map +1 -1
- package/dist/hooks/keyword-detector.js +4 -0
- package/dist/hooks/keyword-detector.js.map +1 -1
- package/dist/hud/__tests__/reconcile.test.js +137 -2
- package/dist/hud/__tests__/reconcile.test.js.map +1 -1
- package/dist/hud/__tests__/state.test.js +107 -0
- package/dist/hud/__tests__/state.test.js.map +1 -1
- package/dist/hud/__tests__/tmux.test.js +17 -0
- package/dist/hud/__tests__/tmux.test.js.map +1 -1
- package/dist/hud/reconcile.d.ts.map +1 -1
- package/dist/hud/reconcile.js +21 -7
- package/dist/hud/reconcile.js.map +1 -1
- package/dist/hud/render.d.ts.map +1 -1
- package/dist/hud/render.js +9 -0
- package/dist/hud/render.js.map +1 -1
- package/dist/hud/state.d.ts.map +1 -1
- package/dist/hud/state.js +43 -5
- package/dist/hud/state.js.map +1 -1
- package/dist/hud/types.d.ts +6 -0
- package/dist/hud/types.d.ts.map +1 -1
- package/dist/hud/types.js.map +1 -1
- package/dist/modes/__tests__/base-autopilot-gates.test.js +48 -0
- package/dist/modes/__tests__/base-autopilot-gates.test.js.map +1 -1
- package/dist/modes/base.d.ts.map +1 -1
- package/dist/modes/base.js +1 -0
- package/dist/modes/base.js.map +1 -1
- package/dist/performance-goal/artifacts.d.ts.map +1 -1
- package/dist/performance-goal/artifacts.js +10 -1
- package/dist/performance-goal/artifacts.js.map +1 -1
- package/dist/ralplan/__tests__/consensus-gate.test.js +112 -0
- package/dist/ralplan/__tests__/consensus-gate.test.js.map +1 -1
- package/dist/ralplan/consensus-gate.d.ts +23 -0
- package/dist/ralplan/consensus-gate.d.ts.map +1 -1
- package/dist/ralplan/consensus-gate.js +133 -21
- package/dist/ralplan/consensus-gate.js.map +1 -1
- package/dist/scripts/__tests__/codex-native-hook.test.js +831 -2
- package/dist/scripts/__tests__/codex-native-hook.test.js.map +1 -1
- package/dist/scripts/codex-native-hook.d.ts.map +1 -1
- package/dist/scripts/codex-native-hook.js +486 -21
- package/dist/scripts/codex-native-hook.js.map +1 -1
- package/dist/scripts/notify-hook/team-tmux-guard.d.ts.map +1 -1
- package/dist/scripts/notify-hook/team-tmux-guard.js +87 -8
- package/dist/scripts/notify-hook/team-tmux-guard.js.map +1 -1
- package/dist/scripts/notify-hook/tmux-injection.js +1 -1
- package/dist/scripts/notify-hook/tmux-injection.js.map +1 -1
- package/dist/scripts/run-compiled-ci.d.ts +2 -0
- package/dist/scripts/run-compiled-ci.d.ts.map +1 -0
- package/dist/scripts/run-compiled-ci.js +77 -0
- package/dist/scripts/run-compiled-ci.js.map +1 -0
- package/dist/scripts/sync-plugin-mirror.d.ts.map +1 -1
- package/dist/scripts/sync-plugin-mirror.js +1 -0
- package/dist/scripts/sync-plugin-mirror.js.map +1 -1
- package/dist/session-history/search.d.ts.map +1 -1
- package/dist/session-history/search.js +24 -9
- package/dist/session-history/search.js.map +1 -1
- package/dist/state/__tests__/operations.test.js +107 -3
- package/dist/state/__tests__/operations.test.js.map +1 -1
- package/dist/state/operations.d.ts.map +1 -1
- package/dist/state/operations.js +57 -2
- package/dist/state/operations.js.map +1 -1
- package/dist/team/__tests__/delivery-e2e-smoke.test.js +22 -1
- package/dist/team/__tests__/delivery-e2e-smoke.test.js.map +1 -1
- package/dist/team/__tests__/model-contract.test.js +57 -1
- package/dist/team/__tests__/model-contract.test.js.map +1 -1
- package/dist/team/__tests__/runtime.test.js +1468 -110
- package/dist/team/__tests__/runtime.test.js.map +1 -1
- package/dist/team/__tests__/scaling.test.js +63 -0
- package/dist/team/__tests__/scaling.test.js.map +1 -1
- package/dist/team/__tests__/state.test.js +24 -1
- package/dist/team/__tests__/state.test.js.map +1 -1
- package/dist/team/__tests__/tmux-session.test.js +512 -0
- package/dist/team/__tests__/tmux-session.test.js.map +1 -1
- package/dist/team/__tests__/worker-bootstrap.test.js +42 -9
- package/dist/team/__tests__/worker-bootstrap.test.js.map +1 -1
- package/dist/team/model-contract.d.ts +16 -0
- package/dist/team/model-contract.d.ts.map +1 -1
- package/dist/team/model-contract.js +41 -1
- package/dist/team/model-contract.js.map +1 -1
- package/dist/team/runtime.d.ts.map +1 -1
- package/dist/team/runtime.js +116 -30
- package/dist/team/runtime.js.map +1 -1
- package/dist/team/scaling.d.ts.map +1 -1
- package/dist/team/scaling.js +9 -1
- package/dist/team/scaling.js.map +1 -1
- package/dist/team/state/types.d.ts +2 -0
- package/dist/team/state/types.d.ts.map +1 -1
- package/dist/team/state/types.js.map +1 -1
- package/dist/team/state.d.ts +3 -0
- package/dist/team/state.d.ts.map +1 -1
- package/dist/team/state.js +20 -0
- package/dist/team/state.js.map +1 -1
- package/dist/team/tmux-session.d.ts +38 -3
- package/dist/team/tmux-session.d.ts.map +1 -1
- package/dist/team/tmux-session.js +275 -36
- package/dist/team/tmux-session.js.map +1 -1
- package/dist/team/worker-bootstrap.d.ts.map +1 -1
- package/dist/team/worker-bootstrap.js +26 -1
- package/dist/team/worker-bootstrap.js.map +1 -1
- package/dist/ultragoal/__tests__/artifacts.test.js +238 -0
- package/dist/ultragoal/__tests__/artifacts.test.js.map +1 -1
- package/dist/ultragoal/__tests__/docs-contract.test.js +3 -0
- package/dist/ultragoal/__tests__/docs-contract.test.js.map +1 -1
- package/dist/ultragoal/artifacts.d.ts +15 -0
- package/dist/ultragoal/artifacts.d.ts.map +1 -1
- package/dist/ultragoal/artifacts.js +167 -4
- package/dist/ultragoal/artifacts.js.map +1 -1
- package/dist/utils/__tests__/agents-md.test.js +39 -1
- package/dist/utils/__tests__/agents-md.test.js.map +1 -1
- package/dist/utils/__tests__/agents-model-table.test.js +28 -0
- package/dist/utils/__tests__/agents-model-table.test.js.map +1 -1
- package/dist/utils/agents-md.d.ts +4 -0
- package/dist/utils/agents-md.d.ts.map +1 -1
- package/dist/utils/agents-md.js +25 -0
- package/dist/utils/agents-md.js.map +1 -1
- package/dist/utils/agents-model-table.d.ts +7 -3
- package/dist/utils/agents-model-table.d.ts.map +1 -1
- package/dist/utils/agents-model-table.js +16 -8
- package/dist/utils/agents-model-table.js.map +1 -1
- package/dist/verification/__tests__/ci-rust-gates.test.js +4 -0
- package/dist/verification/__tests__/ci-rust-gates.test.js.map +1 -1
- package/package.json +2 -2
- package/plugins/oh-my-codex/.codex-plugin/plugin.json +1 -1
- package/plugins/oh-my-codex/hooks/codex-native-hook.mjs +59 -8
- package/plugins/oh-my-codex/skills/autopilot/SKILL.md +9 -5
- package/plugins/oh-my-codex/skills/autoresearch-goal/SKILL.md +3 -0
- package/plugins/oh-my-codex/skills/performance-goal/SKILL.md +3 -0
- package/plugins/oh-my-codex/skills/ralplan/SKILL.md +1 -1
- package/plugins/oh-my-codex/skills/ultragoal/SKILL.md +22 -4
- package/plugins/oh-my-codex/skills/ultrawork/SKILL.md +2 -2
- package/plugins/oh-my-codex/skills/ultrawork/references/agent-tiers.md +61 -0
- package/skills/autopilot/SKILL.md +9 -5
- package/skills/autoresearch-goal/SKILL.md +3 -0
- package/skills/ecomode/SKILL.md +1 -1
- package/skills/ecomode/references/agent-tiers.md +61 -0
- package/skills/performance-goal/SKILL.md +3 -0
- package/skills/ralplan/SKILL.md +1 -1
- package/skills/ultragoal/SKILL.md +22 -4
- package/skills/ultrawork/SKILL.md +2 -2
- package/skills/ultrawork/references/agent-tiers.md +61 -0
- package/src/scripts/__tests__/codex-native-hook.test.ts +975 -40
- package/src/scripts/codex-native-hook.ts +529 -22
- package/src/scripts/notify-hook/team-tmux-guard.ts +92 -8
- package/src/scripts/notify-hook/tmux-injection.ts +1 -1
- package/src/scripts/run-compiled-ci.ts +85 -0
- package/src/scripts/sync-plugin-mirror.ts +1 -0
- package/templates/AGENTS.md +6 -0
|
@@ -35,6 +35,18 @@ function withMockedExistsSync(mock, fn) {
|
|
|
35
35
|
syncBuiltinESMExports();
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
+
function withMockedStatSync(mock, fn) {
|
|
39
|
+
const original = fs.statSync;
|
|
40
|
+
fs.statSync = mock;
|
|
41
|
+
syncBuiltinESMExports();
|
|
42
|
+
try {
|
|
43
|
+
return fn();
|
|
44
|
+
}
|
|
45
|
+
finally {
|
|
46
|
+
fs.statSync = original;
|
|
47
|
+
syncBuiltinESMExports();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
38
50
|
function escapeRegExp(value) {
|
|
39
51
|
return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
40
52
|
}
|
|
@@ -3219,6 +3231,9 @@ esac
|
|
|
3219
3231
|
assert.match(tmuxLog, /set-option -p -t %1 @omx_pane_instance_id omx-pane-scope/);
|
|
3220
3232
|
assert.match(tmuxLog, /set-option -p -t %2 @omx_pane_instance_id omx-pane-scope/);
|
|
3221
3233
|
assert.match(tmuxLog, /set-option -p -t %3 @omx_pane_instance_id omx-pane-scope/);
|
|
3234
|
+
assert.match(tmuxLog, /set-option -p -t %1 @omx_team_pane_owner_id team:pane-tags/);
|
|
3235
|
+
assert.match(tmuxLog, /set-option -p -t %2 @omx_team_pane_owner_id team:pane-tags/);
|
|
3236
|
+
assert.match(tmuxLog, /set-option -p -t %3 @omx_team_pane_owner_id team:pane-tags/);
|
|
3222
3237
|
assert.match(tmuxLog, /exec env OMX_SESSION_ID='omx-pane-scope' OMX_TMUX_HUD_OWNER=1 OMX_TMUX_HUD_LEADER_PANE='%1' .*hud --watch/);
|
|
3223
3238
|
});
|
|
3224
3239
|
}
|
|
@@ -3242,6 +3257,202 @@ esac
|
|
|
3242
3257
|
await rm(cwd, { recursive: true, force: true });
|
|
3243
3258
|
}
|
|
3244
3259
|
});
|
|
3260
|
+
it('does not reuse the Team pane owner token as the HUD logical session id', async () => {
|
|
3261
|
+
const cwd = await mkdtemp(join(tmpdir(), 'omx-team-hud-session-boundary-'));
|
|
3262
|
+
const prevTmux = process.env.TMUX;
|
|
3263
|
+
const prevTmuxPane = process.env.TMUX_PANE;
|
|
3264
|
+
const prevSessionId = process.env.OMX_SESSION_ID;
|
|
3265
|
+
const prevWorkerCli = process.env.OMX_TEAM_WORKER_CLI;
|
|
3266
|
+
try {
|
|
3267
|
+
await withMockTmuxFixture('omx-tmux-hud-session-boundary-', (logPath) => `#!/bin/sh
|
|
3268
|
+
set -eu
|
|
3269
|
+
printf '%s\\n' "$*" >> "${logPath}"
|
|
3270
|
+
case "\${1:-}" in
|
|
3271
|
+
-V)
|
|
3272
|
+
echo "tmux 3.4"
|
|
3273
|
+
exit 0
|
|
3274
|
+
;;
|
|
3275
|
+
display-message)
|
|
3276
|
+
case "$*" in
|
|
3277
|
+
*"#{window_width}"*)
|
|
3278
|
+
echo "120"
|
|
3279
|
+
;;
|
|
3280
|
+
*)
|
|
3281
|
+
echo "shared:0 %1"
|
|
3282
|
+
;;
|
|
3283
|
+
esac
|
|
3284
|
+
exit 0
|
|
3285
|
+
;;
|
|
3286
|
+
list-panes)
|
|
3287
|
+
case "$*" in
|
|
3288
|
+
*"-t %2 -F #{pane_pid}"*)
|
|
3289
|
+
echo "2000002222"
|
|
3290
|
+
;;
|
|
3291
|
+
*"pane_current_command"*)
|
|
3292
|
+
printf "%%1\\tnode\\t'codex'\\n"
|
|
3293
|
+
;;
|
|
3294
|
+
*)
|
|
3295
|
+
printf "%%1\\n"
|
|
3296
|
+
;;
|
|
3297
|
+
esac
|
|
3298
|
+
exit 0
|
|
3299
|
+
;;
|
|
3300
|
+
split-window)
|
|
3301
|
+
case "$*" in
|
|
3302
|
+
*" -h "*)
|
|
3303
|
+
echo "%2"
|
|
3304
|
+
;;
|
|
3305
|
+
*)
|
|
3306
|
+
echo "%3"
|
|
3307
|
+
;;
|
|
3308
|
+
esac
|
|
3309
|
+
exit 0
|
|
3310
|
+
;;
|
|
3311
|
+
set-option|resize-pane|select-layout|set-window-option|select-pane|set-hook|run-shell)
|
|
3312
|
+
exit 0
|
|
3313
|
+
;;
|
|
3314
|
+
*)
|
|
3315
|
+
exit 0
|
|
3316
|
+
;;
|
|
3317
|
+
esac
|
|
3318
|
+
`, async ({ logPath }) => {
|
|
3319
|
+
const fakeBinDir = join(logPath, '..');
|
|
3320
|
+
const geminiPath = join(fakeBinDir, 'gemini');
|
|
3321
|
+
await writeFile(geminiPath, '#!/bin/sh\nexit 0\n');
|
|
3322
|
+
await chmod(geminiPath, 0o755);
|
|
3323
|
+
process.env.TMUX = '1';
|
|
3324
|
+
process.env.TMUX_PANE = '%1';
|
|
3325
|
+
delete process.env.OMX_SESSION_ID;
|
|
3326
|
+
process.env.OMX_TEAM_WORKER_CLI = 'gemini';
|
|
3327
|
+
const session = createTeamSession('HUD Session Boundary', 1, cwd, [], undefined, {
|
|
3328
|
+
teamPaneOwnerId: 'team:explicit-owner-boundary',
|
|
3329
|
+
});
|
|
3330
|
+
assert.equal(session.hudPaneId, '%3');
|
|
3331
|
+
assert.equal(session.teamPaneOwnerId, 'team:explicit-owner-boundary');
|
|
3332
|
+
const tmuxLog = await readFile(logPath, 'utf-8');
|
|
3333
|
+
assert.match(tmuxLog, /set-option -p -t %1 @omx_team_pane_owner_id team:explicit-owner-boundary/);
|
|
3334
|
+
assert.match(tmuxLog, /set-option -p -t %2 @omx_team_pane_owner_id team:explicit-owner-boundary/);
|
|
3335
|
+
assert.match(tmuxLog, /set-option -p -t %3 @omx_team_pane_owner_id team:explicit-owner-boundary/);
|
|
3336
|
+
assert.match(tmuxLog, /exec env OMX_TMUX_HUD_OWNER=1 OMX_TMUX_HUD_LEADER_PANE='%1' .*hud --watch/);
|
|
3337
|
+
assert.doesNotMatch(tmuxLog, /OMX_SESSION_ID='team:explicit-owner-boundary'/);
|
|
3338
|
+
});
|
|
3339
|
+
}
|
|
3340
|
+
finally {
|
|
3341
|
+
if (typeof prevTmux === 'string')
|
|
3342
|
+
process.env.TMUX = prevTmux;
|
|
3343
|
+
else
|
|
3344
|
+
delete process.env.TMUX;
|
|
3345
|
+
if (typeof prevTmuxPane === 'string')
|
|
3346
|
+
process.env.TMUX_PANE = prevTmuxPane;
|
|
3347
|
+
else
|
|
3348
|
+
delete process.env.TMUX_PANE;
|
|
3349
|
+
if (typeof prevSessionId === 'string')
|
|
3350
|
+
process.env.OMX_SESSION_ID = prevSessionId;
|
|
3351
|
+
else
|
|
3352
|
+
delete process.env.OMX_SESSION_ID;
|
|
3353
|
+
if (typeof prevWorkerCli === 'string')
|
|
3354
|
+
process.env.OMX_TEAM_WORKER_CLI = prevWorkerCli;
|
|
3355
|
+
else
|
|
3356
|
+
delete process.env.OMX_TEAM_WORKER_CLI;
|
|
3357
|
+
await rm(cwd, { recursive: true, force: true });
|
|
3358
|
+
}
|
|
3359
|
+
});
|
|
3360
|
+
it('removes only HUD panes owned by the current leader during team startup', async () => {
|
|
3361
|
+
const cwd = await mkdtemp(join(tmpdir(), 'omx-team-owned-hud-startup-'));
|
|
3362
|
+
const prevTmux = process.env.TMUX;
|
|
3363
|
+
const prevTmuxPane = process.env.TMUX_PANE;
|
|
3364
|
+
const prevSessionId = process.env.OMX_SESSION_ID;
|
|
3365
|
+
const prevWorkerCli = process.env.OMX_TEAM_WORKER_CLI;
|
|
3366
|
+
try {
|
|
3367
|
+
await withMockTmuxFixture('omx-tmux-owned-hud-startup-', (logPath) => `#!/bin/sh
|
|
3368
|
+
set -eu
|
|
3369
|
+
printf '%s\n' "$*" >> "${logPath}"
|
|
3370
|
+
case "\${1:-}" in
|
|
3371
|
+
-V)
|
|
3372
|
+
echo "tmux 3.4"
|
|
3373
|
+
exit 0
|
|
3374
|
+
;;
|
|
3375
|
+
display-message)
|
|
3376
|
+
case "$*" in
|
|
3377
|
+
*"#{window_width}"*)
|
|
3378
|
+
echo "120"
|
|
3379
|
+
;;
|
|
3380
|
+
*)
|
|
3381
|
+
echo "shared:0 %1"
|
|
3382
|
+
;;
|
|
3383
|
+
esac
|
|
3384
|
+
exit 0
|
|
3385
|
+
;;
|
|
3386
|
+
list-panes)
|
|
3387
|
+
case "$*" in
|
|
3388
|
+
*"pane_current_command"*)
|
|
3389
|
+
printf "%%1\\tnode\\t'codex'\\n"
|
|
3390
|
+
printf "%%7\\tnode\\t'codex neighbor'\\n"
|
|
3391
|
+
printf "%%2\\tnode\\texec env OMX_SESSION_ID='leader-session-a' OMX_TMUX_HUD_OWNER=1 OMX_TMUX_HUD_LEADER_PANE='%%1' node /tmp/bin/omx.js hud --watch\\n"
|
|
3392
|
+
printf "%%8\\tnode\\texec env OMX_SESSION_ID='neighbor-session' OMX_TMUX_HUD_OWNER=1 OMX_TMUX_HUD_LEADER_PANE='%%7' node /tmp/bin/omx.js hud --watch\\n"
|
|
3393
|
+
;;
|
|
3394
|
+
*)
|
|
3395
|
+
printf "%%1\\n%%7\\n%%2\\n%%8\\n"
|
|
3396
|
+
;;
|
|
3397
|
+
esac
|
|
3398
|
+
exit 0
|
|
3399
|
+
;;
|
|
3400
|
+
split-window)
|
|
3401
|
+
case "$*" in
|
|
3402
|
+
*" -h "*)
|
|
3403
|
+
echo "%3"
|
|
3404
|
+
;;
|
|
3405
|
+
*)
|
|
3406
|
+
echo "%4"
|
|
3407
|
+
;;
|
|
3408
|
+
esac
|
|
3409
|
+
exit 0
|
|
3410
|
+
;;
|
|
3411
|
+
set-option|resize-pane|select-layout|set-window-option|select-pane|set-hook|run-shell|send-keys|kill-pane)
|
|
3412
|
+
exit 0
|
|
3413
|
+
;;
|
|
3414
|
+
*)
|
|
3415
|
+
exit 0
|
|
3416
|
+
;;
|
|
3417
|
+
esac
|
|
3418
|
+
`, async ({ logPath }) => {
|
|
3419
|
+
const fakeBinDir = join(logPath, '..');
|
|
3420
|
+
const geminiPath = join(fakeBinDir, 'gemini');
|
|
3421
|
+
await writeFile(geminiPath, '#!/bin/sh\nexit 0\n');
|
|
3422
|
+
await chmod(geminiPath, 0o755);
|
|
3423
|
+
process.env.TMUX = 'shared-session,stub,0';
|
|
3424
|
+
process.env.TMUX_PANE = '%1';
|
|
3425
|
+
process.env.OMX_SESSION_ID = 'leader-session-a';
|
|
3426
|
+
process.env.OMX_TEAM_WORKER_CLI = 'gemini';
|
|
3427
|
+
const session = createTeamSession('Owned HUD Startup', 1, cwd);
|
|
3428
|
+
assert.equal(session.leaderPaneId, '%1');
|
|
3429
|
+
assert.equal(session.hudPaneId, '%4');
|
|
3430
|
+
const tmuxLog = await readFile(logPath, 'utf-8');
|
|
3431
|
+
assert.match(tmuxLog, /kill-pane -t %2/);
|
|
3432
|
+
assert.doesNotMatch(tmuxLog, /kill-pane -t %8/);
|
|
3433
|
+
assert.match(tmuxLog, /split-window -v -f -l 3 -t shared:0 -d -P -F #\{pane_id\}/);
|
|
3434
|
+
});
|
|
3435
|
+
}
|
|
3436
|
+
finally {
|
|
3437
|
+
if (typeof prevTmux === 'string')
|
|
3438
|
+
process.env.TMUX = prevTmux;
|
|
3439
|
+
else
|
|
3440
|
+
delete process.env.TMUX;
|
|
3441
|
+
if (typeof prevTmuxPane === 'string')
|
|
3442
|
+
process.env.TMUX_PANE = prevTmuxPane;
|
|
3443
|
+
else
|
|
3444
|
+
delete process.env.TMUX_PANE;
|
|
3445
|
+
if (typeof prevSessionId === 'string')
|
|
3446
|
+
process.env.OMX_SESSION_ID = prevSessionId;
|
|
3447
|
+
else
|
|
3448
|
+
delete process.env.OMX_SESSION_ID;
|
|
3449
|
+
if (typeof prevWorkerCli === 'string')
|
|
3450
|
+
process.env.OMX_TEAM_WORKER_CLI = prevWorkerCli;
|
|
3451
|
+
else
|
|
3452
|
+
delete process.env.OMX_TEAM_WORKER_CLI;
|
|
3453
|
+
await rm(cwd, { recursive: true, force: true });
|
|
3454
|
+
}
|
|
3455
|
+
});
|
|
3245
3456
|
it('uses tmux 3.2a-compatible client-resized hook registration for team HUD resize', async () => {
|
|
3246
3457
|
const cwd = await mkdtemp(join(tmpdir(), 'omx-team-resize-hook-fallback-'));
|
|
3247
3458
|
const prevTmux = process.env.TMUX;
|
|
@@ -3911,6 +4122,307 @@ esac
|
|
|
3911
4122
|
await rm(cwd, { recursive: true, force: true });
|
|
3912
4123
|
}
|
|
3913
4124
|
});
|
|
4125
|
+
it('restores standalone HUD panes from the live leader pane cwd with explicit session ownership', async () => {
|
|
4126
|
+
const teamLaunchCwd = await mkdtemp(join(tmpdir(), 'omx-standalone-team-launch-cwd-'));
|
|
4127
|
+
const leaderPaneCwd = await mkdtemp(join(tmpdir(), 'omx-standalone-leader-pane-cwd-'));
|
|
4128
|
+
try {
|
|
4129
|
+
await withMockTmuxFixture('omx-tmux-leader-cwd-standalone-hud-', (logPath) => `#!/bin/sh
|
|
4130
|
+
set -eu
|
|
4131
|
+
printf '%s\\n' "$*" >> "${logPath}"
|
|
4132
|
+
case "\${1:-}" in
|
|
4133
|
+
display-message)
|
|
4134
|
+
case "$*" in
|
|
4135
|
+
*"#{pane_current_path}"*)
|
|
4136
|
+
echo "${leaderPaneCwd}"
|
|
4137
|
+
;;
|
|
4138
|
+
esac
|
|
4139
|
+
exit 0
|
|
4140
|
+
;;
|
|
4141
|
+
split-window)
|
|
4142
|
+
echo "%44"
|
|
4143
|
+
exit 0
|
|
4144
|
+
;;
|
|
4145
|
+
run-shell|select-pane|resize-pane|set-hook)
|
|
4146
|
+
exit 0
|
|
4147
|
+
;;
|
|
4148
|
+
*)
|
|
4149
|
+
exit 0
|
|
4150
|
+
;;
|
|
4151
|
+
esac
|
|
4152
|
+
`, async ({ logPath }) => {
|
|
4153
|
+
const paneId = restoreStandaloneHudPane('%11', teamLaunchCwd, {
|
|
4154
|
+
sessionId: 'current-session-for-hud',
|
|
4155
|
+
});
|
|
4156
|
+
assert.equal(paneId, '%44');
|
|
4157
|
+
const tmuxLog = await readFile(logPath, 'utf-8');
|
|
4158
|
+
assert.match(tmuxLog, /display-message -p -t %11 #\{pane_current_path\}/);
|
|
4159
|
+
assert.match(tmuxLog, new RegExp(`split-window -v -l ${HUD_TMUX_TEAM_HEIGHT_LINES} -t %11 -d -P -F #\\{pane_id\\} -c ${escapeRegExp(leaderPaneCwd)} `));
|
|
4160
|
+
assert.doesNotMatch(tmuxLog, new RegExp(`split-window .* -c ${escapeRegExp(teamLaunchCwd)} `));
|
|
4161
|
+
assert.match(tmuxLog, /exec env OMX_SESSION_ID='current-session-for-hud' OMX_TMUX_HUD_OWNER=1 OMX_TMUX_HUD_LEADER_PANE='%11' .*hud --watch/);
|
|
4162
|
+
});
|
|
4163
|
+
}
|
|
4164
|
+
finally {
|
|
4165
|
+
await rm(teamLaunchCwd, { recursive: true, force: true });
|
|
4166
|
+
await rm(leaderPaneCwd, { recursive: true, force: true });
|
|
4167
|
+
}
|
|
4168
|
+
});
|
|
4169
|
+
it('falls back to the team launch cwd when the live leader pane cwd is unusable', async () => {
|
|
4170
|
+
const teamLaunchCwd = await mkdtemp(join(tmpdir(), 'omx-standalone-team-launch-cwd-fallback-'));
|
|
4171
|
+
const deletedLeaderPaneCwd = await mkdtemp(join(tmpdir(), 'omx-standalone-deleted-leader-pane-cwd-'));
|
|
4172
|
+
await rm(deletedLeaderPaneCwd, { recursive: true, force: true });
|
|
4173
|
+
try {
|
|
4174
|
+
await withMockTmuxFixture('omx-tmux-deleted-leader-cwd-standalone-hud-', (logPath) => `#!/bin/sh
|
|
4175
|
+
set -eu
|
|
4176
|
+
printf '%s\\n' "$*" >> "${logPath}"
|
|
4177
|
+
case "\${1:-}" in
|
|
4178
|
+
display-message)
|
|
4179
|
+
case "$*" in
|
|
4180
|
+
*"#{pane_current_path}"*)
|
|
4181
|
+
echo "${deletedLeaderPaneCwd}"
|
|
4182
|
+
;;
|
|
4183
|
+
esac
|
|
4184
|
+
exit 0
|
|
4185
|
+
;;
|
|
4186
|
+
split-window)
|
|
4187
|
+
case "$*" in
|
|
4188
|
+
*"-c ${teamLaunchCwd} "*)
|
|
4189
|
+
echo "%44"
|
|
4190
|
+
exit 0
|
|
4191
|
+
;;
|
|
4192
|
+
*"-c ${deletedLeaderPaneCwd} "*)
|
|
4193
|
+
echo "deleted cwd should not be used" >&2
|
|
4194
|
+
exit 1
|
|
4195
|
+
;;
|
|
4196
|
+
*)
|
|
4197
|
+
echo "unexpected cwd: $*" >&2
|
|
4198
|
+
exit 1
|
|
4199
|
+
;;
|
|
4200
|
+
esac
|
|
4201
|
+
;;
|
|
4202
|
+
run-shell|select-pane|resize-pane|set-hook)
|
|
4203
|
+
exit 0
|
|
4204
|
+
;;
|
|
4205
|
+
*)
|
|
4206
|
+
exit 0
|
|
4207
|
+
;;
|
|
4208
|
+
esac
|
|
4209
|
+
`, async ({ logPath }) => {
|
|
4210
|
+
const paneId = restoreStandaloneHudPane('%11', teamLaunchCwd, {
|
|
4211
|
+
sessionId: 'current-session-for-hud',
|
|
4212
|
+
});
|
|
4213
|
+
assert.equal(paneId, '%44');
|
|
4214
|
+
const tmuxLog = await readFile(logPath, 'utf-8');
|
|
4215
|
+
assert.match(tmuxLog, /display-message -p -t %11 #\{pane_current_path\}/);
|
|
4216
|
+
assert.match(tmuxLog, new RegExp(`split-window -v -l ${HUD_TMUX_TEAM_HEIGHT_LINES} -t %11 -d -P -F #\\{pane_id\\} -c ${escapeRegExp(teamLaunchCwd)} `));
|
|
4217
|
+
assert.doesNotMatch(tmuxLog, new RegExp(`split-window .* -c ${escapeRegExp(deletedLeaderPaneCwd)} `));
|
|
4218
|
+
assert.match(tmuxLog, /select-pane -t %11/);
|
|
4219
|
+
});
|
|
4220
|
+
}
|
|
4221
|
+
finally {
|
|
4222
|
+
await rm(teamLaunchCwd, { recursive: true, force: true });
|
|
4223
|
+
}
|
|
4224
|
+
});
|
|
4225
|
+
it('keeps MSYS drive-style live leader cwd candidates without raw stat prefiltering', async () => {
|
|
4226
|
+
const liveLeaderCwd = '/c/live';
|
|
4227
|
+
const fallbackCwd = 'C:\\fallback';
|
|
4228
|
+
const fakeCygpathDir = await mkdtemp(join(tmpdir(), 'omx-msys-live-cygpath-'));
|
|
4229
|
+
const previousPath = process.env.PATH;
|
|
4230
|
+
const previousMsystem = process.env.MSYSTEM;
|
|
4231
|
+
const previousOstype = process.env.OSTYPE;
|
|
4232
|
+
const previousWsl = process.env.WSL_DISTRO_NAME;
|
|
4233
|
+
const previousWslInterop = process.env.WSL_INTEROP;
|
|
4234
|
+
const originalPlatform = Object.getOwnPropertyDescriptor(process, 'platform');
|
|
4235
|
+
const statCalls = [];
|
|
4236
|
+
try {
|
|
4237
|
+
const cygpathPath = join(fakeCygpathDir, 'cygpath');
|
|
4238
|
+
await writeFile(cygpathPath, '#!/bin/sh\nprintf "%s\\n" "$2"\n');
|
|
4239
|
+
await chmod(cygpathPath, 0o755);
|
|
4240
|
+
process.env.PATH = `${fakeCygpathDir}:${previousPath ?? ''}`;
|
|
4241
|
+
process.env.MSYSTEM = 'MINGW64';
|
|
4242
|
+
process.env.OSTYPE = 'msys';
|
|
4243
|
+
delete process.env.WSL_DISTRO_NAME;
|
|
4244
|
+
delete process.env.WSL_INTEROP;
|
|
4245
|
+
Object.defineProperty(process, 'platform', { value: 'win32', configurable: true });
|
|
4246
|
+
await withMockTmuxFixture('omx-tmux-msys-live-cwd-standalone-hud-', (logPath) => `#!/bin/sh
|
|
4247
|
+
set -eu
|
|
4248
|
+
printf '%s\\n' "$*" >> "${logPath}"
|
|
4249
|
+
case "\${1:-}" in
|
|
4250
|
+
display-message)
|
|
4251
|
+
case "$*" in
|
|
4252
|
+
*"#{pane_current_path}"*)
|
|
4253
|
+
echo "${liveLeaderCwd}"
|
|
4254
|
+
;;
|
|
4255
|
+
esac
|
|
4256
|
+
exit 0
|
|
4257
|
+
;;
|
|
4258
|
+
split-window)
|
|
4259
|
+
case "$*" in
|
|
4260
|
+
*"-c ${liveLeaderCwd} "*)
|
|
4261
|
+
echo "%44"
|
|
4262
|
+
exit 0
|
|
4263
|
+
;;
|
|
4264
|
+
*"-c ${fallbackCwd} "*)
|
|
4265
|
+
echo "fallback cwd should not be used when MSYS live cwd succeeds" >&2
|
|
4266
|
+
exit 1
|
|
4267
|
+
;;
|
|
4268
|
+
*)
|
|
4269
|
+
echo "unexpected cwd: $*" >&2
|
|
4270
|
+
exit 1
|
|
4271
|
+
;;
|
|
4272
|
+
esac
|
|
4273
|
+
;;
|
|
4274
|
+
run-shell|select-pane|resize-pane|set-hook)
|
|
4275
|
+
exit 0
|
|
4276
|
+
;;
|
|
4277
|
+
*)
|
|
4278
|
+
exit 0
|
|
4279
|
+
;;
|
|
4280
|
+
esac
|
|
4281
|
+
`, async ({ logPath }) => {
|
|
4282
|
+
const paneId = withMockedStatSync(((pathLike) => {
|
|
4283
|
+
const value = String(pathLike);
|
|
4284
|
+
statCalls.push(value);
|
|
4285
|
+
if (value === fallbackCwd)
|
|
4286
|
+
return { isDirectory: () => true };
|
|
4287
|
+
return { isDirectory: () => false };
|
|
4288
|
+
}), () => restoreStandaloneHudPane('%11', fallbackCwd, { sessionId: 'current-session-for-hud' }));
|
|
4289
|
+
assert.equal(paneId, '%44');
|
|
4290
|
+
assert.equal(statCalls.includes(liveLeaderCwd), false);
|
|
4291
|
+
assert.equal(statCalls.includes(fallbackCwd), true);
|
|
4292
|
+
const tmuxLog = await readFile(logPath, 'utf-8');
|
|
4293
|
+
assert.match(tmuxLog, /display-message -p -t %11 #\{pane_current_path\}/);
|
|
4294
|
+
assert.match(tmuxLog, new RegExp(`split-window -v -l ${HUD_TMUX_TEAM_HEIGHT_LINES} -t %11 -d -P -F #\\{pane_id\\} -c ${escapeRegExp(liveLeaderCwd)} `));
|
|
4295
|
+
assert.doesNotMatch(tmuxLog, new RegExp(`split-window .* -c ${escapeRegExp(fallbackCwd)} `));
|
|
4296
|
+
assert.match(tmuxLog, /select-pane -t %11/);
|
|
4297
|
+
});
|
|
4298
|
+
}
|
|
4299
|
+
finally {
|
|
4300
|
+
if (originalPlatform)
|
|
4301
|
+
Object.defineProperty(process, 'platform', originalPlatform);
|
|
4302
|
+
if (typeof previousPath === 'string')
|
|
4303
|
+
process.env.PATH = previousPath;
|
|
4304
|
+
else
|
|
4305
|
+
delete process.env.PATH;
|
|
4306
|
+
if (typeof previousMsystem === 'string')
|
|
4307
|
+
process.env.MSYSTEM = previousMsystem;
|
|
4308
|
+
else
|
|
4309
|
+
delete process.env.MSYSTEM;
|
|
4310
|
+
if (typeof previousOstype === 'string')
|
|
4311
|
+
process.env.OSTYPE = previousOstype;
|
|
4312
|
+
else
|
|
4313
|
+
delete process.env.OSTYPE;
|
|
4314
|
+
if (typeof previousWsl === 'string')
|
|
4315
|
+
process.env.WSL_DISTRO_NAME = previousWsl;
|
|
4316
|
+
else
|
|
4317
|
+
delete process.env.WSL_DISTRO_NAME;
|
|
4318
|
+
if (typeof previousWslInterop === 'string')
|
|
4319
|
+
process.env.WSL_INTEROP = previousWslInterop;
|
|
4320
|
+
else
|
|
4321
|
+
delete process.env.WSL_INTEROP;
|
|
4322
|
+
await rm(fakeCygpathDir, { recursive: true, force: true });
|
|
4323
|
+
}
|
|
4324
|
+
});
|
|
4325
|
+
it('falls back after an unusable MSYS drive-style live leader cwd split attempt fails', async () => {
|
|
4326
|
+
const liveLeaderCwd = '/c/deleted-live';
|
|
4327
|
+
const fallbackCwd = 'C:\\fallback';
|
|
4328
|
+
const fakeCygpathDir = await mkdtemp(join(tmpdir(), 'omx-msys-deleted-live-cygpath-'));
|
|
4329
|
+
const previousPath = process.env.PATH;
|
|
4330
|
+
const previousMsystem = process.env.MSYSTEM;
|
|
4331
|
+
const previousOstype = process.env.OSTYPE;
|
|
4332
|
+
const previousWsl = process.env.WSL_DISTRO_NAME;
|
|
4333
|
+
const previousWslInterop = process.env.WSL_INTEROP;
|
|
4334
|
+
const originalPlatform = Object.getOwnPropertyDescriptor(process, 'platform');
|
|
4335
|
+
const statCalls = [];
|
|
4336
|
+
try {
|
|
4337
|
+
const cygpathPath = join(fakeCygpathDir, 'cygpath');
|
|
4338
|
+
await writeFile(cygpathPath, '#!/bin/sh\nprintf "%s\\n" "$2"\n');
|
|
4339
|
+
await chmod(cygpathPath, 0o755);
|
|
4340
|
+
process.env.PATH = `${fakeCygpathDir}:${previousPath ?? ''}`;
|
|
4341
|
+
process.env.MSYSTEM = 'MINGW64';
|
|
4342
|
+
process.env.OSTYPE = 'msys';
|
|
4343
|
+
delete process.env.WSL_DISTRO_NAME;
|
|
4344
|
+
delete process.env.WSL_INTEROP;
|
|
4345
|
+
Object.defineProperty(process, 'platform', { value: 'win32', configurable: true });
|
|
4346
|
+
await withMockTmuxFixture('omx-tmux-msys-deleted-live-cwd-standalone-hud-', (logPath) => `#!/bin/sh
|
|
4347
|
+
set -eu
|
|
4348
|
+
printf '%s\\n' "$*" >> "${logPath}"
|
|
4349
|
+
case "\${1:-}" in
|
|
4350
|
+
display-message)
|
|
4351
|
+
case "$*" in
|
|
4352
|
+
*"#{pane_current_path}"*)
|
|
4353
|
+
echo "${liveLeaderCwd}"
|
|
4354
|
+
;;
|
|
4355
|
+
esac
|
|
4356
|
+
exit 0
|
|
4357
|
+
;;
|
|
4358
|
+
split-window)
|
|
4359
|
+
case "$*" in
|
|
4360
|
+
*"-c ${liveLeaderCwd} "*)
|
|
4361
|
+
echo "deleted live cwd cannot be used" >&2
|
|
4362
|
+
exit 1
|
|
4363
|
+
;;
|
|
4364
|
+
*"-c ${fallbackCwd} "*)
|
|
4365
|
+
echo "%44"
|
|
4366
|
+
exit 0
|
|
4367
|
+
;;
|
|
4368
|
+
*)
|
|
4369
|
+
echo "unexpected cwd: $*" >&2
|
|
4370
|
+
exit 1
|
|
4371
|
+
;;
|
|
4372
|
+
esac
|
|
4373
|
+
;;
|
|
4374
|
+
run-shell|select-pane|resize-pane|set-hook)
|
|
4375
|
+
exit 0
|
|
4376
|
+
;;
|
|
4377
|
+
*)
|
|
4378
|
+
exit 0
|
|
4379
|
+
;;
|
|
4380
|
+
esac
|
|
4381
|
+
`, async ({ logPath }) => {
|
|
4382
|
+
const paneId = withMockedStatSync(((pathLike) => {
|
|
4383
|
+
const value = String(pathLike);
|
|
4384
|
+
statCalls.push(value);
|
|
4385
|
+
if (value === fallbackCwd)
|
|
4386
|
+
return { isDirectory: () => true };
|
|
4387
|
+
return { isDirectory: () => false };
|
|
4388
|
+
}), () => restoreStandaloneHudPane('%11', fallbackCwd, { sessionId: 'current-session-for-hud' }));
|
|
4389
|
+
assert.equal(paneId, '%44');
|
|
4390
|
+
assert.equal(statCalls.includes(liveLeaderCwd), false);
|
|
4391
|
+
assert.equal(statCalls.includes(fallbackCwd), true);
|
|
4392
|
+
const tmuxLog = await readFile(logPath, 'utf-8');
|
|
4393
|
+
const liveAttemptIndex = tmuxLog.indexOf(`-c ${liveLeaderCwd} `);
|
|
4394
|
+
const fallbackAttemptIndex = tmuxLog.indexOf(`-c ${fallbackCwd} `);
|
|
4395
|
+
assert.ok(liveAttemptIndex >= 0, 'deleted MSYS live cwd should still be attempted');
|
|
4396
|
+
assert.ok(fallbackAttemptIndex > liveAttemptIndex, 'fallback should be attempted after live split failure');
|
|
4397
|
+
assert.match(tmuxLog, /select-pane -t %11/);
|
|
4398
|
+
});
|
|
4399
|
+
}
|
|
4400
|
+
finally {
|
|
4401
|
+
if (originalPlatform)
|
|
4402
|
+
Object.defineProperty(process, 'platform', originalPlatform);
|
|
4403
|
+
if (typeof previousPath === 'string')
|
|
4404
|
+
process.env.PATH = previousPath;
|
|
4405
|
+
else
|
|
4406
|
+
delete process.env.PATH;
|
|
4407
|
+
if (typeof previousMsystem === 'string')
|
|
4408
|
+
process.env.MSYSTEM = previousMsystem;
|
|
4409
|
+
else
|
|
4410
|
+
delete process.env.MSYSTEM;
|
|
4411
|
+
if (typeof previousOstype === 'string')
|
|
4412
|
+
process.env.OSTYPE = previousOstype;
|
|
4413
|
+
else
|
|
4414
|
+
delete process.env.OSTYPE;
|
|
4415
|
+
if (typeof previousWsl === 'string')
|
|
4416
|
+
process.env.WSL_DISTRO_NAME = previousWsl;
|
|
4417
|
+
else
|
|
4418
|
+
delete process.env.WSL_DISTRO_NAME;
|
|
4419
|
+
if (typeof previousWslInterop === 'string')
|
|
4420
|
+
process.env.WSL_INTEROP = previousWslInterop;
|
|
4421
|
+
else
|
|
4422
|
+
delete process.env.WSL_INTEROP;
|
|
4423
|
+
await rm(fakeCygpathDir, { recursive: true, force: true });
|
|
4424
|
+
}
|
|
4425
|
+
});
|
|
3914
4426
|
it('restores standalone HUD panes with an absolute OMX entry path after cwd drift', async () => {
|
|
3915
4427
|
const cwd = await mkdtemp(join(tmpdir(), 'omx-standalone-relative-hud-'));
|
|
3916
4428
|
const startupCwd = await mkdtemp(join(tmpdir(), 'omx-standalone-relative-start-'));
|