shell-pool / shpool

Think tmux, then aim... lower
Apache License 2.0
1.03k stars 13 forks source link

shpool should immediately pick up changes when a new config file is created #29

Closed ethanpailes closed 22 hours ago

ethanpailes commented 3 weeks ago

Currently, we use inotify to watch the config file and update it whenever a user makes an edit, but if the config file does not exist we don't set up any watchers. This is sad because it means that users with no setting miss out on their settings getting immediately picked up if they want to make a change.

The simplest fix for this is probably just to autocreate an empty config file on first startup if it does not exist. We could also watch for the file getting created via an inotify watcher on the directory.

Aetf commented 1 week ago

Working on this one now. It is indeed possible to add watches for parent directory (and parent of parent) to get creation events.

Note that after a directory being deleted, the watch needs to be re-added.