kovidgoyal / kitty

Cross-platform, fast, feature-rich, GPU based terminal
https://sw.kovidgoyal.net/kitty/
GNU General Public License v3.0
23.9k stars 965 forks source link

Support for OSC 176 - Custom App ID #7687

Closed delthas closed 1 month ago

delthas commented 1 month ago

TL;DR: Implementing this specification: https://gist.github.com/delthas/d451e2cc1573bb2364839849c7117239

The goal is to enable a long-lived terminal app to have standalone app "semantics".

Consider a terminal IM client, or a terminal email client, that users start and leave open in their own window for days. With this spec, the IM client can tell kitty to set its app ID to that of the IM client, then automatically resulting in the following changes:

This effectively enables long-running terminal programs to have "app" semantics.

This is done with a simple best-effort OSC, with get & set.

Happy to clarify the use case more if needed.

It's a fairly small change, see the foot MR: https://codeberg.org/dnkl/foot/pulls/1481/files and vaxis MR (TUI library): https://git.sr.ht/~rockorager/vaxis/commit/b1a4e20726c8c86e3f9a559e307c0a487688d6ca

kovidgoyal commented 1 month ago

That's extremely Linux specific, and indeed desktop environment specific.

If you want the spec adopted more widely than Linux specific terminals you need to come up with some minimum set of things that can be reasonably implemented in a cross platform manner.

1) Window and Application and notification icons cannot be changed dynamically on macOS or even some Wayland compositors. Application ids are determined statically by bundle identifiers and cannot be set at runtime (there are some hacky workarounds but the OS really doesnt want you doing that).

2) Given all the security theatre that goes on in Wayland I doubt very much the larger Wayland ecosystem will be OK with allowing one application to present itself as another dynamically.

3) On X11 there is no appid there is WM_CLASS and WM_NAME and a window icon that are all separate. For your proposal to work on anything other than Wayland robustly you would need transmit the icon to the terminal emulator. Remember terminal apps often dont even run on the same computer as the terminal emulator.

kovidgoyal commented 1 month ago

No followup