detached 3601ffd

fix(daemon): skip redundant title recompute, refresh detached pickers

setDisplayFallback now early-returns under p.mu when the fallback is
unchanged, avoiding two displayTitleLocked() compositions on the render
hot path for a value (d.shell's basename) that never changes at runtime.

pickerViews refreshes every live session's focused-pane titles before
building views, so detached sessions no longer show stale process names
in the session picker (previously only paint() refreshed titles, and
only for the attached session).
commit
3601ffd90676d40872ae5c13858a431d23d3c2d8
author
brice · · 2026-07-11 10:15 UTC
parent
d3df67b
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
3 files · +9 -0
M internal/usecase/daemon/pane_titles.go +4 -0
@@ -47,6 +47,10 @@ func (p *pane) displayTitleLocked() string {
4747 // cached composition unless that fallback changes the displayed title.
4848 func (p *pane) setDisplayFallback(fallback string) {
4949 p.mu.Lock()
50+ if p.title.displayFallback == fallback {
51+ p.mu.Unlock()
52+ return
53+ }
5054 oldTitle := p.displayTitleLocked()
5155 p.title.displayFallback = fallback
5256 if oldTitle != p.displayTitleLocked() {
@@ -47,6 +47,10 @@ func (p *pane) displayTitleLocked() string {
47 // cached composition unless that fallback changes the displayed title.47 // cached composition unless that fallback changes the displayed title.
48 func (p *pane) setDisplayFallback(fallback string) {48 func (p *pane) setDisplayFallback(fallback string) {
49 p.mu.Lock()49 p.mu.Lock()
50+ if p.title.displayFallback == fallback {
51+ p.mu.Unlock()
52+ return
53+ }
50 oldTitle := p.displayTitleLocked()54 oldTitle := p.displayTitleLocked()
51 p.title.displayFallback = fallback55 p.title.displayFallback = fallback
52 if oldTitle != p.displayTitleLocked() {56 if oldTitle != p.displayTitleLocked() {
M internal/usecase/daemon/picker.go +4 -0
@@ -63,6 +63,10 @@ func (d *Daemon) pickerViews(cur *session) ([]picker.SessionView, int) {
6363 sort.Slice(sessions, func(i, j int) bool { return sessions[i].name < sessions[j].name })
6464 sort.Slice(stopped, func(i, j int) bool { return stopped[i].name < stopped[j].name })
6565
66+ for _, s := range sessions {
67+ d.refreshSessionFocusedTitles(s)
68+ }
69+
6670 views := make([]picker.SessionView, 0, len(sessions)+len(stopped))
6771 curTab := 0
6872 for _, s := range sessions {
@@ -63,6 +63,10 @@ func (d *Daemon) pickerViews(cur *session) ([]picker.SessionView, int) {
63 sort.Slice(sessions, func(i, j int) bool { return sessions[i].name < sessions[j].name })63 sort.Slice(sessions, func(i, j int) bool { return sessions[i].name < sessions[j].name })
64 sort.Slice(stopped, func(i, j int) bool { return stopped[i].name < stopped[j].name })64 sort.Slice(stopped, func(i, j int) bool { return stopped[i].name < stopped[j].name })
65 65
66+ for _, s := range sessions {
67+ d.refreshSessionFocusedTitles(s)
68+ }
69+
66 views := make([]picker.SessionView, 0, len(sessions)+len(stopped))70 views := make([]picker.SessionView, 0, len(sessions)+len(stopped))
67 curTab := 071 curTab := 0
68 for _, s := range sessions {72 for _, s := range sessions {
M internal/usecase/daemon/picker_test.go +1 -0
@@ -72,6 +72,7 @@ func TestPickerViewsComposesFocusedPaneTitleWithAttentionSuffix(t *testing.T) {
7272 defer releasePTY1()
7373 defer releasePTY2()
7474 d, sess, _, _ := newManualSessionWithPTYs(t, p1, p2)
75+ d.shell = "/bin/sh"
7576 sess.tabs[1].name = "logs"
7677
7778 pane0 := sess.tabs[0].focusedPane()
@@ -72,6 +72,7 @@ func TestPickerViewsComposesFocusedPaneTitleWithAttentionSuffix(t *testing.T) {
72 defer releasePTY1()72 defer releasePTY1()
73 defer releasePTY2()73 defer releasePTY2()
74 d, sess, _, _ := newManualSessionWithPTYs(t, p1, p2)74 d, sess, _, _ := newManualSessionWithPTYs(t, p1, p2)
75+ d.shell = "/bin/sh"
75 sess.tabs[1].name = "logs"76 sess.tabs[1].name = "logs"
76 77
77 pane0 := sess.tabs[0].focusedPane()78 pane0 := sess.tabs[0].focusedPane()

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 12

Tags 11

↑↓ moveenter openesc close