tui

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 31, 2026 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

type Model struct {
	// contains filtered or unexported fields
}

Model is the bubbletea model for the file picker.

func NewPicker

func NewPicker(root string, preSelected map[string]bool, preWritable map[string]bool) *Model

NewPicker creates a new picker model rooted at root.

func (*Model) Init

func (m *Model) Init() tea.Cmd

func (*Model) Result

func (m *Model) Result() PickerResult

Result returns the picker result. Only valid after the program exits.

func (*Model) Update

func (m *Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*Model) View

func (m *Model) View() string

type PickerResult

type PickerResult struct {
	Confirmed  bool
	Selections []Selection
}

PickerResult is returned when the user confirms or cancels.

func Run

func Run(root string, preSelected map[string]bool, preWritable map[string]bool) (PickerResult, error)

Run starts the picker and returns the result.

type Selection

type Selection struct {
	Path     string
	IsDir    bool
	Writable bool
}

Selection holds a path, whether it's a directory, and its writable state.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL