Merge branch 'fix-set-colors-err-msg' of https://github.com/page-down/kitty

This commit is contained in:
Kovid Goyal 2021-11-03 11:42:52 +05:30
commit 68ad513dd5
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 8 additions and 1 deletions

View File

@ -1875,7 +1875,11 @@ class Boss:
except (Exception, SystemExit) as err:
self.show_error('Invalid set_colors mapping', str(err))
return
payload = c.message_to_kitty(parse_rc_args([])[0], opts, items)
try:
payload = c.message_to_kitty(parse_rc_args([])[0], opts, items)
except (Exception, SystemExit) as err:
self.show_error('Failed to set colors', str(err))
return
c.response_from_kitty(self, self.active_window, PayloadGetter(c, payload if isinstance(payload, dict) else {}))
def _move_window_to(

View File

@ -5,6 +5,7 @@
import os
from typing import TYPE_CHECKING, Dict, Iterable, Optional
from kitty.cli import emph
from kitty.config import parse_config
from kitty.fast_data_types import patch_color_profiles, Color
@ -95,6 +96,8 @@ this option, any color arguments are ignored and --configured and --all are impl
if not opts.reset:
try:
final_colors = parse_colors(args)
except FileNotFoundError as err:
raise ParsingOfArgsFailed(f'The colors configuration file {emph(err.filename)} was not found.') from err
except Exception as err:
raise ParsingOfArgsFailed(str(err)) from err
ans = {