$FORGE_CHANNEL names the wrong channel #22
Labels
No labels
bug
docs
enhancement
good first issue
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
pedromcaraujo/forge#22
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
modules/ttyd.nixsetsFORGE_CHANNEL(andCLAUDE_CHANNEL) per ttyd unit,documented as "exported into the session so a statusline script can render
which channel it is". It doesn't work.
The channels share one long-lived tmux server, spawned lazily by whichever
ttyd starts first.
new-session -Aonly carries tmux'supdate-environmentallowlist across, so every session created afterwards inherits the server's
environment — i.e. the first channel's
FORGE_CHANNEL.Verified live: a pane in tmux session
forgereportsFORGE_CHANNEL=vault.So any statusline reading it labels almost every channel wrongly, and it gets
worse the more channels there are — only the one that happened to spawn the
server is correct.
Fix
Resolve the channel from the pane instead:
That is what
web/forge-status-hook.shdoes (see #21) and it is correct inevery session. Either drop the two variables and document the tmux lookup, or
have the session command re-export them from the resolved session name before
exec'ing
sessionCommand— the launcher script already re-sources env insidethe session for exactly this class of reason.
Also update the comment at the top of
modules/ttyd.nix, which currentlystates the broken contract.