mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-18 06:25:13 +02:00
Fix conf watcher kitten not tracking changes to symlink targets
This commit is contained in:
@@ -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 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]
|
0.47.0 [2026-05-19]
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|||||||
@@ -94,6 +94,13 @@ func resolve_path(path string) string {
|
|||||||
return filepath.Clean(path)
|
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] {
|
func get_set_of_config_files(config_paths []string) *utils.Set[string] {
|
||||||
cp := config.ConfigParser{
|
cp := config.ConfigParser{
|
||||||
AllIncludedFiles: utils.NewSet[string](), LineHandler: func(k, v string) error { return nil }}
|
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).
|
// where /tmp -> /private/tmp causes mismatches with FSEvents-reported paths).
|
||||||
result := utils.NewSet[string](cp.AllIncludedFiles.Len() + len(config_paths)*4)
|
result := utils.NewSet[string](cp.AllIncludedFiles.Len() + len(config_paths)*4)
|
||||||
for _, p := range cp.AllIncludedFiles.AsSlice() {
|
for _, p := range cp.AllIncludedFiles.AsSlice() {
|
||||||
result.Add(resolve_path(p))
|
result.Add(safe_eval_symlinks(resolve_path(p)))
|
||||||
}
|
}
|
||||||
for _, path := range config_paths {
|
for _, path := range config_paths {
|
||||||
path = resolve_path(path)
|
path = resolve_path(path)
|
||||||
result.Add(path)
|
|
||||||
dir := filepath.Dir(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"} {
|
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
|
return result
|
||||||
|
|||||||
Reference in New Issue
Block a user