Zum Hauptinhalt springen
Echtzeit-Radar & Feeds
Alle RSS Feeds ➔
👥 Community & Social
Unix & Linux ServeropenSUSE Leap is The Immutable Distro Now, Leap Micro is Out(29.09.2026 um 18:05 Uhr)
•
Sicherheitslücken (CVE)USN-8844-1: c-ares vulnerability(29.09.2026 um 17:15 Uhr)
••
Sicherheitslücken (CVE)CVE-2023-30548 | gatsby-plugin-sharp path traversal (GHSA-h2pm-378c-pcxx)(29.09.2026 um 18:30 Uhr)
•••
Sichere ProgrammierungHow to Test POST API Requests With Playwright TypeScript(29.09.2026 um 18:00 Uhr)
•
Sichere ProgrammierungHow I Fixed My Forgetful AI Assistant Using Hindsight Agent Memory(29.09.2026 um 18:33 Uhr)
•
Sichere ProgrammierungTest Execution & Documentation(29.09.2026 um 18:33 Uhr)
•
Sichere ProgrammierungOffline-First Markdown Sync with GitHub and 3-Way Merge(29.09.2026 um 18:33 Uhr)
•
Unix & Linux ServeropenSUSE Leap is The Immutable Distro Now, Leap Micro is Out(29.09.2026 um 18:05 Uhr)
•
Sicherheitslücken (CVE)USN-8844-1: c-ares vulnerability(29.09.2026 um 17:15 Uhr)
••
Sicherheitslücken (CVE)CVE-2023-30548 | gatsby-plugin-sharp path traversal (GHSA-h2pm-378c-pcxx)(29.09.2026 um 18:30 Uhr)
•••
Sichere ProgrammierungHow to Test POST API Requests With Playwright TypeScript(29.09.2026 um 18:00 Uhr)
•
Sichere ProgrammierungHow I Fixed My Forgetful AI Assistant Using Hindsight Agent Memory(29.09.2026 um 18:33 Uhr)
•
Sichere ProgrammierungTest Execution & Documentation(29.09.2026 um 18:33 Uhr)
•
Sichere ProgrammierungOffline-First Markdown Sync with GitHub and 3-Way Merge(29.09.2026 um 18:33 Uhr)
•
Intelligence View
⚡ tsecurity.de Intelligence

Displaying Images in lf with Kitty and Tmux

The Problem When using lf (the terminal file manager) with Kitty and Tmux, image preview display often causes issues: graphical artifacts remain on screen when switching from one preview to another, making the interface…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

Animation of lf terminal file manager displaying images






The Problem



When using lf (the terminal file manager) with Kitty and Tmux, image preview display often causes issues: graphical artifacts remain on screen when switching from one preview to another, making the interface unreadable.



Viewing images with issues



After several attempts, I found a solution that seems to work well. It relies on three elements:




  1. The redraw command in lf

  2. No cleaner script

  3. The on-select event in lf



Viewing images without issues






lf Configuration



Here's the configuration to add to your lfrc file:




set previewer ~/.local/bin/lfpreview
cmd on-select &{{
exec lf -remote 'send redraw'
}}







The preview script (previewer) will be detailed later. The key element here is using on-select to ask lf to redraw itself on each selection. This command performs the terminal cleanup and ensures clean preview display.






The Preview Script



Create the file ~/.local/bin/lfpreview with the following content:




#!/bin/sh
draw() {
kitten icat --stdin no --transfer-mode memory \
--place "${w}x${h}@${x}x${y}" "$1" </dev/null >/dev/tty
}

file="$1"
w="$2"
h="$3"
x="$4"
y="$5"

case "$(file -Lb --mime-type "$file")" in
image/*)
draw "$file"
;;
application/pdf)
pdftoppm -f 1 -singlefile "$file" "/tmp/lfoutput"
draw "/tmp/lfoutput.ppm"
;;
*)
less "$1"
;;
esac

exit 1 # do not cache






Don't forget to make it executable:




chmod +x ~/.local/bin/lfpreview






This simplified version handles:




  • Images (via kitten icat)

  • PDFs (converting the first page to an image)

  • Other files (display via less)






Important Points



The exit 1 at the end of the script is crucial: it tells lf not to cache the previews. Without it, the refresh mechanism wouldn't work properly, as lf would reuse cached previews instead of redisplaying the image on each selection.






Conclusion



This configuration works well for my use case, but it may require adjustments depending on your environment. Feel free to adapt the preview script to handle other file types according to your needs.

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Displaying Images in lf with Kitty and Tmux

Thematisch verwandte Begriffe: Displaying, Images, with, Kitty · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

💬 Kommentare werden geladen…
Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-102568 | Pardus Parental Control before 0.7.0 contains an incorrect authorizatio…
Advisory →
tsecurity.de Icon
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag