Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restart config monitor on file reload #7981

Open
tllilleh opened this issue May 15, 2024 · 9 comments
Open

Restart config monitor on file reload #7981

tllilleh opened this issue May 15, 2024 · 9 comments

Comments

@tllilleh
Copy link

Making changes to a configuration file that is imported by the main alacritty.toml file do not trigger an automatic config reload.

In order to get the changes without restarting alacritty I normally just do something like touch ~/.config/alacritty/alacritty.toml.

System

OS: Linux
Version: alacritty 0.13.2 (bb8ea18)

@kchibisov
Copy link
Member

you need to touch imported files and not the main one to reload them.

@tllilleh
Copy link
Author

If I modify (or touch) the toml file being imported (say theme.toml), it does not auto reload the config (as I believe it should). Instead, I need to touch the top level config (alacritty.toml) for it reload the changes I made in theme.toml

@chrisduerr
Copy link
Member

Any symlinking involved? It works just fine for me.

@tllilleh
Copy link
Author

My entire ~/.config/alacritty directory is a symlink to my dotfiles directory:

lrwxrwxrwx 1 tllilleh tllilleh 39 May 14 10:13 alacritty -> ../dotfiles/alacritty/.config/alacritty/

But inside the alacritty directory there are no symlinks:

$ ll -R
.:
total 16
drwxrwxr-x 3 tllilleh tllilleh 4096 May 15 15:19 ./
drwxrwxr-x 3 tllilleh tllilleh 4096 May 14 10:11 ../
-rw-rw-r-- 1 tllilleh tllilleh  576 May 15 17:24 alacritty.toml
drwxrwxr-x 2 tllilleh tllilleh 4096 May 15 17:24 themes/

./themes:
total 28
drwxrwxr-x 2 tllilleh tllilleh 4096 May 15 17:24 ./
drwxrwxr-x 3 tllilleh tllilleh 4096 May 15 15:19 ../
-rw-rw-r-- 1 tllilleh tllilleh  711 May 15 16:39 base16.toml
-rw-rw-r-- 1 tllilleh tllilleh  494 May 15 08:54 everforest_dark.toml
-rw-rw-r-- 1 tllilleh tllilleh  573 May 15 08:56 gruvbox_dark.toml
-rw-rw-r-- 1 tllilleh tllilleh  638 May 15 17:24 kanagawa_dragon.toml
-rw-rw-r-- 1 tllilleh tllilleh  556 May 15 08:54 zenburn.toml

@chrisduerr
Copy link
Member

chrisduerr commented May 16, 2024

Does it work without any symlinks?

Nvm, I managed to reproduce without symlinks.

@chrisduerr
Copy link
Member

Is it accurate to say you added the import after starting Alacritty? Config imports are only monitored if the import is present at startup.

@tllilleh
Copy link
Author

Is it accurate to say you added the import after starting Alacritty? Config imports are only monitored if the import is present at startup.

Yes, that seems to be the issue. If I restart alacritty now changes to my theme files are auto reloaded.

@chrisduerr chrisduerr changed the title Automatic config reload does not work with imported config files. Restart config monitor on file reload May 16, 2024
@chrisduerr
Copy link
Member

I think there's two reasonable options here, both of which should work fine:

  1. Shut down config monitor when the imports change
  2. Notify the config monitor about changes to specific files (add/remove)

@ksolowoniuk
Copy link

My config imports a theme file but live_config_reload doesn't work and doesn't work if I comment out the import??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants