mirror of
https://github.com/charmbracelet/gum
synced 2026-03-14 13:45:45 +01:00
fix(confirm,choose,file,input): timeout handling (#718)
* fix(confirm,choose,file,input): timeout handling - some fields were not actually using the `--timeout` value - some fields had different behavior when a timeout did occur. On this matter, it seems to me the best way forward is to specifically say it timed out, and after how long - added exit status 124 (copied from `timeout` from coreutils) (fixes #684) Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com> * Update main.go Co-authored-by: Ayman Bagabas <ayman.bagabas@gmail.com> * Update internal/exit/exit.go Co-authored-by: ccoVeille <3875889+ccoVeille@users.noreply.github.com> * fix: improve Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com> * fix: stderr --------- Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com> Co-authored-by: Ayman Bagabas <ayman.bagabas@gmail.com> Co-authored-by: ccoVeille <3875889+ccoVeille@users.noreply.github.com>
This commit is contained in:
parent
3cec9b7b9a
commit
c868aa1c6c
6 changed files with 41 additions and 17 deletions
|
|
@ -5,6 +5,7 @@ import (
|
|||
"fmt"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/charmbracelet/gum/internal/exit"
|
||||
"github.com/charmbracelet/huh"
|
||||
"github.com/charmbracelet/lipgloss"
|
||||
)
|
||||
|
|
@ -51,14 +52,14 @@ func (o Options) Run() error {
|
|||
Value(&path),
|
||||
),
|
||||
).
|
||||
WithTimeout(o.Timeout).
|
||||
WithShowHelp(o.ShowHelp).
|
||||
WithKeyMap(keymap).
|
||||
WithTheme(theme).
|
||||
Run()
|
||||
if err != nil {
|
||||
return err
|
||||
return exit.Handle(err, o.Timeout)
|
||||
}
|
||||
|
||||
fmt.Println(path)
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue