Discard OSC 9 notifications that start with 4;
Some misguided software is using it for "progress reporting". OSC 9 has a decade plus history of being used for notifications but because Windows Terminal decided to use it for progress reporting, without bothering to do research about conflicting existing uses, systemd of all things wants to adopt it!! Crazy world we live in. Since actual notifications are highly unlikely to start with 4; we hopefully don't break any real world use cases and also don't let systemd spam our users with endless notifications. Fixes #8011
This commit is contained in:
parent
15b5a9cfbd
commit
847433dba2
2 changed files with 12 additions and 0 deletions
|
|
@ -84,6 +84,11 @@ consumption to do the same tasks.
|
|||
Detailed list of changes
|
||||
-------------------------------------
|
||||
|
||||
0.37.1 [future]
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Discard OSC 9 notifications that start with :code:`4;` because some misguided software is using it for "progress reporting" (:iss:`8011`)
|
||||
|
||||
0.37.0 [2024-10-30]
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
|
|
|||
|
|
@ -1095,6 +1095,13 @@ def desktop_notify(self, osc_code: int, raw_datab: memoryview) -> None:
|
|||
log_error(f'Ignoring unknown OSC 777: {raw_data}')
|
||||
return # unknown OSC 777
|
||||
raw_data = raw_data[len('notify;'):]
|
||||
if osc_code == 9 and raw_data.startswith('4;'):
|
||||
# This is probably the Windows Terminal "progress reporting" conflicting
|
||||
# implementation which sadly some thoughtless people have
|
||||
# implemented in unix CLI programs. So ignore it rather than
|
||||
# spamming the user with continuous notifications. See for example:
|
||||
# https://github.com/kovidgoyal/kitty/issues/8011
|
||||
return
|
||||
get_boss().notification_manager.handle_notification_cmd(self.id, osc_code, raw_data)
|
||||
|
||||
def on_mouse_event(self, event: dict[str, Any]) -> bool:
|
||||
|
|
|
|||
Loading…
Reference in a new issue