diff --git a/kittens/ask/main.py b/kittens/ask/main.py index 063894366..6f39e5a22 100644 --- a/kittens/ask/main.py +++ b/kittens/ask/main.py @@ -150,8 +150,8 @@ def __init__(self, cli_opts: AskCLIOptions) -> None: else: allowed = [] for choice in cli_opts.choices: - color = 'green' letter, text = choice.split(':', maxsplit=1) + color = '' if ';' in letter: letter, color = letter.split(';', maxsplit=1) letter = letter.lower() @@ -215,7 +215,8 @@ def commit_line(end: str = '\r\n') -> None: for letter, choice in self.choices.items(): text = choice.text[:choice.idx] - text += styled(choice.text[choice.idx], fg=choice.color) + color = choice.color or ('yellow' if letter == self.response else 'green') + text += styled(choice.text[choice.idx], fg=color) text += choice.text[choice.idx + 1:] text += ' ' sz = wcswidth(text)