Skip to content

feat: support RIPGREP_THREADS environment variable#3415

Open
leno23 wants to merge 3 commits into
BurntSushi:masterfrom
leno23:feat/ripgrep-threads-env-3317
Open

feat: support RIPGREP_THREADS environment variable#3415
leno23 wants to merge 3 commits into
BurntSushi:masterfrom
leno23:feat/ripgrep-threads-env-3317

Conversation

@leno23
Copy link
Copy Markdown

@leno23 leno23 commented May 25, 2026

Summary

  • Add RIPGREP_THREADS to set a default thread count when -j/--threads is not passed
  • 0 in the environment variable keeps the existing heuristic default
  • --threads on the command line takes precedence and ignores invalid env values
  • Document the variable in the --threads flag help text

Fixes #3317

Test plan

  • cargo test -p ripgrep f3317
  • cargo test -p ripgrep test_threads

Allow users to set a default thread count via RIPGREP_THREADS when
--threads is not passed on the command line. CLI flags take precedence
over the environment variable.

Fixes BurntSushi#3317
@leno23 leno23 force-pushed the feat/ripgrep-threads-env-3317 branch from 15d8292 to aa52d9f Compare May 26, 2026 04:12
leno23 added 2 commits May 26, 2026 22:59
Avoid an empty line in the long help text that caused `rg --help`
to panic when stripping roff markup.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Limit CPUs or threads via environmental variable

1 participant