One mail app at a time: a second copy says tuimail is already open (FP-17) #60
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
queue
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
romaine-life/tuimail!60
Loading…
Reference in a new issue
No description provided.
Delete branch "fp17-one-copy"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Work package: https://openproject.home.romaine.life/wp/FP-17
Every interactive home app is one copy (FP-17). The at menu brings the
mailwindow back; this makes a tuimail opened any other way (typed in a shell, a script, a Claude session) refuse to start.Takes the lock: only the mail app's interactive run, plain
tuimailwith no arguments. It claims one-copy'stuimaillock inmain::runright after the arguments are read and before anything else (config, settings, accounts, keychain, log, cache, password commands, the terminal), so a refused copy printstuimail is already open, exits 1 and touches nothing. One-copy waits up to 5 s for a copy that is ending, which covers TESTING.md'srespawn-pane -kupdate.Doesn't take it:
tuimail mcp(one per Claude session),tuimail session,--check,--demo,--help,--version.Adds: the
one-copyv0.1.0 dependency and the claim; docs: CLAUDE.md (Running), README (Get started, Development), TESTING.md (the update's restart), withONE_COPY_SCOPEfor a test run against a separate data folder.Leaves alone: the agent listener's "another tuimail is answering agents" check (
agent.rs). It stays as it was: the lock is taken before the listener starts, so the check now fires only when two apps share a data folder under differentONE_COPY_SCOPEs, and--demokeeps its own socket (demo-agent.sock).Proof (debug build, lock held by a separate process,
ONE_COPY_SCOPE=fp17test, scratchTM_DATA_DIR): the interactive run printedtuimail is already openand exited 1 after 5.09 s with the data folder still empty;--check,--versionandmcpran while it was held. With the holder gone, tuimail started on a throwaway tmux server (Add an account screen), and a second copy beside it was refused the same way.