beamtea_filepicker (beamtea v0.1.2)

View Source

A bubble: a filesystem picker, mirroring the filepicker package in charmbracelet/bubbles.

Browse directories with the arrows, descend with Enter/→, ascend with ←/Backspace. Each row shows a Unix-style permissions column, a size column and the name — directories in purple, files in gray. Selecting a file records it; read it back with did_select_file/1.

Summary

Functions

The path of a file the user selected, or none.

The {Name, IsDir} currently under the cursor, or none.

Equivalent to new(#{}).

Options: path (starting directory, default cwd), height (visible rows, default 12), dir_color (default purple), file_color (default gray), select_color.

Navigate in response to a key.

Render the current path and the visible window of entries.

Types

model/0

-opaque model()

Functions

did_select_file(_)

-spec did_select_file(model()) -> none | file:filename().

The path of a file the user selected, or none.

highlighted(_)

-spec highlighted(model()) -> {binary(), boolean()} | none.

The {Name, IsDir} currently under the cursor, or none.

new()

-spec new() -> model().

Equivalent to new(#{}).

new(Opts)

-spec new(map()) -> model().

Options: path (starting directory, default cwd), height (visible rows, default 12), dir_color (default purple), file_color (default gray), select_color.

path(_)

-spec path(model()) -> file:filename().

update(Msg, M)

-spec update(term(), model()) -> {model(), beamtea:cmd()}.

Navigate in response to a key.

view(_)

-spec view(model()) -> iodata().

Render the current path and the visible window of entries.