detached 785b650

Merge pull request #179 from bnema/fix/issue-178-terminal-title-prefix

fix(daemon): avoid duplicate terminal title prefixes
commit
785b650b9e4fbb07f719fa29bb362b63d1f5fd3d
author
bnema · · 2026-08-04 13:20 UTC
committer
GitHub · · 2026-08-04 13:20 UTC
merge of
630045d + e7cd195 · diff against the first parent
signature
GPG UnverifiedB5690EEEBB952194 The key is unknown
2 files · +7 -2
M internal/usecase/daemon/pane_titles.go +5 -1
@@ -24,7 +24,11 @@ type paneTitleState struct {
2424
2525 func formatPaneTitle(processName, terminalTitle, fallback string) string {
2626 if processName != "" && terminalTitle != "" {
27- return processName + ": " + terminalTitle
27+ prefix := processName + ": "
28+ if strings.HasPrefix(terminalTitle, prefix) {
29+ return terminalTitle
30+ }
31+ return prefix + terminalTitle
2832 }
2933 if processName != "" {
3034 return processName
@@ -24,7 +24,11 @@ type paneTitleState struct {
24 24
25 func formatPaneTitle(processName, terminalTitle, fallback string) string {25 func formatPaneTitle(processName, terminalTitle, fallback string) string {
26 if processName != "" && terminalTitle != "" {26 if processName != "" && terminalTitle != "" {
27- return processName + ": " + terminalTitle27+ prefix := processName + ": "
28+ if strings.HasPrefix(terminalTitle, prefix) {
29+ return terminalTitle
30+ }
31+ return prefix + terminalTitle
28 }32 }
29 if processName != "" {33 if processName != "" {
30 return processName34 return processName
M internal/usecase/daemon/pane_titles_test.go +2 -1
@@ -16,7 +16,8 @@ func TestFormatPaneTitle(t *testing.T) {
1616 tests := []struct {
1717 name, process, terminal, fallback, want string
1818 }{
19- {name: "process and terminal", process: "nvim", terminal: "project/main.go", fallback: "sh", want: "nvim: project/main.go"},
19+ {name: "process prepends non-prefixed terminal title", process: "nvim", terminal: "project/main.go", fallback: "sh", want: "nvim: project/main.go"},
20+ {name: "process does not duplicate its terminal-title prefix", process: "zot", terminal: "zot: session title", fallback: "sh", want: "zot: session title"},
2021 {name: "process only", process: "nvim", fallback: "sh", want: "nvim"},
2122 {name: "terminal only", terminal: "project/main.go", fallback: "sh", want: "project/main.go"},
2223 {name: "fallback", fallback: "fish", want: "fish"},
@@ -16,7 +16,8 @@ func TestFormatPaneTitle(t *testing.T) {
16 tests := []struct {16 tests := []struct {
17 name, process, terminal, fallback, want string17 name, process, terminal, fallback, want string
18 }{18 }{
19- {name: "process and terminal", process: "nvim", terminal: "project/main.go", fallback: "sh", want: "nvim: project/main.go"},19+ {name: "process prepends non-prefixed terminal title", process: "nvim", terminal: "project/main.go", fallback: "sh", want: "nvim: project/main.go"},
20+ {name: "process does not duplicate its terminal-title prefix", process: "zot", terminal: "zot: session title", fallback: "sh", want: "zot: session title"},
20 {name: "process only", process: "nvim", fallback: "sh", want: "nvim"},21 {name: "process only", process: "nvim", fallback: "sh", want: "nvim"},
21 {name: "terminal only", terminal: "project/main.go", fallback: "sh", want: "project/main.go"},22 {name: "terminal only", terminal: "project/main.go", fallback: "sh", want: "project/main.go"},
22 {name: "fallback", fallback: "fish", want: "fish"},23 {name: "fallback", fallback: "fish", want: "fish"},

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