Implement auto reload of config

This commit is contained in:
Kovid Goyal
2026-04-16 14:39:51 +05:30
parent efbfbb49f9
commit e9f3844f64
8 changed files with 29 additions and 4 deletions

View File

@@ -37,6 +37,7 @@ import (
"github.com/kovidgoyal/kitty/tools/cmd/update_self"
"github.com/kovidgoyal/kitty/tools/tui"
"github.com/kovidgoyal/kitty/tools/utils/images"
"github.com/kovidgoyal/kitty/tools/watch"
)
var _ = fmt.Print
@@ -135,7 +136,7 @@ func KittyToolEntryPoints(root *cli.Command) {
},
})
// __watch_conf__
watch.EntryPoint(root)
// __convert_image__
images.ConvertEntryPoint(root)
// __atexit__

View File

@@ -27,7 +27,9 @@ func watch_dirs(ctx context.Context, paths []string, debounce time.Duration, eve
fswatcher.WithCooldown(debounce),
}
for _, path := range paths {
opts = append(opts, fswatcher.WithPath(path))
if unix.Access(path, unix.R_OK|unix.X_OK) == nil {
opts = append(opts, fswatcher.WithPath(path))
}
}
w, err := fswatcher.New(opts...)
if err != nil {