<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/terminal.c, branch 1.14.0</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=1.14.0</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=1.14.0'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2023-03-30T14:13:19Z</updated>
<entry>
<title>term: protect against integer overflow when accumulating scroll damage</title>
<updated>2023-03-30T14:13:19Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-03-28T16:37:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=981e4b77cb96ab277ea3b7a1e8aebf0e4589c032'/>
<id>urn:sha1:981e4b77cb96ab277ea3b7a1e8aebf0e4589c032</id>
<content type='text'>
When accumulating scroll damage, we check if the last scroll damage’s
scrolling region, and type, matches the new/current scroll damage. If
so, the number of lines in the last scroll damage is increased,
instead of adding a new scroll damage instance to the list.

If the scroll damage list isn’t consumed, this build up of scroll
damage would eventually overflow.

And, even if it didn’t overflow, it could become large enough, that
when later used to calculate e.g. the affected surface area, while
rendering a frame, would cause an overflow there instead.

This patch fixes both issues by:

a) do an overflow check before increasing the line count
b) limit the line count to UINT16_MAX
</content>
</entry>
<entry>
<title>config: add ‘font-size-adjustment=N[px|%]’ option</title>
<updated>2022-12-17T09:59:17Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-12-15T10:10:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=f6ca8c90e11d9b1ecdfe8a5bf69b1b793376a91c'/>
<id>urn:sha1:f6ca8c90e11d9b1ecdfe8a5bf69b1b793376a91c</id>
<content type='text'>
This patch adds a new config option, font-size-adjustment.

It lets you configure how much the font size should be
incremented/decremented when zooming in or out (ctrl-+, ctrl+-).

Values can be specified in points, pixels or percent.

Closes #1188
</content>
</entry>
<entry>
<title>term: apply scale factor when converting a px value to pt</title>
<updated>2022-11-24T16:20:05Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-11-24T16:20:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=fa6b07abeacfb5b8a70bc762e9c8ff64470c4d2c'/>
<id>urn:sha1:fa6b07abeacfb5b8a70bc762e9c8ff64470c4d2c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>term: initialize term-&gt;font_line_height when there’s no user-set line-height</title>
<updated>2022-11-24T16:09:31Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-11-24T16:09:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=e85257bcae116f5e6148e38690e2ec95b586d451'/>
<id>urn:sha1:e85257bcae116f5e6148e38690e2ec95b586d451</id>
<content type='text'>
</content>
</entry>
<entry>
<title>term: update user-set line-height just before calculating the cell dimensions</title>
<updated>2022-11-24T13:34:31Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-11-24T13:34:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=94bac0513ab3ca78464d8e79c153c8ee4bac835f'/>
<id>urn:sha1:94bac0513ab3ca78464d8e79c153c8ee4bac835f</id>
<content type='text'>
This ensures *all* font-size affecting changes (DPI, output scaling,
font size increment/decrement) also updates the line-height.
</content>
</entry>
<entry>
<title>term: adjust user-set line-height by the same percentage as the primary font</title>
<updated>2022-11-23T15:29:42Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-11-23T15:15:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=5a54423000ad0cffec0178a6091c87d75110eee0'/>
<id>urn:sha1:5a54423000ad0cffec0178a6091c87d75110eee0</id>
<content type='text'>
Before this patch, a user-set line-height was increased/decreased by
the exact same amount of pt’s as the font(s).

This means, that when there’s a large discrepancy between the
line-height and the font size, the proportion between the line’s
height and the font size will change as we increase or decrease the
font size.

This patch changes how the line height is adjusted when the font size
is incremented or decremented. We calculate the difference, in
percent, between the primary font’s original (default) size, and its
current size, and then apply that to the configured line-height.

Closes #1218
</content>
</entry>
<entry>
<title>term_destroy(): free interactive_resizing.grid</title>
<updated>2022-10-18T16:29:20Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-10-18T16:29:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=09d52d5db6175c272b43d6e132922e14a0c57d23'/>
<id>urn:sha1:09d52d5db6175c272b43d6e132922e14a0c57d23</id>
<content type='text'>
This grid is normally unallocated, but may be allocated if we are
exiting (for whatever reason) in the middle of an interactive resize.
</content>
</entry>
<entry>
<title>fdm_ptmx(): regression: don’t return false when an interactive resize is in progress</title>
<updated>2022-10-18T16:28:51Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-10-18T16:28:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=2e9b3ceb95597e2612b048f20fa006d123090e27'/>
<id>urn:sha1:2e9b3ceb95597e2612b048f20fa006d123090e27</id>
<content type='text'>
</content>
</entry>
<entry>
<title>term: reverse scroll: free scrolled out lines</title>
<updated>2022-10-16T08:31:08Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-10-14T16:00:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=3d9a429499841cca83b5c8359ea7e2b78509601f'/>
<id>urn:sha1:3d9a429499841cca83b5c8359ea7e2b78509601f</id>
<content type='text'>
This ensures *everything* in the circular scrollback history, after
the bottom of the screen, is either NULL rows, or belong to the
scrollback *history* (as opposed to the future history).

This fixes an issue when calculating the scrollback start, which for
example would trigger a crash when moving the viewport (i.e. scrolling
with the mouse, or PgUp/PgDown).

Closes #1190
</content>
</entry>
<entry>
<title>term_ptmx_{pause,resume}: return success/fail</title>
<updated>2022-10-10T15:19:18Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-10-09T14:16:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=c5c97c2fd4a674d0fcce16d40e0e56994195e9b0'/>
<id>urn:sha1:c5c97c2fd4a674d0fcce16d40e0e56994195e9b0</id>
<content type='text'>
</content>
</entry>
<entry>
<title>term: ptmx: don’t consume anything while doing an interactive resize</title>
<updated>2022-10-10T15:19:18Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-10-09T14:15:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=54d637e2b47fd55e4abde1e28f7f665e69c2a995'/>
<id>urn:sha1:54d637e2b47fd55e4abde1e28f7f665e69c2a995</id>
<content type='text'>
The ‘normal’ grid in use during an interactive resize is temporary;
all changes done to it will be lost when the resize is finished.
</content>
</entry>
<entry>
<title>term: use SIZE_MAX instead of (size_t)-1ll</title>
<updated>2022-10-10T15:19:18Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-10-09T14:14:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=66e4592d91312568c8948ddda850ba8b1c31c87d'/>
<id>urn:sha1:66e4592d91312568c8948ddda850ba8b1c31c87d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>render: resize: ignore ptmx read events during interactive resize</title>
<updated>2022-10-10T15:19:18Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-10-06T15:23:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=f4f1989b6ef341557cc90a6805d745fef2a7a815'/>
<id>urn:sha1:f4f1989b6ef341557cc90a6805d745fef2a7a815</id>
<content type='text'>
</content>
</entry>
<entry>
<title>term: utmp: set ‘host’ to WAYLAND_DISPLAY</title>
<updated>2022-09-23T21:04:10Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-09-23T21:04:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=c93eb45b42691e0f13b21668298d2cf4a94e67e7'/>
<id>urn:sha1:c93eb45b42691e0f13b21668298d2cf4a94e67e7</id>
<content type='text'>
This is similar to what XTerm does (setting it to DISPLAY)
</content>
</entry>
<entry>
<title>Add support for creating utmp records</title>
<updated>2022-09-23T21:02:25Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-09-23T18:24:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=aa10b1d2da3ecf9672ae915a49073bd30ee0a785'/>
<id>urn:sha1:aa10b1d2da3ecf9672ae915a49073bd30ee0a785</id>
<content type='text'>
This patch adds support for creating utmp records using the ‘utempter’
helper binary from the ‘libutempter’ package.

* New config option ‘main.utempter’
* New meson command line option, -Ddefault-utempter-path. Defaults to
  auto-detecting the path.

The default value of the new ‘main.utempter’ config option depends on
the meson command line option ‘-Ddefault-utempter-path’.

If ‘main.utempter’ is *not* set to ‘none’, foot will try to execute
the utempter helper binary to create utmp records when a new terminal
is instantiated. The record is removed when the terminal instance is
destroyed.
</content>
</entry>
<entry>
<title>terminal: don’t unref a not-yet-referenced key-binding set</title>
<updated>2022-09-06T18:44:05Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-09-05T17:23:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=d2e67689ea0d5ec986b66936188e0557c1f04858'/>
<id>urn:sha1:d2e67689ea0d5ec986b66936188e0557c1f04858</id>
<content type='text'>
Key-binding sets are bound to a seat/configuration pair. The conf
reference is done when a new terminal instance is created.

When that same terminal instance is destroyed, the key binding set is
unref:ed.

If the terminal instance is destroyed *before* the key binding set has
been referenced, we’ll still unref it. This creates an imbalance.

In particular, when the there is exactly one other terminal instance
referencing that same key binding set, that terminal instance will
trigger a foot server crash as soon as it receives a key press/release
event. This happens because the next-to-last terminal instance brought
the reference count of the binding set down to 0, causing it to be
free:d.

Thus, we *must* reference the binding set *before* we can error
out (when instantiating a new terminal instance).

At this point, we don’t yet have a valid terminal instance. But,
that’s ok, because all the key_binding_new_for_term() did with the
terminal instance was get the "struct wayland" and "struct config"
pointers. So, rename the function and simply pass these pointers
explicitly.

Similarly, change key_binding_for() to take a "struct config" pointer,
rather than a "struct terminal" pointer.

Also rename key_binding_unref_term() -&gt; key_binding_unref().
</content>
</entry>
<entry>
<title>selection: selection_on_rows(): use scrollback relative coords</title>
<updated>2022-07-28T19:06:57Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-07-28T16:27:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=a05eaf28bdeea793829bddb6cc99220b1adb1d6f'/>
<id>urn:sha1:a05eaf28bdeea793829bddb6cc99220b1adb1d6f</id>
<content type='text'>
When checking if the current selection intersects with the
region (passed as parameter to the function), use scrollback relative
coordinates.

This fixes an issue where selections crossing the scrollback
wrap-around being misdetected, resulting in either the selection being
canceled while scrolling, even though it wasn’t scrolled out, or the
selection _not_ being canceled, when it _was_ scrolled out.
</content>
</entry>
<entry>
<title>Revert "grid: invert the default value of ‘linebreak’, from false to true"</title>
<updated>2022-06-30T17:37:01Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-06-30T17:37:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=37f094280b06cf207b5720fa1a36ff7199225e6b'/>
<id>urn:sha1:37f094280b06cf207b5720fa1a36ff7199225e6b</id>
<content type='text'>
This reverts commit cdd46cdf85b1087ac7465c646bb05078f1bbe85b.
</content>
</entry>
<entry>
<title>osc: add support for OSC 133;A (prompt markers)</title>
<updated>2022-06-16T17:02:10Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-06-15T16:44:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=bdb79e8b9fb36f627bb204ce2060dd5a877f3712'/>
<id>urn:sha1:bdb79e8b9fb36f627bb204ce2060dd5a877f3712</id>
<content type='text'>
This patch adds support for the OSC-133;A sequence, introduced by
FinalTerm and implemented by iTerm2, Kitty and more. See
https://iterm2.com/documentation-one-page.html#documentation-escape-codes.html.

The shell emits the OSC just before printing the prompt. This lets the
terminal know where, in the scrollback, there are prompts.

We implement this using a simple boolean in the row struct ("this row
has a prompt"). The prompt marker must be reflowed along with the text
on window resizes.

In an ideal world, erasing, or overwriting the cell where the OSC was
emitted, would remove the prompt mark. Since we don't store this
information in the cell struct, we can't do that. The best we can do
is reset it in erase_line(). This works well enough in the "normal"
screen, when used with a "normal" shell. It doesn't really work in
fullscreen apps, on the alt screen. But that doesn't matter since we
don't support jumping between prompts on the alt screen anyway.

To be able to jump between prompts, two new key bindings have been
added: prompt-prev and prompt-next, bound to ctrl+shift+z and
ctrl+shift+x respectively.

prompt-prev will jump to the previous, not currently visible, prompt,
by moving the viewport, ensuring the prompt is at the top of the
screen.

prompt-next jumps to the next prompt, visible or not. Again, by moving
the viewport to ensure the prompt is at the top of the screen. If
we're at the bottom of the scrollback, the viewport is instead moved
as far down as possible.

Closes #30
</content>
</entry>
<entry>
<title>config: add a new ‘environment’ section</title>
<updated>2022-06-13T09:55:23Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-05-28T17:27:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=755f96321ab47f931d11680027d47d1d772f5584'/>
<id>urn:sha1:755f96321ab47f931d11680027d47d1d772f5584</id>
<content type='text'>
This section allows the user to define custom environment variables to
be set in the child process:

  [environment]
  name=value
</content>
</entry>
</feed>
