This commit is contained in:
Aiden Ghim 2026-05-22 11:56:32 +07:00 committed by GitHub
commit 39819ac71c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 18 additions and 0 deletions

View File

@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- `$_ZO_FZF_OPTS_FILE` to specify configuration file for `fzf`
### Added
- POSIX: support for non-Cygwin Windows environments (e.g. Busybox).
- `import` now supports fetching entries from `atuin`.

View File

@ -92,6 +92,10 @@ to use \fBzoxide-remove\fR(1) to remove any existing entries from the database.
Custom options to pass to \fBfzf\fR(1) during interactive selection. See the
manpage for the full list of options.
.TP
.B _ZO_FZF_OPTS_FILE
Path to file containing custom options to pass to \fBfzf\fR(1) during
interactive selection. See the manpage for the full list of options.
.TP
.B _ZO_MAXAGE
Configures the aging algorithm, which limits the maximum number of entries in
the database. By default, this is set to 10000.

View File

@ -26,6 +26,7 @@ https://github.com/ajeetdsouza/zoxide
{tab}<bold>_ZO_ECHO</bold> {tab}Print the matched directory before navigating to it when set to 1
{tab}<bold>_ZO_EXCLUDE_DIRS</bold> {tab}List of directory globs to be excluded
{tab}<bold>_ZO_FZF_OPTS</bold> {tab}Custom flags to pass to fzf
{tab}<bold>_ZO_FZF_OPTS_FILE</bold> {tab}Path to file containing custom flags to pass to fzf
{tab}<bold>_ZO_MAXAGE</bold> {tab}Maximum total age after which entries start getting deleted
{tab}<bold>_ZO_RESOLVE_SYMLINKS</bold>{tab}Resolve symlinks when storing paths").into_resettable()
}

View File

@ -92,6 +92,11 @@ impl Query {
fn get_fzf() -> Result<FzfChild> {
let mut fzf = Fzf::new()?;
if let Some(fzf_opts_file) = config::fzf_opts_file() {
fzf.env("FZF_DEFAULT_OPTS_FILE", fzf_opts_file);
}
if let Some(fzf_opts) = config::fzf_opts() {
fzf.env("FZF_DEFAULT_OPTS", fzf_opts)
} else {

View File

@ -47,6 +47,10 @@ pub fn fzf_opts() -> Option<OsString> {
env::var_os("_ZO_FZF_OPTS")
}
pub fn fzf_opts_file() -> Option<OsString> {
env::var_os("_ZO_FZF_OPTS_FILE")
}
pub fn maxage() -> Result<Rank> {
env::var_os("_ZO_MAXAGE").map_or(Ok(10_000.0), |maxage| {
let maxage = maxage.to_str().context("invalid unicode in _ZO_MAXAGE")?;