mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
selection: convert \r -> \n when reading clipboard data
This fixes an issue where pasting (using e.g. OSC-52) in client applications that doesn’t do this conversion themselves, like tmux, doesn’t work. Closes #752
This commit is contained in:
parent
6dfacb9c08
commit
5ab49de7f2
2 changed files with 7 additions and 0 deletions
|
|
@ -59,6 +59,8 @@
|
||||||
state, foot was looking at **depressed** modifiers, not
|
state, foot was looking at **depressed** modifiers, not
|
||||||
**effective** modifiers, like it should.
|
**effective** modifiers, like it should.
|
||||||
* Fix crashes after enabling CSD at runtime when `csd.size` is 0.
|
* Fix crashes after enabling CSD at runtime when `csd.size` is 0.
|
||||||
|
* Convert `\r` to `\n` when reading clipboard data
|
||||||
|
(https://codeberg.org/dnkl/foot/issues/752).
|
||||||
|
|
||||||
|
|
||||||
### Security
|
### Security
|
||||||
|
|
|
||||||
|
|
@ -1609,6 +1609,11 @@ fdm_receive_timeout(struct fdm *fdm, int fd, int events, void *data)
|
||||||
static void
|
static void
|
||||||
fdm_receive_decoder_plain(struct clipboard_receive *ctx, char *data, size_t size)
|
fdm_receive_decoder_plain(struct clipboard_receive *ctx, char *data, size_t size)
|
||||||
{
|
{
|
||||||
|
/* \r -> \n */
|
||||||
|
for (size_t i = 0; i < size; i++) {
|
||||||
|
if (data[i] == '\r')
|
||||||
|
data[i] = '\n';
|
||||||
|
}
|
||||||
ctx->cb(data, size, ctx->user);
|
ctx->cb(data, size, ctx->user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue