detached 0ae115b

Use XDG_STATE_HOME on all platforms

Check XDG_STATE_HOME first to determine zot's home
on all platforms, if not set, use platform specific values.
commit
0ae115b1cccb14c5f2f195cea4e9db2763ce3723
author
Eckhart Koeppen · · 2026-07-06 10:44 UTC
committer
Eckhart Köppen · · 2026-07-12 05:19 UTC
parent
dbd0dfa
signature
unsigned
2 files · +6 -6
M examples/extensions/mcp-bridge/config.go +3 -3
@@ -47,6 +47,9 @@ func zotHome() string {
4747 if h := os.Getenv("ZOT_HOME"); h != "" {
4848 return h
4949 }
50+ if xdg := os.Getenv("XDG_STATE_HOME"); xdg != "" {
51+ return filepath.Join(xdg, "zot")
52+ }
5053 switch runtime.GOOS {
5154 case "darwin":
5255 home, _ := os.UserHomeDir()
@@ -54,9 +57,6 @@ func zotHome() string {
5457 case "windows":
5558 return filepath.Join(os.Getenv("APPDATA"), "zot")
5659 default: // linux, freebsd, etc.
57- if xdg := os.Getenv("XDG_STATE_HOME"); xdg != "" {
58- return filepath.Join(xdg, "zot")
59- }
6060 home, _ := os.UserHomeDir()
6161 return filepath.Join(home, ".local", "state", "zot")
6262 }
@@ -47,6 +47,9 @@ func zotHome() string {
47 if h := os.Getenv("ZOT_HOME"); h != "" {47 if h := os.Getenv("ZOT_HOME"); h != "" {
48 return h48 return h
49 }49 }
50+ if xdg := os.Getenv("XDG_STATE_HOME"); xdg != "" {
51+ return filepath.Join(xdg, "zot")
52+ }
50 switch runtime.GOOS {53 switch runtime.GOOS {
51 case "darwin":54 case "darwin":
52 home, _ := os.UserHomeDir()55 home, _ := os.UserHomeDir()
@@ -54,9 +57,6 @@ func zotHome() string {
54 case "windows":57 case "windows":
55 return filepath.Join(os.Getenv("APPDATA"), "zot")58 return filepath.Join(os.Getenv("APPDATA"), "zot")
56 default: // linux, freebsd, etc.59 default: // linux, freebsd, etc.
57- if xdg := os.Getenv("XDG_STATE_HOME"); xdg != "" {
58- return filepath.Join(xdg, "zot")
59- }
60 home, _ := os.UserHomeDir()60 home, _ := os.UserHomeDir()
61 return filepath.Join(home, ".local", "state", "zot")61 return filepath.Join(home, ".local", "state", "zot")
62 }62 }
M packages/agent/config.go +3 -3
@@ -108,6 +108,9 @@ func ZotHome() string {
108108 if v := os.Getenv("ZOT_HOME"); v != "" {
109109 return v
110110 }
111+ if v := os.Getenv("XDG_STATE_HOME"); v != "" {
112+ return filepath.Join(v, "zot")
113+ }
111114 switch runtime.GOOS {
112115 case "darwin":
113116 if home, err := os.UserHomeDir(); err == nil {
@@ -118,9 +121,6 @@ func ZotHome() string {
118121 return filepath.Join(v, "zot")
119122 }
120123 }
121- if v := os.Getenv("XDG_STATE_HOME"); v != "" {
122- return filepath.Join(v, "zot")
123- }
124124 if home, err := os.UserHomeDir(); err == nil {
125125 return filepath.Join(home, ".local", "state", "zot")
126126 }
@@ -108,6 +108,9 @@ func ZotHome() string {
108 if v := os.Getenv("ZOT_HOME"); v != "" {108 if v := os.Getenv("ZOT_HOME"); v != "" {
109 return v109 return v
110 }110 }
111+ if v := os.Getenv("XDG_STATE_HOME"); v != "" {
112+ return filepath.Join(v, "zot")
113+ }
111 switch runtime.GOOS {114 switch runtime.GOOS {
112 case "darwin":115 case "darwin":
113 if home, err := os.UserHomeDir(); err == nil {116 if home, err := os.UserHomeDir(); err == nil {
@@ -118,9 +121,6 @@ func ZotHome() string {
118 return filepath.Join(v, "zot")121 return filepath.Join(v, "zot")
119 }122 }
120 }123 }
121- if v := os.Getenv("XDG_STATE_HOME"); v != "" {
122- return filepath.Join(v, "zot")
123- }
124 if home, err := os.UserHomeDir(); err == nil {124 if home, err := os.UserHomeDir(); err == nil {
125 return filepath.Join(home, ".local", "state", "zot")125 return filepath.Join(home, ".local", "state", "zot")
126 }126 }

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 1

Tags 476

↑↓ moveenter openesc close