Skip to content

feat: --color=auto #4489

@WhyNotHugo

Description

@WhyNotHugo

This is a feature request for a new options to --color, auto.

This new option shall query the terminal via OSC11 to determine the background colour. If the background is dark, then theme = dupeTheme(tui.Dark256). If the background is light, then theme = dupeTheme(tui.Light256).

The intent here is to allow fzf to the correct theme depending on whether the terminal is currently set to dark mode or light mode.


I tried to implement this myself, but I'm not familiar enough with the codebase. The main entry point for the change is in src/options.go:parseTheme, but beyond that, I'm not sure how to use control sequences. If you have guidance on this, I can try and work up a patch.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions