mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-25 17:52:02 +02:00
Implement auto reload of config
This commit is contained in:
@@ -2393,6 +2393,15 @@ reloading the config is not supported.
|
||||
'''
|
||||
)
|
||||
|
||||
opt('auto_reload_config', '0.1', option_type='float', long_text='''
|
||||
Automatically reload configuration files when they are changed. The setting
|
||||
is the number of seconds to wait before reloading the config files. This allows
|
||||
multiple changes to be debounced. Use a negative value to disable automatic reload.
|
||||
You can manually reload with :sc:`reload_config_file`. Note that automatic
|
||||
reload works only if the :file:`kitty.conf` already exists when kitty is started.
|
||||
Changes to this setting by reloading configuration are ignored.
|
||||
''')
|
||||
|
||||
opt('startup_session', 'none',
|
||||
option_type='config_or_absolute_path',
|
||||
long_text='''
|
||||
|
||||
3
kitty/options/parse.py
generated
3
kitty/options/parse.py
generated
@@ -71,6 +71,9 @@ class Parser:
|
||||
|
||||
choices_for_allow_remote_control = frozenset(('password', 'socket-only', 'socket', 'no', 'n', 'false', 'yes', 'y', 'true'))
|
||||
|
||||
def auto_reload_config(self, val: str, ans: dict[str, typing.Any]) -> None:
|
||||
ans['auto_reload_config'] = float(val)
|
||||
|
||||
def background(self, val: str, ans: dict[str, typing.Any]) -> None:
|
||||
ans['background'] = to_color(val)
|
||||
|
||||
|
||||
2
kitty/options/types.py
generated
2
kitty/options/types.py
generated
@@ -53,6 +53,7 @@ option_names = (
|
||||
'allow_cloning',
|
||||
'allow_hyperlinks',
|
||||
'allow_remote_control',
|
||||
'auto_reload_config',
|
||||
'background',
|
||||
'background_blur',
|
||||
'background_image',
|
||||
@@ -527,6 +528,7 @@ class Options:
|
||||
allow_cloning: choices_for_allow_cloning = 'ask'
|
||||
allow_hyperlinks: int = 1
|
||||
allow_remote_control: choices_for_allow_remote_control = 'no'
|
||||
auto_reload_config: float = 0.1
|
||||
background: Color = Color(0, 0, 0)
|
||||
background_blur: int = 0
|
||||
background_image: tuple[str, ...] = ()
|
||||
|
||||
Reference in New Issue
Block a user