junegunn / junegunn/fzf

feat: --color=auto

Open
#4,489 9 comments 1 reaction 0 assignees View on GitHub
feature tip
Dominant language
Go
Stars
83k
Forks
2.9k
Avg merge
17h 8m
Merged PRs (30d)
10

Description

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.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at src/options.go:parseTheme to trace how --color values select themes. Research how fzf can query the terminal with OSC11 and how to interpret dark versus light backgrounds, then verify that --color=auto selects tui.Dark256 or tui.Light256 appropriately.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.