Update docs

This commit is contained in:
Daisuke Maki 2026-02-21 20:33:02 +09:00
parent 6869d4dcfa
commit 17536e1410
2 changed files with 39 additions and 16 deletions

27
Changes
View file

@ -25,6 +25,12 @@ v0.6.0 - UNRELEASED
previously unbound (it silently conflicted with `KillEndOfLine` on
Ctrl+K in v0.5.x) and is now bound to Alt+j. `GoToPreviousSelection`
was previously bound to Ctrl+J and is now bound to Alt+k.
* ANSI color support is now enabled by default (`--color=auto`).
In v0.5.x, ANSI escape sequences in input were stripped and not
rendered unless explicitly enabled. To disable, use `--color=none`
or set `"Color": "none"` in your config file. The previous `--ansi`
flag and `"ANSI": true` config field have been replaced by
`--color=auto|none` and `"Color": "auto"|"none"`.
* Query terms starting with `-` are now interpreted as negative
(exclusion) filters. In v0.5.x, `foo -bar` searched for lines
matching both "foo" and literal "-bar"; in v0.6.0 it searches for
@ -37,7 +43,7 @@ v0.6.0 - UNRELEASED
* Added negative filter terms. Prefix a search term with `-` to exclude
matching lines, e.g. `-unittests SSO` matches "SSO" but excludes
lines containing "unittests" (#434, #592).
* Added `peco.Freeze` / `peco.Unfreeze` / `peco.ToggleFreeze` actions.
* Added `peco.FreezeResults` / `peco.UnfreezeResults` actions.
Freezing locks the current result set so you can clear the query,
switch filters, and continue filtering against the frozen subset (#424, #596).
* Added `--height` option for inline display. Limits peco to the
@ -45,9 +51,10 @@ v0.6.0 - UNRELEASED
screen (#471, #598).
* Added `peco.ZoomIn` / `peco.ZoomOut` actions that expand visible
context around matched lines, showing surrounding lines (#289, #600).
* Added ANSI color rendering support. Colored output from tools like
* Added ANSI color rendering support via `--color=auto|none` CLI flag
and `"Color"` config field. Colored output from tools like
`git log --color` or `rg --color` is now displayed with colors
preserved (#398, #602).
preserved. Default is `auto` (enabled) (#398, #602).
* Added `IRegexp` filter for case-insensitive regexp matching, so you
no longer need to manually type `(?i)` in regex queries (#564).
* Added `--exit-0` option to immediately exit with non-zero status
@ -59,6 +66,20 @@ v0.6.0 - UNRELEASED
bottom (#445, #595).
* Added man page (`peco.1`) for offline documentation (#467, #587).
* Added support for ANSI color codes in the `--prompt` string (#294, #586).
* Added `--select-all` option to select all input lines and immediately
exit without displaying the selection view. When combined with
`--query`, only matching lines are selected.
* Added `SuppressStatusMsg` config field to suppress the status message
bar at the bottom of the screen.
* Added `FilterBufSize` config field to control the internal buffer
size (in lines) used during filtering. Default is 1000.
* Added `Prompt` and `Context` style targets. `Prompt` controls the
appearance of the query prompt prefix (e.g. `QUERY>`). `Context`
controls the appearance of context lines shown by ZoomIn (default:
bold).
* Added `#RRGGBB` truecolor support in style configuration. You can
now use hex color values like `"#ff6600"` for foreground and
`"on_#003366"` for background colors.
* Added `QueryCursor` style for explicit control over the query prompt
cursor appearance. When not configured, the cursor is derived from
the `Query` style by swapping fg/bg colors.

View file

@ -159,14 +159,16 @@ If your input contains very long lines (e.g. minified files) and they do not app
## ANSI Color Support
When the `--ansi` flag is enabled, peco parses ANSI SGR (Select Graphic Rendition) escape sequences from the input and renders the original colors in the terminal. This lets you pipe colored output from tools like `git log --color`, `rg --color=always`, or `ls --color` through peco while preserving the visual formatting.
By default (`--color=auto`), peco parses ANSI SGR (Select Graphic Rendition) escape sequences from the input and renders the original colors in the terminal. This lets you pipe colored output from tools like `git log --color`, `rg --color=always`, or `ls --color` through peco while preserving the visual formatting.
```
git log --color=always | peco --ansi
rg --color=always pattern | peco --ansi
ls --color=always | peco --ansi
git log --color=always | peco
rg --color=always pattern | peco
ls --color=always | peco
```
To disable ANSI color rendering, use `--color=none`.
Supported ANSI features:
- Basic 8 foreground and background colors (30-37, 40-47)
- 256-color palette (38;5;N, 48;5;N)
@ -174,12 +176,12 @@ Supported ANSI features:
- Bold, underline, and reverse attributes
- Reset sequences
When ANSI mode is enabled:
When ANSI color support is enabled:
- Filtering and matching operate against the **stripped** (plain text) version of each line, so escape codes do not interfere with your queries
- ANSI colors are displayed as the **base layer**; peco's own selection and match highlighting take precedence over ANSI colors
- Selected lines' output preserves the **original** ANSI codes, so downstream tools receive colored text
ANSI mode can also be enabled permanently via the configuration file (see [ANSI](#ansi) under Global configuration).
ANSI color support can be controlled via the configuration file (see [Color](#color) under Global configuration).
## Context Lines (Zoom In/Out)
@ -421,9 +423,9 @@ Upon exiting from the external command, the control goes back to peco where you
To exit out of peco when running in this mode, you must execute the Cancel command, usually the escape key.
### --ansi
### --color `auto|none`
Enables ANSI color code support. When this flag is set, peco parses ANSI SGR escape sequences from the input and renders the colors in the terminal UI. Filtering is performed against the plain text with ANSI codes stripped, and selected output preserves the original ANSI codes.
Controls ANSI color code support. `auto` (the default) enables parsing and rendering of ANSI SGR escape sequences from the input. `none` disables it, stripping escape sequences without rendering colors.
See [ANSI Color Support](#ansi-color-support) in the Features section for details.
@ -467,7 +469,7 @@ Below are configuration sections that you may specify in your config file:
* [Styles](#styles)
* [CustomFilter](#customfilter)
* [Prompt](#prompt)
* [ANSI](#ansi)
* [Color](#color)
## Global
@ -546,17 +548,17 @@ very long lines that prohibit peco from reading them, try increasing this number
The same time, the default MaxScanBuferSize is 256kb.
### ANSI
### Color
```json
{
"ANSI": true
"Color": "none"
}
```
Enables ANSI color code support. When set to `true`, peco parses and renders ANSI SGR escape sequences from the input. This is equivalent to using the `--ansi` command line flag. The command line flag takes precedence if both are specified.
Controls ANSI color code support. Valid values are `"auto"` (parse and render ANSI SGR escape sequences) and `"none"` (disable). This is equivalent to using the `--color` command line flag. The command line flag takes precedence if both are specified.
Default value for ANSI is `false`.
Default value for Color is `"auto"` (enabled).
See [ANSI Color Support](#ansi-color-support) in the Features section for details.