Currently, there are 4 ways to do this:
OSC 9 — iTerm2
OSC 99 — kitty
OSC 777;notify; — urxvt
OSC 1337;SetUserVar — iTerm2
Basically, you just need to put the notification text into the sequence parameter, but in kitty, the developer added a bunch of extra features on top of that.
OSC 9 is the oldest and most common version.
OSC 777 was recently implemented in Windows Terminal (WT):
microsoft/terminal#14425
microsoft/terminal#7718
https://t.me/far2l_ru/35282