Compare commits

...

13 commits

Author SHA1 Message Date
Daniel Eklöf
037a2f4fa2
term: enqueue data to slave if there are queued paste data buffers
When writing paste data to the terminal (either interactively, or as
an OSC-52 reply), we enqueue other data (key presses, for examples, or
query replies) while the paste is happening.

The idea is to send the key press _after_ all paste data has been
written, to ensure consistency.

Unfortunately, we only checked for an on-going paste. I.e. where the
paste itself hasn't yet finished. It is also possible the paste itself
has finished, but we haven't yet flushed all the paste buffers. That
is, if we were able to *receive* paste data faster than the terminal
client was able to *consume* it. In this case, we've queued up paste
data in the terminal. These are in separate queues, and when emitting
e.g. a key press, we didn't check if all _those_ queues had been
flushed yet.

Closes #2307
2026-03-21 14:43:27 +01:00
Daniel Eklöf
2fb7bb0ea4
changelog: add new 'unreleased' section 2026-03-14 08:38:15 +01:00
Daniel Eklöf
5708a63c9a
Merge branch 'releases/1.26' 2026-03-14 08:37:52 +01:00
Daniel Eklöf
ef15414b30
meson: bump version to 1.26.1 2026-03-14 08:35:28 +01:00
Daniel Eklöf
370adaf697
changelog: prepare for 1.26.1 2026-03-14 08:35:15 +01:00
Daniel Eklöf
6f1157395b
Merge branch 'master' into releases/1.26 2026-03-14 08:34:05 +01:00
vlkrs
eed2d668ec OpenBSD has UTF-32 2026-03-12 18:47:50 +01:00
Daniel Eklöf
657db18a4e
wayland: do all surface unmap and roundtrips before waiting for pre-apply damage
The pre-apply damage thread may be running when we destroy a terminal
instance, and we need to wait for it to finish before destroying the
underlying buffer.

c291194a4e did this, but failed to
realize the thread may get re-started in the roundtrips done later in
wayl_win_destroy(); after the wait added in
c291194a4e, we unmap all
surfaces (including the main grid), and roundtrip. This means the
compositor will release the currently active buffer, and that means
_we_ will trigger the pre-apply damage thread on it. This introduces a
race, where wayl_win_destroy() may reach its shm_purge() calls before
the pre-apply damage thread has finished. That typically causes foot
to crash.

Closes #2288
2026-03-10 08:25:08 +01:00
Daniel Eklöf
4fd682b4e8
meson: clang: add -Wno-wc2y-extensions
Recent clang versions warn on __COUNTER__, unless compiling with
-std=c2y (which breaks other things).

"Fixes" '__COUNTER__' is a C2y extension (__COUNTER__ is used by our
UNITTEST macro).
2026-03-10 08:21:49 +01:00
Roshless
f49fdf7ca3 themes: paper-color-light: fix newline 2026-03-05 19:11:44 +01:00
Daniel Eklöf
c05bd55029
doc: foot.ini: fix default value of initial-color-theme
Closes #2292
2026-03-05 16:17:09 +01:00
Daniel Eklöf
ebacb14be8
changelog: add new 'unreleased' section 2026-03-03 17:38:46 +01:00
Daniel Eklöf
bee76db20c
Merge branch 'releases/1.26' 2026-03-03 17:38:07 +01:00
7 changed files with 53 additions and 7 deletions

View file

@ -1,5 +1,7 @@
# Changelog
* [Unreleased](#unreleased)
* [1.26.1](#1-26-1)
* [1.26.0](#1-26-0)
* [1.25.0](#1-25-0)
* [1.24.0](#1-24-0)
@ -67,6 +69,42 @@
* [1.2.0](#1-2-0)
## Unreleased
### Added
### Changed
### Deprecated
### Removed
### Fixed
* Other output (key presses, query replies etc) being mixed with paste
data, both interactive pastes and OSC-52 ([#2307][2307]).
[2307]: https://codeberg.org/dnkl/foot/issues/2307
### Security
### Contributors
## 1.26.1
### Fixed
* Wrong documented default value for `initial-color-theme` in
`foot.ini(5)` ([#2292][2292]).
* Occasional crashes when closing a window and
`tweak.pre-apply-damage=yes` (the default) ([#2288][2288]).
[2292]: https://codeberg.org/dnkl/foot/issues/2292
[2288]: https://codeberg.org/dnkl/foot/issues/2288
### Contributors
* Roshless
* vlkrs
## 1.26.0
### Added

View file

@ -34,7 +34,7 @@ _Static_assert(
#if !defined(__STDC_UTF_32__) || !__STDC_UTF_32__
#error "char32_t does not use UTF-32"
#endif
#if (!defined(__STDC_ISO_10646__) || !__STDC_ISO_10646__) && !defined(__FreeBSD__)
#if (!defined(__STDC_ISO_10646__) || !__STDC_ISO_10646__) && !defined(__FreeBSD__) && !defined(__OpenBSD__)
#error "wchar_t does not use UTF-32"
#endif

View file

@ -392,7 +392,7 @@ empty string to be set, but it must be quoted: *KEY=""*
at runtime, or send SIGUSR1/SIGUSR2 to the foot process (see
*foot*(1) for details).
Default: _1_
Default: _dark_
*initial-window-size-pixels*
Initial window width and height in _pixels_ (subject to output

View file

@ -1,5 +1,5 @@
project('foot', 'c',
version: '1.26.0',
version: '1.26.1',
license: 'MIT',
meson_version: '>=0.59.0',
default_options: [
@ -12,6 +12,11 @@ is_debug_build = get_option('buildtype').startswith('debug')
cc = meson.get_compiler('c')
# Newer clang versions warns when using __COUNTER__ without -std=c2y
if cc.has_argument('-Wc2y-extensions')
add_project_arguments('-Wno-c2y-extensions', language: 'c')
endif
if cc.has_function('memfd_create',
args: ['-D_GNU_SOURCE'],
prefix: '#include <sys/mman.h>')

View file

@ -120,7 +120,10 @@ term_to_slave(struct terminal *term, const void *data, size_t len)
return false;
}
if (tll_length(term->ptmx_buffers) > 0 || term->is_sending_paste_data) {
if (unlikely(tll_length(term->ptmx_buffers) > 0 ||
term->is_sending_paste_data ||
tll_length(term->ptmx_paste_buffers) > 0))
{
/*
* Don't even try to send data *now* if there's queued up
* data, since that would result in events arriving out of

View file

@ -4,7 +4,7 @@
[main]
initial-color-theme=light
xs
[colors-light]
cursor=eeeeee 444444
background=eeeeee

View file

@ -2177,8 +2177,6 @@ wayl_win_destroy(struct wl_window *win)
struct terminal *term = win->term;
render_wait_for_preapply_damage(term);
if (win->csd.move_timeout_fd != -1)
close(win->csd.move_timeout_fd);
@ -2236,6 +2234,8 @@ wayl_win_destroy(struct wl_window *win)
tll_remove(win->urls, it);
}
render_wait_for_preapply_damage(term);
csd_destroy(win);
wayl_win_subsurface_destroy(&win->search);
wayl_win_subsurface_destroy(&win->scrollback_indicator);