lab service --start kills tmux session when login shell is ~/hero/bin/nu #310
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_skills#310
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?
Problem
Running
lab service --start(orlab service hero_proc --start) causes the caller's tmux session to exit. This happens when the user's login shell is/home/driver/hero/bin/nu.Root Cause
start_hero_proc()incrates/lab/src/service/hero_proc_exception.rscallskill_all_hero_processes_except_self()as a pre-start cleanup sweep. This function walks/proc/<pid>/exeand SIGKILLs every process whose executable lives under~/hero/bin/— except the callinglabbinary itself.The exclusion logic only skips processes whose exe matches
lab. It does not exclude:nu)labprocessWhen the login shell is
~/hero/bin/nu, the tmux session's shell process matches the kill pattern.sigkill_with_group()then kills the entire process group, taking down tmux and everything in it.Call Chain
Relevant Code
crates/lab/src/service/hero_proc_exception.rs:Evidence
Suggested Fix
kill_all_hero_processes_except_self()should exclude ancestor processes of the callinglabprocess. Walk the PPID chain frommy_pidup to init, collect all ancestor PIDs, and skip them in the kill loop.This is the safest approach because:
labis always an ancestor and must be preservedImpact
~/hero/bin/nu(or any other hero binary) will lose their terminal session every time they runlab service --start