Skip to content

Commit

Permalink
try to capture stdout
Browse files Browse the repository at this point in the history
  • Loading branch information
robinovitch61 committed May 4, 2024
1 parent b7aaf10 commit 74e01f3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/tui/components/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,15 +320,15 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
c.Env = os.Environ()

stdoutProxy := &nomad.StdoutProxy{}
c.Stdout = stdoutProxy
m.getCurrentPageModel().SetDoesNeedNewInput()
if m.session != nil {
wc := wish.Command(m.session, c.Path, c.Args[1:]...)
dev.Debug(fmt.Sprintf("path: %s, args: %v", c.Path, c.Args))
wc.SetStdout(stdoutProxy)
return m, tea.Exec(wc, func(err error) tea.Msg {
return nomad.ExecCompleteMsg{Output: string(stdoutProxy.SavedOutput)}
})
}
c.Stdout = stdoutProxy
return m, tea.ExecProcess(c, func(err error) tea.Msg {
return nomad.ExecCompleteMsg{Output: string(stdoutProxy.SavedOutput)}
})
Expand Down

0 comments on commit 74e01f3

Please sign in to comment.