kitty/kittens/choose_files
Kovid Goyal 0dfd9a832e
choose-files: Cleanup handling of special files in previews
Follow up to the previous commit fixing hangs when previewing named pipes:

- Skip previewing anything that is not a regular file (or a symlink to
  one) in preview_for, before any previewer opens it. This avoids
  unblocking and then breaking writers waiting on a FIFO and covers the
  non-text previewers (images, video, archives, calibre, commands) too.
- Apply the text preview size limit to the symlink target instead of the
  symlink itself, and enforce it while reading so that files growing
  after stat() are also handled.
- Pre-allocate the read buffer based on the file size, as os.ReadFile does.
- Read ignore files during scanning with the same non-blocking reader, so
  a FIFO named .ignore or .gitignore cannot stall the scan.
- Unblock goroutines stuck on FIFOs when tests time out.
2026-11-09 08:42:30 +05:30
..
__init__.py Implement previews for plain text files 2025-07-20 19:24:17 +05:30
archive.go Fix #10651 2026-10-11 20:22:52 +05:30
archive_test.go Fix #10651 2026-10-11 20:22:52 +05:30
calibre.go choose-files: Show tags instead of authors on the calibre preview Tags line 2026-11-05 14:57:26 -05:00
cmd_preview.go choose-files: fix video and custom previews notbeing cached 2026-11-05 14:42:27 +05:30
collection.go Implement mouse interaction with result list 2025-07-11 10:36:20 +05:30
ffmpeg.go choose-files: fix video and custom previews notbeing cached 2026-11-05 14:42:27 +05:30
filters.go Fix #10658 2026-10-13 08:21:05 +05:30
footer.go Handle multiple save files when entering save file names 2025-07-11 21:47:11 +05:30
graphics.go Make image preview code re-useable for other types of previews that have both metadata and an image 2025-11-22 13:21:21 +05:30
image_preview.go Fix #10651 2026-10-11 20:22:52 +05:30
image_preview_test.go choose-files: fix video and custom previews notbeing cached 2026-11-05 14:42:27 +05:30
main.go choose-files: Handle symlinks to directories 2026-10-12 10:08:06 +08:00
main.py choose-files: fix video and custom previews notbeing cached 2026-11-05 14:42:27 +05:30
main_test.go Quote choose-files shell output safely 2026-08-12 13:10:53 +05:00
preview.go choose-files: Cleanup handling of special files in previews 2026-11-09 08:42:30 +05:30
preview_test.go choose-files: Cleanup handling of special files in previews 2026-11-09 08:42:30 +05:30
results.go Cleanup previous PR 2026-10-12 09:36:21 +05:30
results_test.go Cleanup highlighting of positions in text and add some tests 2025-12-05 09:40:36 +05:30
save-file.go Cleanup previous PR 2026-10-12 09:36:21 +05:30
scan.go choose-files: Cleanup handling of special files in previews 2026-11-09 08:42:30 +05:30
scan_test.go Fix #10658 2026-10-13 08:21:05 +05:30
search-bar.go Fix text overflow in choose files search box caused by move to readline 2026-07-05 18:01:42 +05:30