File tree Expand file tree Collapse file tree 5 files changed +17
-2
lines changed Expand file tree Collapse file tree 5 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -460,6 +460,10 @@ Environment variables[^2] can be used for configuration. They must be set before
460460- ` _ZO_RESOLVE_SYMLINKS`
461461 - When set to 1, ` z` will resolve symlinks before adding directories to the
462462 database.
463+ - ` _ZO_DISABLE_EXISTENCE_CHECK`
464+ - When set to 1, ` z` will not filter the list for the existing files.
465+ This improves the performance when the files on the list are on
466+ a slow drive, such as a network drive.
463467
464468# # Third-party integrations
465469
Original file line number Diff line number Diff line change @@ -99,6 +99,11 @@ the database. By default, this is set to 10000.
9999.B _ZO_RESOLVE_SYMLINKS
100100When set to 1, \fB z \fR will resolve symlinks before adding directories to
101101the database.
102+ .TP
103+ .B _ZO_DISABLE_EXISTENCE_CHECK
104+ When set to 1, \fB z \fR will not filter the list for the existing files.
105+ This improves the performance when the files on the list are on a slow drive,
106+ such as a network drive.
102107.SH ALGORITHM
103108.TP
104109.B AGING
Original file line number Diff line number Diff line change @@ -27,7 +27,8 @@ https://github.com/ajeetdsouza/zoxide
2727{tab}<bold>_ZO_EXCLUDE_DIRS</bold> {tab}List of directory globs to be excluded
2828{tab}<bold>_ZO_FZF_OPTS</bold> {tab}Custom flags to pass to fzf
2929{tab}<bold>_ZO_MAXAGE</bold> {tab}Maximum total age after which entries start getting deleted
30- {tab}<bold>_ZO_RESOLVE_SYMLINKS</bold>{tab}Resolve symlinks when storing paths" ) . into_resettable ( )
30+ {tab}<bold>_ZO_RESOLVE_SYMLINKS</bold>{tab}Resolve symlinks when storing paths
31+ {tab}<bold>_ZO_DISABLE_EXISTENCE_CHECK</bold>{tab}Do not filter the list by existing files" ) . into_resettable ( )
3132 }
3233}
3334
Original file line number Diff line number Diff line change @@ -60,3 +60,7 @@ pub fn maxage() -> Result<Rank> {
6060pub fn resolve_symlinks ( ) -> bool {
6161 env:: var_os ( "_ZO_RESOLVE_SYMLINKS" ) . is_some_and ( |var| var == "1" )
6262}
63+
64+ pub fn disable_existence_filter ( ) -> bool {
65+ env:: var_os ( "_ZO_DISABLE_EXISTENCE_CHECK" ) . is_some_and ( |var| var == "1" )
66+ }
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ use std::{fs, path};
55
66use glob:: Pattern ;
77
8+ use crate :: config;
89use crate :: db:: { Database , Dir , Epoch } ;
910use crate :: util:: { self , MONTH } ;
1011
@@ -65,7 +66,7 @@ impl<'a> Stream<'a> {
6566 }
6667
6768 fn filter_by_exists ( & self , path : & str ) -> bool {
68- if !self . options . exists {
69+ if !self . options . exists || config :: disable_existence_filter ( ) {
6970 return true ;
7071 }
7172
You can’t perform that action at this time.
0 commit comments