init script captures wrong session IDs when old sessions exist #172
Reference in New Issue
Block a user
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?
Bug: init script grabs stale session IDs instead of newly created ones
Steps to reproduce
kugetsu initRoot cause
kugetsu-session.shcmd_init_new_session() usestail -1to find sessions created before init runs, expecting the new session to be last. But if old stale sessions exist,tail -1picks one of those instead.This approach is fragile. It should capture the session IDs after creating new sessions and diff, not try to infer which is new from the before-state.
Expected behavior
After clean install and init,
kugetsu statusshould returnokimmediately.Actual behavior
index.json contains mismatched IDs,
kugetsu statusfails:The pm_agent field also captures the full session title line instead of just the session ID, suggesting the parsing is doing
awk '{print $1}'on the wrong column or the session list format changed.