summaryrefslogtreecommitdiffstats
path: root/src/interactive/app/terminal.rs
diff options
context:
space:
mode:
authorSebastian Thiel <sebastian.thiel@icloud.com>2024-01-23 15:24:52 +0100
committerSebastian Thiel <sebastian.thiel@icloud.com>2024-01-23 15:39:56 +0100
commit78b9a8e22568c902132ed98d32e223ff71eb7b06 (patch)
treec097091966e2af1b00916ff6e70d49ee4362b532 /src/interactive/app/terminal.rs
parent600bee234edd4e7922017c26927a6f135a02c335 (diff)
feat: add `dua i --no-entry-check` flag. (#227)
With it, in interactive mode, entries will not be checked for presence. This can avoid laggy behaviour when switching between directories as `lstat` calls will not run, which can be slow on some filesystems.
Diffstat (limited to 'src/interactive/app/terminal.rs')
-rw-r--r--src/interactive/app/terminal.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/interactive/app/terminal.rs b/src/interactive/app/terminal.rs
index a949bbd..16d7031 100644
--- a/src/interactive/app/terminal.rs
+++ b/src/interactive/app/terminal.rs
@@ -1,5 +1,6 @@
use std::path::PathBuf;
+use crate::interactive::EntryCheck;
use anyhow::Result;
use crossbeam::channel::Receiver;
use crosstermion::input::Event;
@@ -28,6 +29,7 @@ impl TerminalApp {
terminal: &mut Terminal<B>,
walk_options: WalkOptions,
byte_format: ByteFormat,
+ entry_check: bool,
input: Vec<PathBuf>,
) -> Result<TerminalApp>
where
@@ -40,6 +42,7 @@ impl TerminalApp {
let window = MainWindow::default();
let mut state = AppState::new(walk_options, input);
+ state.allow_entry_check = entry_check;
let traversal = Traversal::new();
let stats = TraversalStats::default();
@@ -49,7 +52,7 @@ impl TerminalApp {
state.navigation().view_root,
state.sorting,
state.glob_root(),
- state.scan.is_some(),
+ EntryCheck::new(state.scan.is_some(), state.allow_entry_check),
);
state.navigation_mut().selected = state.entries.first().map(|b| b.index);