mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-05-13 08:26:56 +00:00
clipboard kitten: Fix a bug causing kitten to hang in filter mode when input data size is not divisible by 3 and larger than 8KB
Fixes #8059
This commit is contained in:
parent
4cb190130f
commit
2436c5acfe
2 changed files with 17 additions and 10 deletions
|
|
@ -93,6 +93,8 @@ Detailed list of changes
|
|||
|
||||
- Wayland GNOME: Workaround bug in mutter causing double tap on titlebar to not always work (:iss:`8054`)
|
||||
|
||||
- clipboard kitten: Fix a bug causing kitten to hang in filter mode when input data size is not divisible by 3 and larger than 8KB (:iss:`8059`)
|
||||
|
||||
0.37.0 [2024-10-30]
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
|
|
|||
|
|
@ -139,19 +139,24 @@ func run_plain_text_loop(opts *Options) (err error) {
|
|||
|
||||
buf := make([]byte, 8192)
|
||||
write_one_chunk := func() error {
|
||||
n, err := data_src.Read(buf[:cap(buf)])
|
||||
if err != nil && !errors.Is(err, io.EOF) {
|
||||
orig := enc_writer.last_written_id
|
||||
for enc_writer.last_written_id == orig {
|
||||
n, err := data_src.Read(buf[:cap(buf)])
|
||||
if n > 0 {
|
||||
enc.Write(buf[:n])
|
||||
}
|
||||
if err == nil {
|
||||
continue
|
||||
}
|
||||
if errors.Is(err, io.EOF) {
|
||||
enc.Close()
|
||||
send_to_loop("\x1b\\")
|
||||
after_read_from_stdin()
|
||||
return nil
|
||||
}
|
||||
send_to_loop("\x1b\\")
|
||||
return err
|
||||
}
|
||||
if n > 0 {
|
||||
enc.Write(buf[:n])
|
||||
}
|
||||
if errors.Is(err, io.EOF) {
|
||||
enc.Close()
|
||||
send_to_loop("\x1b\\")
|
||||
after_read_from_stdin()
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue