Skip to content

fix: resolve tmux reattach workspace list paths#66

Merged
phasetr merged 9 commits into
mainfrom
fix/tmux-reattach-workspace-list-paths
May 10, 2026
Merged

fix: resolve tmux reattach workspace list paths#66
phasetr merged 9 commits into
mainfrom
fix/tmux-reattach-workspace-list-paths

Conversation

@phasetr

@phasetr phasetr commented May 10, 2026

Copy link
Copy Markdown
Owner

Summary

  • import tmux pane cwd into workspace state when reattaching live tmux sessions without persisted state
  • resolve workspace-list paths from workspace-local target directories and alias fallback before showing
  • preserve imported target directories without leaking global target directory state into normal workspace saves

Tests

  • make test

Regression Coverage

  • test-enkan-repl-tmux-reattach-imports-live-session-without-state verifies reattach import stores target directories
  • test-enkan-repl--terminal-tmux--list-window-cwds verifies tmux cwd parsing
  • test-workspace-list-uses-state-target-directories verifies workspace-list does not show for imported tmux cwd state
  • test-workspace-list-uses-project-alias-fallback verifies alias fallback path resolution

@phasetr

phasetr commented May 10, 2026

Copy link
Copy Markdown
Owner Author

Follow-up investigation found another path-loss route: when persisted workspace state already existed, reattach preferred it and discarded live tmux cwd data. Repeated workspace switches could then keep saving state without usable target directories, causing workspace-list to fall back to again.

Added fix commit 1fdd158:

  • merge live tmux cwd target directories into persisted workspace state during reattach
  • save only target directories relevant to the current workspace, avoiding global target-directory leakage
  • preserve imported target directories across save/load switch cycles

Additional regression coverage:

  • test-enkan-repl-tmux-reattach-enriches-persisted-state-with-live-cwd
  • test-enkan-repl--ws-state->plist-filters-target-directories
  • test-enkan-repl--save-workspace-state-preserves-imported-target-directories
  • test-workspace-list-keeps-imported-paths-after-repeated-switches

Verification: make check passes, including 242 ERT tests, byte compile, checkdoc, package-lint, and format.

@phasetr

phasetr commented May 10, 2026

Copy link
Copy Markdown
Owner Author

Second follow-up: reproduced the remaining cause using the actual state/tmux shape.

Actual mismatch observed:

  • persisted current project: lat / ising / er
  • live tmux window names: lattice-system / ising-model / enkan-repl
  • previous fixes copied live cwd into :target-directories, but under the tmux window alias, so current-project still could not resolve it.

Added fix commit 6316282:

  • normalize live tmux cwd target directories to the persisted workspace alias/current-project during reattach
  • let target resolution treat current-project as a target alias, so commands beyond workspace-list can resolve the same state
  • verified against a copy of the real state file plus live tmux; workspace-list lines become:
    • 02 - lat: /Users/sekine/dev/self/lattice-system
    • 03 - ising: /Users/sekine/dev/self/ising-model
    • 04 - junk: /Users/sekine/junk
    • 05 - er: /Users/sekine/dev/self/enkan-repl

Additional regression coverage:

  • test-enkan-repl-tmux-reattach-normalizes-live-cwd-to-persisted-alias
  • test-workspace-list-resolves-normalized-persisted-alias-paths
  • current-project-as-target-alias coverage in test-enkan-repl--target-directory-info

Verification: make check passes, including 244 ERT tests, byte compile, checkdoc, package-lint, and format.

@phasetr phasetr merged commit 7f403fa into main May 10, 2026
1 check passed
@phasetr phasetr deleted the fix/tmux-reattach-workspace-list-paths branch May 10, 2026 06:47
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 0.19.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants