mirror of
https://github.com/charmbracelet/gum
synced 2024-05-17 21:56:42 +02:00
Spin output can still be piped if timeout occurs (#461)
This commit is contained in:
parent
7b16e873c7
commit
4a00db207a
|
@ -107,6 +107,9 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||||
switch msg := msg.(type) {
|
switch msg := msg.(type) {
|
||||||
case timeout.TickTimeoutMsg:
|
case timeout.TickTimeoutMsg:
|
||||||
if msg.TimeoutValue <= 0 {
|
if msg.TimeoutValue <= 0 {
|
||||||
|
// grab current output before closing for piped instances
|
||||||
|
m.stdout = outbuf.String()
|
||||||
|
|
||||||
m.status = exit.StatusAborted
|
m.status = exit.StatusAborted
|
||||||
return m, tea.Quit
|
return m, tea.Quit
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue