diff --git a/docs/desktop-notifications.rst b/docs/desktop-notifications.rst index e8a73318d..bd139f4c7 100644 --- a/docs/desktop-notifications.rst +++ b/docs/desktop-notifications.rst @@ -115,12 +115,16 @@ implementation supports. Currently, the following keys are defined: Key Value ======= ================================================================================ ``a`` Comma separated list of actions from the ``a`` key that the terminal - implements. If no actions are supported, the ``a`` key must be absent form the + implements. If no actions are supported, the ``a`` key must be absent from the query response. ``o`` Comma separated list of occassions from the ``o`` key that the terminal implements. If no occassions are supported, the value ``o=always`` must be sent in the query response. + +``u`` Comma separated list of urgency values that the terminal implements. + If urgency is not supported, the ``u`` key must be absent from the + query response. ======= ================================================================================ In the future, if this protocol expands, more keys might be added. Clients must diff --git a/kitty/notify.py b/kitty/notify.py index 65cf857b4..da201ce6b 100644 --- a/kitty/notify.py +++ b/kitty/notify.py @@ -143,7 +143,8 @@ def parse_osc_99(raw: str) -> NotificationCommand: if metadata == '?': actions = ','.join(x.name for x in Action) when = ','.join(x.name for x in OnlyWhen if x.value) - raise QueryResponse(f'99;?;a={actions}:o={when}') + urgency = ','.join(str(x.value) for x in Urgency) + raise QueryResponse(f'99;?;a={actions}:o={when}:u={urgency}') payload_is_encoded = False payload_type = 'title' if metadata: diff --git a/kitty_tests/parser.py b/kitty_tests/parser.py index a2f5f3ebd..b23a6fd0b 100644 --- a/kitty_tests/parser.py +++ b/kitty_tests/parser.py @@ -590,7 +590,7 @@ class TestParser(BaseTest): reset() h('?') self.assertFalse(notifications) - self.ae(query_responses, ['99;?;a=focus,report:o=always,unfocused,invisible']) + self.ae(query_responses, ['99;?;a=focus,report:o=always,unfocused,invisible:u=0,1,2']) def test_dcs_codes(self): s = self.create_screen()