Repository navigation
fix: keep /rename session names across refreshes - #185
tahmidul612 wants to merge 1 commit into
Conversation
apply_session_snapshot rebuilds every pane from tmux on each 1s refresh, and the rebuilt panes start with an empty session_name. The cached names were only re-applied when sessions.dirty was set (the 10s poll, or a new/changed session_id), so a renamed session showed its label for one tick after each poll and fell back to the agent name otherwise. Carry the resolved label over for panes whose session_id is unchanged, keeping the dirty-flag optimization for the cases that need a full re-walk. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DfNZyAtMAKWkHpRXBDmQBg
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Summary
Session names set with Claude Code's
/renameonly show up now and then in the sidebar. Most of the time the row shows the agent name.apply_session_snapshotrebuildsrepo_groupsfrom tmux on every 1s refresh. The rebuiltPaneInfos start with an emptysession_name(src/tmux/query.rs).refresh_session_namesonly runs whensessions.dirtyis set, which happens after each 10ssession_poll_looptick or when a pane is new or itssession_idchanges. So a renamed session shows its label for about one tick after each poll, then the next refresh wipes it.This fix keeps each pane's previous
session_namein thepane_idmap thatapply_session_snapshotalready builds. When a pane'ssession_idhasn't changed, the label is copied onto the rebuilt pane. New panes and changedsession_ids still set the dirty flag and get a fullrefresh_session_namespass, so that optimization still works.Test plan
apply_session_snapshot_keeps_session_name_when_session_id_unchanged(the regression) andapply_session_snapshot_drops_session_name_when_session_id_changescargo test: all tests passcargo fmt --checkpasses.cargo clippy --all-targetsreports no new warnings (on Rust 1.97 it reports existingcollapsible_ifwarnings in other files)🤖 Generated with Claude Code
https://claude.ai/code/session_01DfNZyAtMAKWkHpRXBDmQBg
Summary by CodeRabbit