<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/osc.c, branch 1.18.1</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=1.18.1</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=1.18.1'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2024-08-14T06:53:45Z</updated>
<entry>
<title>osc: regression: fix OSC-111 handling of alpha changes</title>
<updated>2024-08-14T06:53:45Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-08-14T06:50:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=2896c1898127256193d49c80a56ba7188fad0e33'/>
<id>urn:sha1:2896c1898127256193d49c80a56ba7188fad0e33</id>
<content type='text'>
When the background alpha changes from fully opaque, to transparent,
or vice versa, we need to do more than just repaint the affected
cells.

For example, we need to create new surfaces with the correct pixel
format.

OSC-11 (set background color) already does this, but the same alpha
checking logic was missing in OSC-111 (reset background color).

Fixes #1801
</content>
</entry>
<entry>
<title>osc: kitty: update 's' to the latest spec</title>
<updated>2024-08-09T06:25:36Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-08-09T06:25:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=ee9c76ded00de9beac698d2bd4771e8c1d966c6a'/>
<id>urn:sha1:ee9c76ded00de9beac698d2bd4771e8c1d966c6a</id>
<content type='text'>
* The spec now defines a couple of "standard" names. Translate these
  to the freedesktop compliant names.
* The query response no longer contains 'xdg-names', but instead list
  the supported standard names.
</content>
</entry>
<entry>
<title>osc: kitty notifications: add support for XDG sound names</title>
<updated>2024-08-04T13:23:31Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-08-04T13:21:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=84d36606cbd3e35aae6a68e69101b22da60dbe99'/>
<id>urn:sha1:84d36606cbd3e35aae6a68e69101b22da60dbe99</id>
<content type='text'>
</content>
</entry>
<entry>
<title>osc: kitty notifications: implement s=silent</title>
<updated>2024-08-04T12:20:35Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-08-04T12:16:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=63492624918cd23a5efdd9b8a8b4f057da66d961'/>
<id>urn:sha1:63492624918cd23a5efdd9b8a8b4f057da66d961</id>
<content type='text'>
This implements part of the new 's' (sound) parameter; the 'silent'
value. When s=silent, we set the ${muted} template argument to
"true". It is intended to set the 'suppress-sound' hint:

    notify-send --hint BOOLEAN:suppress-sound:${muted}
</content>
</entry>
<entry>
<title>Merge branch 'xstrjoin3'</title>
<updated>2024-08-03T09:42:37Z</updated>
<author>
<name>Craig Barnes</name>
<email>craigbarnes@protonmail.com</email>
</author>
<published>2024-08-03T09:42:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=b27841e1b590f91c9de21bb694909211421e5f96'/>
<id>urn:sha1:b27841e1b590f91c9de21bb694909211421e5f96</id>
<content type='text'>
</content>
</entry>
<entry>
<title>osc: kitty notifications: ignore invalid IDs</title>
<updated>2024-08-03T09:05:58Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-08-03T09:05:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=6b72108ee220dd64a3ff5a43a6c84d99078da62e'/>
<id>urn:sha1:6b72108ee220dd64a3ff5a43a6c84d99078da62e</id>
<content type='text'>
Notification IDs must only use characters from [a-zA-Z0-9_-+.]

    Terminals **must** sanitize ids received from client programs
    before sending them back in responses, to mitigate input injection
    based attacks. That is, they must either reject ids containing
    characters not from the above set, or remove bad characters when
    reading ids sent to them.

Foot implements the first: reject IDs containing characters not from
the above set.
</content>
</entry>
<entry>
<title>xmalloc: remove delim param from xstrjoin() and add separate xstrjoin3()</title>
<updated>2024-08-03T07:51:06Z</updated>
<author>
<name>Craig Barnes</name>
<email>craigbarnes@protonmail.com</email>
</author>
<published>2024-08-03T07:12:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=f87c9bb9f70f1a6c8c7081c762c15ba7eaaf971e'/>
<id>urn:sha1:f87c9bb9f70f1a6c8c7081c762c15ba7eaaf971e</id>
<content type='text'>
This avoids the need for an unused third argument for most xstrjoin()
calls and replaces the cases where it's needed with a more flexible
function. Code generation is the same in both cases, when there are 2
string params and a compile-time known delimiter.

This commit also converts 4 uses of xasprintf() to use xstrjoin*().

See also: https://godbolt.org/z/xsjrhv9b6
</content>
</entry>
<entry>
<title>osc: kitty notifications: cleanup and update to latest version of spec</title>
<updated>2024-08-02T06:07:13Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-08-02T06:07:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=ea2f0e7c3f29f2ba83ad71e36c6751bb571f826f'/>
<id>urn:sha1:ea2f0e7c3f29f2ba83ad71e36c6751bb571f826f</id>
<content type='text'>
* Don't store a list of unfinished notifications. Use a single one. If
  the notification ID of the 'current' notification doesn't match the
  previous, unfinished one, the 'current' notification replaces the
  previous one, instead of updating it.

* Update xstrjoin() to take an optional delimiter (for example ','),
  and use that when joining categories and 'alive IDs'.

* Rename ${action-arg} to ${action-argument}

* Update handling of the 'n' parameter (symbolic icon name); the spec
  allows it to be used multiple times, and the terminal is supposed to
  pick the first one it can resolve. Foot can't resolve icons at all,
  neither can 'notify-send' or 'fyi' (which is what foot typically
  executes to display a notification); it's the notification daemon that
  resolves icons.

  The spec _could_ be interpreted to mean the terminal should lookup
  .desktop files, and use the value of the 'Icon' key from the first
  matching .desktop files. But foot doesn't read .desktop files, and I
  don't intend to implement XDG directory scanning and parsing of
  .desktop files just to figure out which icon to use.

  Instead, use a simple heuristics; use the *shortest* symbolic
  names. The idea is pretty simple: plain icon names are typically
  shorter than .desktop file IDs.
</content>
</entry>
<entry>
<title>osc: kitty notifications: buttons, icons, app-name, categories etc</title>
<updated>2024-07-31T14:22:17Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-07-31T14:22:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=76ac910b118147beba276748d2e2aaca0ee066de'/>
<id>urn:sha1:76ac910b118147beba276748d2e2aaca0ee066de</id>
<content type='text'>
First, icons have been finalized in the specification. There were only
three things we needed to adjust:

* symbolic names are base64 encoded
* there are a couple of OSC-99 defined symbolic names that need to be
  translated to the corresponding XDG icon name.
* allow in-band icons without a cache ID (that is, allow applications
  to use p=icon without having to cache the icon first).

Second, add support for the following new additions to the protocol:

* 'f': custom app-name, overrides the terminal's app-id
* 't': categories
* 'p=alive': lets applications poll for currently active notifications
* 'id' is now 'unset' by default, rather than "0"
* 'w': expire time (i.e. notification timeout)
* "buttons": aka actions. This lets applications add additional (to
  the terminal defined "default" action) actions. The 'activated' event
  has been updated to report which button/action was used to activate
  the notification.

To support button/actions, desktop-notifications.command had to be
reworked a bit.

There's now a new config option:
desktop-notifications.command-action-arg. It has two template
arguments ${action-name} and ${action-label}.

command-action-arg gets expanded for *each* action.

${action-name} and ${action-label} has been replaced by ${action-arg}
in command. This is a somewhat special template, in that it gets
replaced by *all* instances of the expanded actions.
</content>
</entry>
<entry>
<title>notify: close notification by sending SIGINT to helper</title>
<updated>2024-07-26T14:28:47Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-07-26T14:23:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=9cf99ea4bffd667ae59e4328a28b86dcefacb3f4'/>
<id>urn:sha1:9cf99ea4bffd667ae59e4328a28b86dcefacb3f4</id>
<content type='text'>
If the user hasn't configured a custom 'desktop-notifications.close'
command, try to close the notification by sending SIGINT to the
notification helper.

This is best-effort:

* If there's no helper running, we do nothing (except warn)
* We don't verify, in any way, the notification is actually closed
* We don't send any other signals, under any circumstances. That is,
  no SIGTERM, no SIGKILL. Ever.
</content>
</entry>
<entry>
<title>osc: kitty notifications: implement the 'close' request</title>
<updated>2024-07-25T17:24:28Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-07-25T17:24:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=c4d9f8a8ff4d65b43defb8d63e775e8b91f82bed'/>
<id>urn:sha1:c4d9f8a8ff4d65b43defb8d63e775e8b91f82bed</id>
<content type='text'>
Add a new config option, desktop-notifications.close, defining what to
execute to close a notification. It has a single template parameter,
${id}, that is expanded to the external notification ID foot may have
picked up from the notification helper.

notify-send does not support closing notifications, and it appears
impossible to pass an *unsigned* integer as argument to gdbus. Hence
no default value for the new 'close' option.

Example:

    printf '\e]99;i=123;this is a notification\e\\'
    printf '\e]99;i=123:p=close;\e\\'
</content>
</entry>
<entry>
<title>osc: kitty notification: implement 'close' events</title>
<updated>2024-07-25T16:47:23Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-07-25T16:47:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=c7972229305cfa76d402507a852af321198fdd2c'/>
<id>urn:sha1:c7972229305cfa76d402507a852af321198fdd2c</id>
<content type='text'>
Application can now request to receive a 'close' event when the
notification is closed (but not necessarily activated), by adding
'c=1' to the notification request.
</content>
</entry>
<entry>
<title>notify: rename 'report' -&gt; 'report_activated'</title>
<updated>2024-07-25T16:45:58Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-07-25T16:35:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=d53f0aea7560c71c8262c7688bdf7735d5b3fa26'/>
<id>urn:sha1:d53f0aea7560c71c8262c7688bdf7735d5b3fa26</id>
<content type='text'>
</content>
</entry>
<entry>
<title>osc+notify: strcmp() -&gt; streq()</title>
<updated>2024-07-24T14:04:14Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-07-24T14:04:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=a6bc9cafafd2edb2d88286cbdf4e57e331a86347'/>
<id>urn:sha1:a6bc9cafafd2edb2d88286cbdf4e57e331a86347</id>
<content type='text'>
</content>
</entry>
<entry>
<title>osc: kitty notifications: don't include '?' in the query reply</title>
<updated>2024-07-24T13:58:19Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-07-24T13:58:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=24168ed86ecf20a44f6dce8bdacfcb2c1471844b'/>
<id>urn:sha1:24168ed86ecf20a44f6dce8bdacfcb2c1471844b</id>
<content type='text'>
No need to say we support queries, in the query reply...
</content>
</entry>
<entry>
<title>osc: kitty notifications: implement query</title>
<updated>2024-07-23T16:32:23Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-07-23T16:32:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=70b4638a754048eeffc877405222d4750c3ea548'/>
<id>urn:sha1:70b4638a754048eeffc877405222d4750c3ea548</id>
<content type='text'>
</content>
</entry>
<entry>
<title>osc: remove unused includes</title>
<updated>2024-07-23T13:28:47Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-07-23T13:28:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=e59efb12332c8e0427a97d22980376fd9e81e7b7'/>
<id>urn:sha1:e59efb12332c8e0427a97d22980376fd9e81e7b7</id>
<content type='text'>
</content>
</entry>
<entry>
<title>osc: cleanup</title>
<updated>2024-07-23T10:12:38Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-07-23T10:12:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=efa5b9cea639f08ef2b9a9eb0ce6179af98ebd80'/>
<id>urn:sha1:efa5b9cea639f08ef2b9a9eb0ce6179af98ebd80</id>
<content type='text'>
</content>
</entry>
<entry>
<title>notify: separate active notifications from unfinished kitty notifications</title>
<updated>2024-07-23T09:53:30Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-07-23T09:53:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=b3108e1ad23387327d6cc7ebfdb20307878dd5c3'/>
<id>urn:sha1:b3108e1ad23387327d6cc7ebfdb20307878dd5c3</id>
<content type='text'>
This fixes an issue where it wasn't possible to trigger multiple
notifications with the same kitty notification ID. This is something
that works in kitty, and there's no reason why it shouldn't work.

The issue was that we track stdout, and the notification helper's PID
in the notification struct. Thus, when a notification is being
displayed, we can't re-use the same notification struct instance for
another notification.

This patch fixes this by adding a new notification list,
'active_notifications'. Whenever we detect that we need to track the
helper (notification want's to either focus the window on activation,
or send an event to the application), we add a copy of the
notification to the 'active' list.

The notification can then be removed from the 'kitty' list, allowing
kitty notifications to re-use the same ID over and over again, even if
old notifications are still being displayed.
</content>
</entry>
<entry>
<title>osc: kitty notifications: updated support for icons</title>
<updated>2024-07-23T09:29:05Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-07-23T09:29:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=ccb184ae645cd92a6e3aba429ab88a94a09bbf8c'/>
<id>urn:sha1:ccb184ae645cd92a6e3aba429ab88a94a09bbf8c</id>
<content type='text'>
This implements the suggested protocol discussed in
https://github.com/kovidgoyal/kitty/issues/7657.

Icons are handled by loading a cache. Both in-band PNG data, and
symbolic names are allowed.

Applications use a graphical ID to reference the icon both when
loading the cache, and when showing a notification.

* 'g' is the graphical ID
* 'n' is optional, and assigns a symbolic name to the icon
* 'p=icon' - the payload is icon PNG data. It needs to be base64
  encoded, but this is *not* implied. I.e. the application *must* use
  e=1 explicitly.

To load an icon (in-band PNG data):

    printf '\e]99;g=123:p=icon;&lt;base64-encoded-png-data&gt;\e\\'

or (symbolic name)

    printf '\e]99;g=123:n=firefox:p=icon;\e\\'

Of course, we can combine the two, assigning *both* a symbolic
name, *and* PNG data:

    printf '\e]99;g=123:n=firefox:p=icon;&lt;base64-encoded-png&gt;\e\\'

Then, to use the icon in a notification:

    printf '\e]99;g=123;this is a notification\e\\'

Foot also allows a *symbolic* icon to be defined and used at the same
time:

    printf '\e]99;g=123:n=firefox;this is a notification\e\\'

This obviously won't work with PNG data, since it uses the payload
portion of the escape sequence.
</content>
</entry>
</feed>
