Giter Club home page Giter Club logo

Comments (2)

joelim-work avatar joelim-work commented on August 16, 2024

I'm not sure whether it's possible to prevent flickering when redrawing the same image in the same spot. TUI libraries like tcell typically maintain an internal buffer which stores the contents of the screen before flushing them to the actual terminal. As only changes in the internal buffer are flushed, this makes the actual updates appear more smooth.

The problem is that terminals don't truly have a concept of displaying images, and hacky standards like Sixel graphics are only made possible by bypassing the internal buffer and writing directly to the terminal. When you consider the steps that lf uses to draw the UI, it makes sense that there is a flicker:

  1. lf clears the screen (really the internal buffer) to draw everything from scratch
  2. Various components (pane, prompt, status bar, etc.) are drawn to the internal buffer. This includes previews that are text-based and not images
  3. The internal buffer is flushed to the terminal (this will wipe the existing image preview)
  4. If sixel is enabled, the sixel image is drawn by writing it to the terminal

That being said, specifically for the period timer, I think there is no need to redraw the UI since the purpose is to just check if any files have been modified, which essentially happens in the background.

from lf.

joelim-work avatar joelim-work commented on August 16, 2024

I have submitted #1666 to address this, hopefully it fixes the issue for you.

from lf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.