Closed
Description
Here's the screenshot:
Sample code to repro this issue:
func FilePick() (string, error) {
theme := huh.ThemeCharm()
keymap := huh.NewDefaultKeyMap()
keymap.FilePicker.Open.SetEnabled(false)
path, err := filepath.Abs(".")
if err != nil {
return "", fmt.Errorf("file not found: %w", err)
}
err = huh.NewForm(
huh.NewGroup(
huh.NewFilePicker().
CurrentDirectory(path).
Title(Header).
Description("Pick an image file").
Picking(true).
AllowedTypes([]string{".jpg", ".go"}).
DirAllowed(false).
FileAllowed(true).
Height(10).
ShowHidden(true).
ShowPermissions(true).
ShowSize(true).
Value(&path),
),
).
WithShowHelp(ShowHelp).
WithKeyMap(keymap).
WithTheme(theme).
Run()
if err != nil {
return "", err
}
fmt.Println(path)
return path, nil
}
P.S.
What about the align style like ls -lash
?