Config and Shell Integration/Force colors through a pager

Keep syntax highlighting in paged output.

Section: Editor-friendly formats

Force colors through a pager

bash
bash
rg --color=always 'panic!' src/ | less -R
Explanation

`less -R` preserves raw ANSI colors in paged results.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Editor-friendly formats
Disable ANSI color for downstream tools
Prevent escape sequences from breaking consumers.
OpenIn sheetbashsame section
Emit vimgrep-style results
Print `file:line:column:text` output for editors.
OpenIn sheetbashsame section
Use simple no-heading output
Produce a stream of one match per line.
OpenIn sheetbashsame section
Use JSON for custom tooling
Feed structured matches into a script or app.
OpenIn sheetbashsame section
Point ripgrep at a config file
Set a path that ripgrep reads for default arguments.
OpenIn sheetbash1 tag match
Search tracked files only
Restrict ripgrep to files known to git.
OpenIn sheetbash1 tag match