pub struct App {Show 22 fields
pub left: FileExplorer,
pub right: FileExplorer,
pub active: Pane,
pub clipboard: Option<ClipboardItem>,
pub themes: Vec<(&'static str, &'static str, Theme)>,
pub theme_idx: usize,
pub show_theme_panel: bool,
pub show_options_panel: bool,
pub single_pane: bool,
pub modal: Option<Modal>,
pub selected: Option<PathBuf>,
pub status_msg: String,
pub snackbar: Option<Snackbar>,
pub copy_progress: Option<CopyProgress>,
pub cd_on_exit: bool,
pub editor: Editor,
pub open_with_editor: Option<PathBuf>,
pub show_editor_panel: bool,
pub editor_panel_idx: usize,
pub verbose: bool,
pub debug_log: Vec<String>,
pub debug_scroll: usize,
}Fields§
§left: FileExplorerThe left-hand explorer pane.
right: FileExplorerThe right-hand explorer pane.
active: PaneWhich pane currently has keyboard focus.
clipboard: Option<ClipboardItem>The most recently yanked entry, if any.
themes: Vec<(&'static str, &'static str, Theme)>All available themes as (name, description, Theme) triples.
theme_idx: usizeIndex into themes for the currently active theme.
show_theme_panel: boolWhether the theme-picker side-panel is visible.
show_options_panel: boolWhether the options side-panel is visible.
single_pane: boolWhether only the active pane is shown (single-pane mode).
modal: Option<Modal>The currently displayed confirmation modal, if any.
selected: Option<PathBuf>The path chosen by the user (set on Enter / → confirm).
status_msg: StringOne-line status text shown in the action bar.
snackbar: Option<Snackbar>Optional floating notification that auto-expires.
copy_progress: Option<CopyProgress>Progress of an ongoing copy/move operation, if any.
cd_on_exit: boolWhether cd-on-exit is enabled (dismiss prints cwd to stdout).
editor: EditorWhich editor to open when the user presses e on a file.
open_with_editor: Option<PathBuf>When Some, the run-loop should suspend the TUI, open this path in
self.editor, then restore the TUI. Set by the e key handler;
cleared by run_loop after the editor exits.
show_editor_panel: boolWhether the editor-picker side-panel is visible.
editor_panel_idx: usizeHighlighted row index in the editor-picker panel (cursor position).
verbose: boolWhether the debug log panel is visible (--verbose / -v).
debug_log: Vec<String>Accumulated debug log lines shown in the log panel.
debug_scroll: usizeScroll offset for the debug log panel (0 = pinned to bottom).
Implementations§
Source§impl App
impl App
Sourcepub fn new(opts: AppOptions) -> Self
pub fn new(opts: AppOptions) -> Self
Construct a new App from an AppOptions config struct.
Sourcepub fn log(&mut self, msg: impl Into<String>)
pub fn log(&mut self, msg: impl Into<String>)
Append a line to the debug log (visible in the log panel when
--verbose is active).
Sourcepub fn first_ide_idx() -> usize
pub fn first_ide_idx() -> usize
Index of the first IDE/GUI editor in the [all_editors] list.
Everything before this index is a terminal editor; everything from this index onward is a GUI editor or IDE. Used by the editor panel to render the two section headers.
Sourcepub fn all_editors() -> Vec<Editor>
pub fn all_editors() -> Vec<Editor>
Return every Editor variant in display order.
Used by the editor-picker panel to populate the list and navigate it. Terminal editors come first, then GUI editors/IDEs.
Sourcepub fn sync_editor_panel_idx(&mut self)
pub fn sync_editor_panel_idx(&mut self)
Sync editor_panel_idx to point at the currently active editor.
Called when the panel is opened so the cursor lands on the current
selection. Defaults to index 0 (Editor::None) if not found.
Sourcepub fn notify(&mut self, msg: impl Into<String>)
pub fn notify(&mut self, msg: impl Into<String>)
Show an info snackbar with the given message (auto-expires after 3 s).
Sourcepub fn notify_error(&mut self, msg: impl Into<String>)
pub fn notify_error(&mut self, msg: impl Into<String>)
Show an error snackbar with the given message (auto-expires after 4 s).
pub fn active_pane(&self) -> &FileExplorer
Sourcepub fn active_pane_mut(&mut self) -> &mut FileExplorer
pub fn active_pane_mut(&mut self) -> &mut FileExplorer
Return a mutable reference to the currently active pane.
Sourcepub fn theme_name(&self) -> &str
pub fn theme_name(&self) -> &str
Return the name of the currently selected theme.
Sourcepub fn theme_desc(&self) -> &str
pub fn theme_desc(&self) -> &str
Return the description of the currently selected theme.
Sourcepub fn next_theme(&mut self)
pub fn next_theme(&mut self)
Advance to the next theme, wrapping around at the end of the list.
Sourcepub fn prev_theme(&mut self)
pub fn prev_theme(&mut self)
Retreat to the previous theme, wrapping around at the beginning.
Sourcepub fn yank(&mut self, op: ClipOp)
pub fn yank(&mut self, op: ClipOp)
Yank (copy or cut) into the clipboard.
Marks are checked in priority order:
- Active pane marks — the normal single-pane workflow.
- Inactive pane marks — handles the common dual-pane workflow where
the user marks files in the source pane, tabs to the destination
pane, and then presses
y. - Active pane cursor entry — fallback when nothing is marked.
Marks on whichever pane was used are cleared after the yank.
Sourcepub fn paste(&mut self)
pub fn paste(&mut self)
Paste the clipboard item into the active pane’s current directory.
If the destination already exists, a Modal::Overwrite is
raised instead of overwriting silently.
Sourcepub fn do_paste(&mut self, src: &Path, dst: &Path, is_cut: bool)
pub fn do_paste(&mut self, src: &Path, dst: &Path, is_cut: bool)
Perform the actual copy/move for a single src→dst pair.
Used by the overwrite-confirmation modal path (single file only).
For multi-file paste use App::do_paste_all.
Sourcepub fn do_paste_all(&mut self, srcs: &[PathBuf], dst_dir: &Path, is_cut: bool)
pub fn do_paste_all(&mut self, srcs: &[PathBuf], dst_dir: &Path, is_cut: bool)
Paste all srcs into dst_dir, performing copy or move for each.
Errors are collected and reported in the status message alongside the success count. On a fully successful cut the clipboard is cleared.
Sourcepub fn prompt_delete(&mut self)
pub fn prompt_delete(&mut self)
Raise a Modal::Delete for the currently highlighted entry,
or a Modal::MultiDelete when there are space-marked entries
in the active pane.
Sourcepub fn confirm_delete_many(&mut self, paths: &[PathBuf])
pub fn confirm_delete_many(&mut self, paths: &[PathBuf])
Execute a confirmed multi-deletion and reload both panes.
Sourcepub fn confirm_delete(&mut self, path: &Path)
pub fn confirm_delete(&mut self, path: &Path)
Execute a confirmed deletion and reload both panes.
Sourcepub fn handle_key(&mut self, key: KeyEvent) -> Result<bool>
pub fn handle_key(&mut self, key: KeyEvent) -> Result<bool>
Process a single [KeyEvent] and update application state.
This is the core key-dispatch method. Library consumers that read
their own events (e.g. via a shared event loop) should call this
directly instead of App::handle_event.
Returns true when the event loop should exit (user confirmed a
selection or dismissed the explorer).
§Example
use crossterm::event::{self, Event, KeyCode, KeyEvent, KeyModifiers};
use tui_file_explorer::{App, AppOptions};
let mut app = App::new(AppOptions::default());
// Read the event yourself and forward only key events.
if let Event::Key(key) = event::read().unwrap() {
let should_exit = app.handle_key(key).unwrap();
}Sourcepub fn handle_event(&mut self) -> Result<bool>
pub fn handle_event(&mut self) -> Result<bool>
Read one terminal event and update application state.
Calls event::read internally. If your application already owns the
event loop and reads events itself, call App::handle_key instead.
Returns true when the event loop should exit (user confirmed a
selection or dismissed the explorer).
Auto Trait Implementations§
impl Freeze for App
impl RefUnwindSafe for App
impl Send for App
impl Sync for App
impl Unpin for App
impl UnsafeUnpin for App
impl UnwindSafe for App
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more