junegunn / junegunn/fzf

Feature request: return ansi colors on exit and in --listen mode

Open
#4,728 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
83.1k
Forks
3.1k
Avg merge
17h 8m
Merged PRs (30d)
10

Description

### Checklist

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

### Output of `fzf --version`

0.70.0 (f0a2f5ef)

### OS

- [x] Linux
- [ ] macOS
- [ ] Windows
- [ ] Etc.

### Shell

- [x] bash
- [ ] zsh
- [ ] fish

### Problem / Steps to reproduce

```bash
echo -e "$RED AAAA $RESET$BLUE AAAA $RESET" | fzf --ansi
```
- above shows two lines, as I would expect, fzf shows the selected string on exit but without the ansi codes

- same thing in --listen mode, this simplifies greatly the writing of the client

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the bash command with `fzf --ansi`, then trace the command-line exit output and the `--listen` mode entry points in the Go code. Done means selected output preserves its ANSI color codes both on normal exit and when returned through `--listen` mode.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash, go
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.