Skip to main content

Module file_browser

Module file_browser 

Source

Structs§

CopyRequest
Pending copy operation awaiting confirmation.
FileBrowserState
State for the dual-pane file browser overlay.
FileEntry
A file or directory entry in the browser.
ScpResult
Result of an scp transfer.

Enums§

BrowserPane
Which pane is active.
BrowserSort
Sort mode for file browser panes.

Functions§

build_scp_args
Build scp arguments for a file transfer. Returns the args to pass after scp -F <config>.
fetch_remote_listing
Fetch remote directory listing synchronously (used by spawn_remote_listing).
filter_ssh_warnings
Filter SSH warning noise from stderr, keeping only actionable error lines. Strips lines like “** WARNING: connection is not using a post-quantum key exchange”.
format_relative_time
Format a Unix timestamp as a relative or short date string. Returns strings like “2m ago”, “3h ago”, “5d ago”, “Jan 15”, “Mar 2024”.
format_size
Format a file size in human-readable form.
get_remote_home
Get the remote home directory via pwd.
list_local
List local directory entries. Sorts: directories first, then by name or date. Filters dotfiles based on show_hidden.
parse_ls_output
Parse ls -lhAL output into FileEntry list. With -L, symlinks are dereferenced so their target type is shown directly. Recognizes directories via ‘d’ permission prefix. Skips the “total” line. Broken symlinks are omitted by ls -L (they cannot be transferred anyway).
run_scp
Run scp in the background with captured stderr for error reporting. Stderr is piped and captured so errors can be extracted. Progress percentage is not available because scp only outputs progress to a TTY, not to a pipe. Stdin is null (askpass handles authentication). Stdout is null (scp has no meaningful stdout output).
sort_entries
Sort file entries: directories first, then by the chosen mode.
spawn_remote_listing
Spawn background thread for remote directory listing. Sends result back via the provided sender function.