mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-08-04 06:36:24 +00:00
Fix config file reloading not working is a system config file is set and no user config file is present at startup
Fixes #6801
This commit is contained in:
parent
2047ea8eec
commit
9a08489112
5 changed files with 12 additions and 5 deletions
|
|
@ -337,9 +337,10 @@ You can parse and read the options in your kitten using the following code:
|
|||
return ans
|
||||
|
||||
overrides = tuple(overrides) if overrides is not None else ()
|
||||
opts_dict, paths = _load_config(defaults, parse_config, merge_result_dicts, *paths, overrides=overrides)
|
||||
opts_dict, found_paths = _load_config(defaults, parse_config, merge_result_dicts, *paths, overrides=overrides)
|
||||
opts = Options(opts_dict)
|
||||
opts.config_paths = paths
|
||||
opts.config_paths = found_paths
|
||||
opts.all_config_paths = paths
|
||||
opts.config_overrides = overrides
|
||||
return opts
|
||||
|
||||
|
|
|
|||
|
|
@ -2574,7 +2574,7 @@ class Boss:
|
|||
from .cli import default_config_paths
|
||||
from .config import load_config
|
||||
old_opts = get_options()
|
||||
prev_paths = old_opts.config_paths or default_config_paths(self.args.config)
|
||||
prev_paths = old_opts.all_config_paths or default_config_paths(self.args.config)
|
||||
paths = paths or prev_paths
|
||||
bad_lines: List[BadLine] = []
|
||||
opts = load_config(*paths, overrides=old_opts.config_overrides if apply_overrides else None, accumulate_bad_lines=bad_lines)
|
||||
|
|
|
|||
|
|
@ -198,6 +198,8 @@ def generate_class(defn: Definition, loc: str) -> Tuple[str, str]:
|
|||
a(' ' + ', '.join(grp) + ',')
|
||||
a(' ))')
|
||||
|
||||
a(' config_paths: typing.Tuple[str, ...] = ()')
|
||||
a(' all_config_paths: typing.Tuple[str, ...] = ()')
|
||||
a(' config_paths: typing.Tuple[str, ...] = ()')
|
||||
a(' config_overrides: typing.Tuple[str, ...] = ()')
|
||||
a('')
|
||||
|
|
|
|||
|
|
@ -164,7 +164,8 @@ def load_config(*paths: str, overrides: Optional[Iterable[str]] = None, accumula
|
|||
from .options.parse import merge_result_dicts
|
||||
|
||||
overrides = tuple(overrides) if overrides is not None else ()
|
||||
opts_dict, paths = _load_config(defaults, partial(parse_config, accumulate_bad_lines=accumulate_bad_lines), merge_result_dicts, *paths, overrides=overrides)
|
||||
opts_dict, found_paths = _load_config(
|
||||
defaults, partial(parse_config, accumulate_bad_lines=accumulate_bad_lines), merge_result_dicts, *paths, overrides=overrides)
|
||||
opts = Options(opts_dict)
|
||||
|
||||
opts.alias_map = build_action_aliases(opts.kitten_alias, 'kitten')
|
||||
|
|
@ -179,7 +180,8 @@ def load_config(*paths: str, overrides: Optional[Iterable[str]] = None, accumula
|
|||
if opts.background_opacity < 1.0 and opts.macos_titlebar_color > 0:
|
||||
log_error('Cannot use both macos_titlebar_color and background_opacity')
|
||||
opts.macos_titlebar_color = 0
|
||||
opts.config_paths = paths
|
||||
opts.config_paths = found_paths
|
||||
opts.all_config_paths = paths
|
||||
opts.config_overrides = overrides
|
||||
return opts
|
||||
|
||||
|
|
|
|||
2
kitty/options/types.py
generated
2
kitty/options/types.py
generated
|
|
@ -663,6 +663,8 @@ class Options:
|
|||
0xa8a8a8, 0xb2b2b2, 0xbcbcbc, 0xc6c6c6, 0xd0d0d0, 0xdadada, 0xe4e4e4, 0xeeeeee,
|
||||
))
|
||||
config_paths: typing.Tuple[str, ...] = ()
|
||||
all_config_paths: typing.Tuple[str, ...] = ()
|
||||
config_paths: typing.Tuple[str, ...] = ()
|
||||
config_overrides: typing.Tuple[str, ...] = ()
|
||||
|
||||
def __init__(self, options_dict: typing.Optional[typing.Dict[str, typing.Any]] = None) -> None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue