Fix conf watcher kitten not tracking changes to symlink targets

This commit is contained in:
Kovid Goyal
2026-05-24 09:54:01 +05:30
parent dd136ba806
commit f2df2394ce
2 changed files with 12 additions and 3 deletions
+2
View File
@@ -182,6 +182,8 @@ Detailed list of changes
- Fix a regression in the previous release that broke automatic color scheme changes when using a background image (:iss:`10058`)
- Fix :opt:`auto_reload_config` not working when :file:`kitty.conf` is a symlink (:iss:`10066`)
0.47.0 [2026-05-19]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+10 -3
View File
@@ -94,6 +94,13 @@ func resolve_path(path string) string {
return filepath.Clean(path)
}
func safe_eval_symlinks(path string) string {
if q, err := filepath.EvalSymlinks(path); err == nil {
path = q
}
return path
}
func get_set_of_config_files(config_paths []string) *utils.Set[string] {
cp := config.ConfigParser{
AllIncludedFiles: utils.NewSet[string](), LineHandler: func(k, v string) error { return nil }}
@@ -102,14 +109,14 @@ func get_set_of_config_files(config_paths []string) *utils.Set[string] {
// where /tmp -> /private/tmp causes mismatches with FSEvents-reported paths).
result := utils.NewSet[string](cp.AllIncludedFiles.Len() + len(config_paths)*4)
for _, p := range cp.AllIncludedFiles.AsSlice() {
result.Add(resolve_path(p))
result.Add(safe_eval_symlinks(resolve_path(p)))
}
for _, path := range config_paths {
path = resolve_path(path)
result.Add(path)
dir := filepath.Dir(path)
result.Add(safe_eval_symlinks(path))
for _, q := range []string{"dark-theme.auto.conf", "light-theme.auto.conf", "no-preference-theme.auto.conf"} {
result.Add(resolve_path(filepath.Join(dir, q)))
result.Add(safe_eval_symlinks(resolve_path(filepath.Join(dir, q))))
}
}
return result