Skip to content

Lower refresh rate while not used to save energy #3645

@nailgun

Description

@nailgun




Is your feature request related to a problem? Please describe.
I like to keep k9s running in a dedicated terminal window all the time. However, due to constant screen refreshes, it consumes a significant amount of laptop battery.

Describe the solution you'd like
It would be great if k9s could refresh less frequently when the terminal window is not focused. I see two possible ways to achieve this:

  1. Use the focus reporting extension of the ECMA-48 standard, defined and popularized by Xterm and became a de facto standard in many modern terminal emulators.
    The application can request focus reporting by sending the escape sequence ESC [ ?1004h.
    The terminal will then send back ESC [ I when the window gains focus and ESC [ O when it loses focus.
    To disable reporting, the application sends ESC [ ?1004l.
    k9s could use these signals to dynamically adjust its refresh rate.

  2. Alternatively, the refresh rate could be reduced after a certain period of user inactivity (no input detected).

Describe alternatives you've considered
I’ve checked if iTerm2 or tmux provide a built-in way to suspend an application or pause its output when unfocused, but didn’t find any equivalent feature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions