<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/terminal.c, branch 1.20.2</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=1.20.2</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=1.20.2'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2025-01-18T08:24:00Z</updated>
<entry>
<title>term: cursor_refresh(): don't try to dirty the grid if we don't have one</title>
<updated>2025-01-18T08:24:00Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-01-09T06:49:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=c5529808c4f13c5bd30594055563b83e1db61dfd'/>
<id>urn:sha1:c5529808c4f13c5bd30594055563b83e1db61dfd</id>
<content type='text'>
If the compositor sends a keyboard enter event before our window has
been mapped, foot crashes; the enter event triggers a cursor
refresh (hollow -&gt; non-hollow block cursor), which crashes since we
haven't yet allocated a grid.

Fix by no-op:ing the refresh if the window hasn't been configured yet.

Closes #1910
</content>
</entry>
<entry>
<title>terminal: Refresh only overlay when flash expires</title>
<updated>2025-01-18T08:23:40Z</updated>
<author>
<name>Alexander Orzechowski</name>
<email>alex@ozal.ski</email>
</author>
<published>2025-01-05T02:59:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=ab5a168dbffb63e17c9067133ab55c97d800ef1d'/>
<id>urn:sha1:ab5a168dbffb63e17c9067133ab55c97d800ef1d</id>
<content type='text'>
If we call render_refresh, that will wait for a callback to the main
surface. In the case of a flash, the main surface might not get callbacks
if the compositor implements fancy culling optimizations like wlroots
wlr_scene compositors such as sway version &gt;=1.10.
</content>
</entry>
<entry>
<title>term: limit app-id to 2048 characters</title>
<updated>2025-01-02T07:58:48Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-01-02T07:58:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=c7ab7b353996634c61abd7cd66d32459a6e3da4e'/>
<id>urn:sha1:c7ab7b353996634c61abd7cd66d32459a6e3da4e</id>
<content type='text'>
Unsure if the protocol imposes a limit (haven't found any
documentation), or if the issue is in the libwayland implementation,
or wlroots (triggers in at least sway+river).

The issue is that setting a too long app-id causes the
compositor (river at least) to peg the CPU at 100%, and stop sending
e.g. frame callbacks to foot.

Closes #1897
</content>
</entry>
<entry>
<title>term: set_app_id() + set_window_title(): only allow printable characters</title>
<updated>2024-12-17T10:01:17Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-12-17T10:01:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=d523e7a676d6d2cdda0369fac3dc9f953d3a4e96'/>
<id>urn:sha1:d523e7a676d6d2cdda0369fac3dc9f953d3a4e96</id>
<content type='text'>
</content>
</entry>
<entry>
<title>box-drawings: implement octants</title>
<updated>2024-12-08T11:55:57Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-12-08T08:05:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=9a1b59adaec22434473789953884c9b6db58e9a5'/>
<id>urn:sha1:9a1b59adaec22434473789953884c9b6db58e9a5</id>
<content type='text'>
</content>
</entry>
<entry>
<title>term: get_font_dpi(): remove invalid assertion</title>
<updated>2024-11-24T07:01:31Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-11-24T07:01:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=256749c6d0ae0a26ad93c973e2e5623213807bdb'/>
<id>urn:sha1:256749c6d0ae0a26ad93c973e2e5623213807bdb</id>
<content type='text'>
Closes #1874
</content>
</entry>
<entry>
<title>osc: OSC-1 does not set the icon, it sets the icon _label_</title>
<updated>2024-09-13T07:04:18Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-09-13T06:51:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=7984f08925e18e24e6b54ac4498d65fa26b2a4d6'/>
<id>urn:sha1:7984f08925e18e24e6b54ac4498d65fa26b2a4d6</id>
<content type='text'>
In fact, there appears there *is* no escape sequence to set the icon.

Keep most of the logic in place, but in practice, we'll always set the
icon to the app-id. That is, at startup, we set it to the configured
app-id (either from config, or the command line).

OSC-176, which sets the app-id, also updates the icon (to the app-id).
</content>
</entry>
<entry>
<title>toplevel-icon: implement OSC-1, CSI 20/21/22/23 t</title>
<updated>2024-09-13T07:04:17Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-09-10T16:53:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=97ec375c67cc7b071b0478b6c887057008dc469e'/>
<id>urn:sha1:97ec375c67cc7b071b0478b6c887057008dc469e</id>
<content type='text'>
* The toplevel icon is now set to the app-id, unless "overridden" by
  OSC-1 or OSC-0.
* Implemented OSC-1
* OSC-0 extended to also set the icon
* Implemented CSI 20 t - report window icon
* Implemented CSI 21 t - report window title
* Implemented CSI 22 ; 1 t - push window icon
* Implemented CS 23 ; 1 t - pop window icon
* Extended CSI 22/23 ; 0 t to also push/pop the icon
* Verify app-id set by OSC-176 is valid UTF-8
* Verify icon set by OSC-0/1 is valid UTF-8
</content>
</entry>
<entry>
<title>xsnprintf: various improvements related to xvsnprintf() and xsnprintf()</title>
<updated>2024-09-13T07:01:15Z</updated>
<author>
<name>Craig Barnes</name>
<email>craigbarnes@protonmail.com</email>
</author>
<published>2024-09-11T19:13:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=d4a1283797b5a964d92e64c698d65f701a90e1cc'/>
<id>urn:sha1:d4a1283797b5a964d92e64c698d65f701a90e1cc</id>
<content type='text'>
Summary of changes:

* Make xvsnprintf() static
* restrict-qualify pointer arguments (as done by the libc equivalents)
* Make comments and spec references more thorough
* Remove pointless `n &lt;= INT_MAX` assertion (see comment)
* Use FATAL_ERROR() instead of xassert() (since the assertion is inside
  a shared util function but the caller is responsible for ensuring the
  condition holds true)
* Change some callers to use size_t instead of int for the return value
  (negative returns are impossible and all subsequent uses are size_t)

The updated comments and code were taken (and adapted) from:

https://gitlab.com/craigbarnes/dte/-/blob/49260bb154bca0434462a41c061e512540ec2e49/src/util/xsnprintf.c#L6-50

This work was entirely authored by me and I hereby license this
contribution under the MIT license (stated explicitly, so that
there's no ambiguity w.r.t. the original license).
</content>
</entry>
<entry>
<title>notifications: BEL and OSC-777 now focuses the window on notification activation</title>
<updated>2024-09-05T05:16:15Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-09-05T05:13:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=c5bb1fb2ed33c06078bfec5fb2f487f6406254d0'/>
<id>urn:sha1:c5bb1fb2ed33c06078bfec5fb2f487f6406254d0</id>
<content type='text'>
Or put more propertly; if the notification daemon, and the
notification helper used by foot has been configured
properly (i.e. they both support XDG activation tokens), notifications
generated by BEL and OSC-777 will now raise/focus the window when the
default action of the notification is activated - typically by
clicking the notification.

Closes #1822
</content>
</entry>
<entry>
<title>term_set_window_title(): fix bad check for invalid UTF-8</title>
<updated>2024-08-20T05:15:22Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-08-20T05:15:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=8f9f3dbd9d8cbcc816584c548dff03add3f022e1'/>
<id>urn:sha1:8f9f3dbd9d8cbcc816584c548dff03add3f022e1</id>
<content type='text'>
mbsntoc32() returns (size_t)-1 on failure, not (char32_t)-1.
</content>
</entry>
<entry>
<title>feature: add resize-keep-grid to allow text reflow on font changes</title>
<updated>2024-08-20T05:07:29Z</updated>
<author>
<name>Andrew J. Hesford</name>
<email>ajh@sideband.org</email>
</author>
<published>2024-08-14T14:35:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=1969717527a956483ba1c37aab3fcf7e8560e26a'/>
<id>urn:sha1:1969717527a956483ba1c37aab3fcf7e8560e26a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>term: thrd_join() returns thrd_success on success, not 0</title>
<updated>2024-08-15T15:20:12Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-08-15T15:20:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=96c30cd410ddd36bbb583caca44d4834851408da'/>
<id>urn:sha1:96c30cd410ddd36bbb583caca44d4834851408da</id>
<content type='text'>
Closes #1812
</content>
</entry>
<entry>
<title>term: reload_fonts(): don't ignore return value of thrd_join()</title>
<updated>2024-08-04T09:55:25Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-08-03T07:04:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=a3a35f2c8c6ce3b35ec22627cb3097f621c46373'/>
<id>urn:sha1:a3a35f2c8c6ce3b35ec22627cb3097f621c46373</id>
<content type='text'>
This should fix the

    ‘ret’ may be used uninitialized

warning

Closes #1789
</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: don't close FD 0</title>
<updated>2024-07-30T14:33:19Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-07-30T14:33:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=0a5ba708e4a8448a0d29d4e263f939c9d1d2b953'/>
<id>urn:sha1:0a5ba708e4a8448a0d29d4e263f939c9d1d2b953</id>
<content type='text'>
This fixes a regression where closing a terminal instance, or hard- or
soft-resetting a terminal caused FD 0 to be closed.

This meant it became re-usable. Usually, by memfd_create() when
allocating a new surface buffer. So far nothing _really_ bad has
happened.

But what if FD 0 is now used by a memfd, and we close _another_
terminal instance?

This causes our memfd to be closed. And then, when e.g. trying to
scroll the terminal content: fallocate() fails with bad FD.
</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>
