Compare commits

...

3 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
2 changed files with 22 additions and 1 deletions

View file

@ -1,5 +1,6 @@
# Changelog # Changelog
* [Unreleased](#unreleased)
* [1.26.1](#1-26-1) * [1.26.1](#1-26-1)
* [1.26.0](#1-26-0) * [1.26.0](#1-26-0)
* [1.25.0](#1-25-0) * [1.25.0](#1-25-0)
@ -68,6 +69,23 @@
* [1.2.0](#1-2-0) * [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 ## 1.26.1
### Fixed ### Fixed

View file

@ -120,7 +120,10 @@ term_to_slave(struct terminal *term, const void *data, size_t len)
return false; 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 * Don't even try to send data *now* if there's queued up
* data, since that would result in events arriving out of * data, since that would result in events arriving out of