Skip to content

Support dynamic footer-label actions and export footer-label as an environment variable #4787

@matheus-pacifico

Description

@matheus-pacifico

Checklist

  • I have read through the manual page (man fzf)
  • I have searched through the existing issues
  • For bug reports, I have checked if the bug is reproducible in the latest version of fzf

Output of fzf --version

0.72.0 (6fefe02)

OS

  • Linux
  • macOS
  • Windows
  • Etc.

Shell

  • bash
  • zsh
  • fish

Problem / Steps to reproduce

Currently, fzf supports dynamic label updates using change and transform actions. However, the footer-label lacks this flexibility. There is currently no way to dynamically update the footer label after the initial launch, nor is its value exported to child processes.

Proposed solution

I propose making footer-label consistent with other labels by implementing the following:

  1. New actions:
    • change-footer-label(...) (change --footer-label to the given string)
    • transform-footer-label(...) (transform footer label using an external command)
  2. Exported environment variable:
    • FZF_FOOTER_LABEL: Footer label string

This would allow for more consistent UI logic when building custom tools, where scripts might need to know what is currently being displayed in the footer. It would also eliminate the need to restart fzf to reflect changes in the footer label.

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